1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. cen
  5. getTransitRouterCidrs
Alibaba Cloud v3.55.0 published on Tuesday, Apr 30, 2024 by Pulumi

alicloud.cen.getTransitRouterCidrs

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.55.0 published on Tuesday, Apr 30, 2024 by Pulumi

    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:

    TransitRouterId string
    The ID of the transit router.
    Ids List<string>
    A list of Cen Transit Router Cidr IDs.
    NameRegex string
    A regex string to filter results by Transit Router Cidr name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    TransitRouterCidrId string
    The ID of the transit router cidr.
    TransitRouterId string
    The ID of the transit router.
    Ids []string
    A list of Cen Transit Router Cidr IDs.
    NameRegex string
    A regex string to filter results by Transit Router Cidr name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    TransitRouterCidrId string
    The ID of the transit router cidr.
    transitRouterId String
    The ID of the transit router.
    ids List<String>
    A list of Cen Transit Router Cidr IDs.
    nameRegex String
    A regex string to filter results by Transit Router Cidr name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    transitRouterCidrId String
    The ID of the transit router cidr.
    transitRouterId string
    The ID of the transit router.
    ids string[]
    A list of Cen Transit Router Cidr IDs.
    nameRegex string
    A regex string to filter results by Transit Router Cidr name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    transitRouterCidrId string
    The ID of the transit router cidr.
    transit_router_id str
    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_cidr_id str
    The ID of the transit router cidr.
    transitRouterId String
    The ID of the transit router.
    ids List<String>
    A list of Cen Transit Router Cidr IDs.
    nameRegex String
    A regex string to filter results by Transit Router Cidr name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    transitRouterCidrId String
    The ID of the transit router cidr.

    getTransitRouterCidrs Result

    The following output properties are available:

    Cidrs List<Pulumi.AliCloud.Cen.Outputs.GetTransitRouterCidrsCidr>
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    Names List<string>
    TransitRouterId string
    NameRegex string
    OutputFile string
    TransitRouterCidrId string
    Cidrs []GetTransitRouterCidrsCidr
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Names []string
    TransitRouterId string
    NameRegex string
    OutputFile string
    TransitRouterCidrId string
    cidrs List<GetTransitRouterCidrsCidr>
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    transitRouterId String
    nameRegex String
    outputFile String
    transitRouterCidrId String
    cidrs GetTransitRouterCidrsCidr[]
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    names string[]
    transitRouterId string
    nameRegex string
    outputFile string
    transitRouterCidrId string
    cidrs Sequence[GetTransitRouterCidrsCidr]
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    names Sequence[str]
    transit_router_id str
    name_regex str
    output_file str
    transit_router_cidr_id str
    cidrs List<Property Map>
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    transitRouterId String
    nameRegex String
    outputFile String
    transitRouterCidrId String

    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>.
    PublishCidrRoute bool
    Whether to allow automatically adding Transit Router Cidr in Transit Router Route Table.
    TransitRouterCidrId string
    The ID of the transit router cidr.
    TransitRouterCidrName string
    The name of the transit router.
    TransitRouterId string
    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>.
    PublishCidrRoute bool
    Whether to allow automatically adding Transit Router Cidr in Transit Router Route Table.
    TransitRouterCidrId string
    The ID of the transit router cidr.
    TransitRouterCidrName string
    The name of the transit router.
    TransitRouterId string
    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>.
    publishCidrRoute Boolean
    Whether to allow automatically adding Transit Router Cidr in Transit Router Route Table.
    transitRouterCidrId String
    The ID of the transit router cidr.
    transitRouterCidrName String
    The name of the transit router.
    transitRouterId String
    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>.
    publishCidrRoute boolean
    Whether to allow automatically adding Transit Router Cidr in Transit Router Route Table.
    transitRouterCidrId string
    The ID of the transit router cidr.
    transitRouterCidrName string
    The name of the transit router.
    transitRouterId string
    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_route bool
    Whether to allow automatically adding Transit Router Cidr in Transit Router Route Table.
    transit_router_cidr_id str
    The ID of the transit router cidr.
    transit_router_cidr_name str
    The name of the transit router.
    transit_router_id str
    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>.
    publishCidrRoute Boolean
    Whether to allow automatically adding Transit Router Cidr in Transit Router Route Table.
    transitRouterCidrId String
    The ID of the transit router cidr.
    transitRouterCidrName String
    The name of the transit router.
    transitRouterId String
    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.
    alicloud logo
    Alibaba Cloud v3.55.0 published on Tuesday, Apr 30, 2024 by Pulumi