Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi
alicloud.cen.getTransitRouterCidrs
Explore with Pulumi AI
This data source provides the Cen Transit Router Cidrs of the current Alibaba Cloud user.
NOTE: Available in v1.193.0+.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const ids = alicloud.cen.getTransitRouterCidrs({
ids: ["example_id"],
transitRouterId: "tr-6ehx7q2jze8ch5ji0****",
});
export const cenTransitRouterCidrId0 = ids.then(ids => ids.cidrs?.[0]?.id);
const nameRegex = alicloud.cen.getTransitRouterCidrs({
nameRegex: "^my-name",
transitRouterId: "tr-6ehx7q2jze8ch5ji0****",
});
export const cenTransitRouterCidrId1 = nameRegex.then(nameRegex => nameRegex.cidrs?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
ids = alicloud.cen.get_transit_router_cidrs(ids=["example_id"],
transit_router_id="tr-6ehx7q2jze8ch5ji0****")
pulumi.export("cenTransitRouterCidrId0", ids.cidrs[0].id)
name_regex = alicloud.cen.get_transit_router_cidrs(name_regex="^my-name",
transit_router_id="tr-6ehx7q2jze8ch5ji0****")
pulumi.export("cenTransitRouterCidrId1", name_regex.cidrs[0].id)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cen"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
ids, err := cen.GetTransitRouterCidrs(ctx, &cen.GetTransitRouterCidrsArgs{
Ids: []string{
"example_id",
},
TransitRouterId: "tr-6ehx7q2jze8ch5ji0****",
}, nil)
if err != nil {
return err
}
ctx.Export("cenTransitRouterCidrId0", ids.Cidrs[0].Id)
nameRegex, err := cen.GetTransitRouterCidrs(ctx, &cen.GetTransitRouterCidrsArgs{
NameRegex: pulumi.StringRef("^my-name"),
TransitRouterId: "tr-6ehx7q2jze8ch5ji0****",
}, nil)
if err != nil {
return err
}
ctx.Export("cenTransitRouterCidrId1", nameRegex.Cidrs[0].Id)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var ids = AliCloud.Cen.GetTransitRouterCidrs.Invoke(new()
{
Ids = new[]
{
"example_id",
},
TransitRouterId = "tr-6ehx7q2jze8ch5ji0****",
});
var nameRegex = AliCloud.Cen.GetTransitRouterCidrs.Invoke(new()
{
NameRegex = "^my-name",
TransitRouterId = "tr-6ehx7q2jze8ch5ji0****",
});
return new Dictionary<string, object?>
{
["cenTransitRouterCidrId0"] = ids.Apply(getTransitRouterCidrsResult => getTransitRouterCidrsResult.Cidrs[0]?.Id),
["cenTransitRouterCidrId1"] = nameRegex.Apply(getTransitRouterCidrsResult => getTransitRouterCidrsResult.Cidrs[0]?.Id),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.cen.CenFunctions;
import com.pulumi.alicloud.cen.inputs.GetTransitRouterCidrsArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var ids = CenFunctions.getTransitRouterCidrs(GetTransitRouterCidrsArgs.builder()
.ids("example_id")
.transitRouterId("tr-6ehx7q2jze8ch5ji0****")
.build());
ctx.export("cenTransitRouterCidrId0", ids.applyValue(getTransitRouterCidrsResult -> getTransitRouterCidrsResult.cidrs()[0].id()));
final var nameRegex = CenFunctions.getTransitRouterCidrs(GetTransitRouterCidrsArgs.builder()
.nameRegex("^my-name")
.transitRouterId("tr-6ehx7q2jze8ch5ji0****")
.build());
ctx.export("cenTransitRouterCidrId1", nameRegex.applyValue(getTransitRouterCidrsResult -> getTransitRouterCidrsResult.cidrs()[0].id()));
}
}
variables:
ids:
fn::invoke:
Function: alicloud:cen:getTransitRouterCidrs
Arguments:
ids:
- example_id
transitRouterId: tr-6ehx7q2jze8ch5ji0****
nameRegex:
fn::invoke:
Function: alicloud:cen:getTransitRouterCidrs
Arguments:
nameRegex: ^my-name
transitRouterId: tr-6ehx7q2jze8ch5ji0****
outputs:
cenTransitRouterCidrId0: ${ids.cidrs[0].id}
cenTransitRouterCidrId1: ${nameRegex.cidrs[0].id}
Using getTransitRouterCidrs
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getTransitRouterCidrs(args: GetTransitRouterCidrsArgs, opts?: InvokeOptions): Promise<GetTransitRouterCidrsResult>
function getTransitRouterCidrsOutput(args: GetTransitRouterCidrsOutputArgs, opts?: InvokeOptions): Output<GetTransitRouterCidrsResult>
def get_transit_router_cidrs(ids: Optional[Sequence[str]] = None,
name_regex: Optional[str] = None,
output_file: Optional[str] = None,
transit_router_cidr_id: Optional[str] = None,
transit_router_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetTransitRouterCidrsResult
def get_transit_router_cidrs_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
name_regex: Optional[pulumi.Input[str]] = None,
output_file: Optional[pulumi.Input[str]] = None,
transit_router_cidr_id: Optional[pulumi.Input[str]] = None,
transit_router_id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetTransitRouterCidrsResult]
func GetTransitRouterCidrs(ctx *Context, args *GetTransitRouterCidrsArgs, opts ...InvokeOption) (*GetTransitRouterCidrsResult, error)
func GetTransitRouterCidrsOutput(ctx *Context, args *GetTransitRouterCidrsOutputArgs, opts ...InvokeOption) GetTransitRouterCidrsResultOutput
> Note: This function is named GetTransitRouterCidrs
in the Go SDK.
public static class GetTransitRouterCidrs
{
public static Task<GetTransitRouterCidrsResult> InvokeAsync(GetTransitRouterCidrsArgs args, InvokeOptions? opts = null)
public static Output<GetTransitRouterCidrsResult> Invoke(GetTransitRouterCidrsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetTransitRouterCidrsResult> getTransitRouterCidrs(GetTransitRouterCidrsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: alicloud:cen/getTransitRouterCidrs:getTransitRouterCidrs
arguments:
# arguments dictionary
The following arguments are supported:
- Transit
Router stringId - The ID of the transit router.
- Ids List<string>
- A list of Cen Transit Router Cidr IDs.
- Name
Regex string - A regex string to filter results by Transit Router Cidr name.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Transit
Router stringCidr Id - The ID of the transit router cidr.
- Transit
Router stringId - The ID of the transit router.
- Ids []string
- A list of Cen Transit Router Cidr IDs.
- Name
Regex string - A regex string to filter results by Transit Router Cidr name.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Transit
Router stringCidr Id - The ID of the transit router cidr.
- transit
Router StringId - The ID of the transit router.
- ids List<String>
- A list of Cen Transit Router Cidr IDs.
- name
Regex String - A regex string to filter results by Transit Router Cidr name.
- output
File String - File name where to save data source results (after running
pulumi preview
). - transit
Router StringCidr Id - The ID of the transit router cidr.
- transit
Router stringId - The ID of the transit router.
- ids string[]
- A list of Cen Transit Router Cidr IDs.
- name
Regex string - A regex string to filter results by Transit Router Cidr name.
- output
File string - File name where to save data source results (after running
pulumi preview
). - transit
Router stringCidr Id - The ID of the transit router cidr.
- transit_
router_ strid - The ID of the transit router.
- ids Sequence[str]
- A list of Cen Transit Router Cidr IDs.
- name_
regex str - A regex string to filter results by Transit Router Cidr name.
- output_
file str - File name where to save data source results (after running
pulumi preview
). - transit_
router_ strcidr_ id - The ID of the transit router cidr.
- transit
Router StringId - The ID of the transit router.
- ids List<String>
- A list of Cen Transit Router Cidr IDs.
- name
Regex String - A regex string to filter results by Transit Router Cidr name.
- output
File String - File name where to save data source results (after running
pulumi preview
). - transit
Router StringCidr Id - The ID of the transit router cidr.
getTransitRouterCidrs Result
The following output properties are available:
- Cidrs
List<Pulumi.
Ali Cloud. Cen. Outputs. Get Transit Router Cidrs Cidr> - Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- Names List<string>
- Transit
Router stringId - Name
Regex string - Output
File string - Transit
Router stringCidr Id
- Cidrs
[]Get
Transit Router Cidrs Cidr - Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- Names []string
- Transit
Router stringId - Name
Regex string - Output
File string - Transit
Router stringCidr Id
- cidrs
List<Get
Transit Router Cidrs Cidr> - id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- transit
Router StringId - name
Regex String - output
File String - transit
Router StringCidr Id
- cidrs
Get
Transit Router Cidrs Cidr[] - id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- names string[]
- transit
Router stringId - name
Regex string - output
File string - transit
Router stringCidr Id
- cidrs
Sequence[Get
Transit Router Cidrs Cidr] - id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- names Sequence[str]
- transit_
router_ strid - name_
regex str - output_
file str - transit_
router_ strcidr_ id
- cidrs List<Property Map>
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- transit
Router StringId - name
Regex String - output
File String - transit
Router StringCidr Id
Supporting Types
GetTransitRouterCidrsCidr
- Cidr string
- The cidr of the transit router.
- Description string
- The description of the transit router.
- Family string
- The type of the transit router cidr.
- Id string
- The ID of the Cen Transit Router Cidr. It formats as
<transit_router_id>:<transit_router_cidr_id>
. - Publish
Cidr boolRoute - Whether to allow automatically adding Transit Router Cidr in Transit Router Route Table.
- Transit
Router stringCidr Id - The ID of the transit router cidr.
- Transit
Router stringCidr Name - The name of the transit router.
- Transit
Router stringId - The ID of the transit router.
- Cidr string
- The cidr of the transit router.
- Description string
- The description of the transit router.
- Family string
- The type of the transit router cidr.
- Id string
- The ID of the Cen Transit Router Cidr. It formats as
<transit_router_id>:<transit_router_cidr_id>
. - Publish
Cidr boolRoute - Whether to allow automatically adding Transit Router Cidr in Transit Router Route Table.
- Transit
Router stringCidr Id - The ID of the transit router cidr.
- Transit
Router stringCidr Name - The name of the transit router.
- Transit
Router stringId - The ID of the transit router.
- cidr String
- The cidr of the transit router.
- description String
- The description of the transit router.
- family String
- The type of the transit router cidr.
- id String
- The ID of the Cen Transit Router Cidr. It formats as
<transit_router_id>:<transit_router_cidr_id>
. - publish
Cidr BooleanRoute - Whether to allow automatically adding Transit Router Cidr in Transit Router Route Table.
- transit
Router StringCidr Id - The ID of the transit router cidr.
- transit
Router StringCidr Name - The name of the transit router.
- transit
Router StringId - The ID of the transit router.
- cidr string
- The cidr of the transit router.
- description string
- The description of the transit router.
- family string
- The type of the transit router cidr.
- id string
- The ID of the Cen Transit Router Cidr. It formats as
<transit_router_id>:<transit_router_cidr_id>
. - publish
Cidr booleanRoute - Whether to allow automatically adding Transit Router Cidr in Transit Router Route Table.
- transit
Router stringCidr Id - The ID of the transit router cidr.
- transit
Router stringCidr Name - The name of the transit router.
- transit
Router stringId - The ID of the transit router.
- cidr str
- The cidr of the transit router.
- description str
- The description of the transit router.
- family str
- The type of the transit router cidr.
- id str
- The ID of the Cen Transit Router Cidr. It formats as
<transit_router_id>:<transit_router_cidr_id>
. - publish_
cidr_ boolroute - Whether to allow automatically adding Transit Router Cidr in Transit Router Route Table.
- transit_
router_ strcidr_ id - The ID of the transit router cidr.
- transit_
router_ strcidr_ name - The name of the transit router.
- transit_
router_ strid - The ID of the transit router.
- cidr String
- The cidr of the transit router.
- description String
- The description of the transit router.
- family String
- The type of the transit router cidr.
- id String
- The ID of the Cen Transit Router Cidr. It formats as
<transit_router_id>:<transit_router_cidr_id>
. - publish
Cidr BooleanRoute - Whether to allow automatically adding Transit Router Cidr in Transit Router Route Table.
- transit
Router StringCidr Id - The ID of the transit router cidr.
- transit
Router StringCidr Name - The name of the transit router.
- transit
Router StringId - The ID of the transit router.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.