1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. cen
  5. getTransitRouterRouteTables
Alibaba Cloud v3.81.0 published on Monday, Jun 23, 2025 by Pulumi

alicloud.cen.getTransitRouterRouteTables

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.81.0 published on Monday, Jun 23, 2025 by Pulumi

    This data source provides the CEN Transit Router Route Tables of the current Alibaba Cloud user.

    NOTE: Available since v1.126.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "terraform-example";
    const _default = new alicloud.cen.Instance("default", {
        cenInstanceName: name,
        protectionLevel: "REDUCED",
    });
    const defaultTransitRouter = new alicloud.cen.TransitRouter("default", {
        cenId: _default.id,
        transitRouterName: name,
    });
    const defaultTransitRouterRouteTable = new alicloud.cen.TransitRouterRouteTable("default", {
        transitRouterId: defaultTransitRouter.transitRouterId,
        transitRouterRouteTableDescription: name,
        transitRouterRouteTableName: name,
    });
    const ids = alicloud.cen.getTransitRouterRouteTablesOutput({
        transitRouterId: defaultTransitRouterRouteTable.transitRouterId,
        ids: [defaultTransitRouterRouteTable.transitRouterRouteTableId],
    });
    export const cenTransitRouterRouteTableId0 = ids.apply(ids => ids.tables?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "terraform-example"
    default = alicloud.cen.Instance("default",
        cen_instance_name=name,
        protection_level="REDUCED")
    default_transit_router = alicloud.cen.TransitRouter("default",
        cen_id=default.id,
        transit_router_name=name)
    default_transit_router_route_table = alicloud.cen.TransitRouterRouteTable("default",
        transit_router_id=default_transit_router.transit_router_id,
        transit_router_route_table_description=name,
        transit_router_route_table_name=name)
    ids = alicloud.cen.get_transit_router_route_tables_output(transit_router_id=default_transit_router_route_table.transit_router_id,
        ids=[default_transit_router_route_table.transit_router_route_table_id])
    pulumi.export("cenTransitRouterRouteTableId0", ids.tables[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cen"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		name := "terraform-example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		_default, err := cen.NewInstance(ctx, "default", &cen.InstanceArgs{
    			CenInstanceName: pulumi.String(name),
    			ProtectionLevel: pulumi.String("REDUCED"),
    		})
    		if err != nil {
    			return err
    		}
    		defaultTransitRouter, err := cen.NewTransitRouter(ctx, "default", &cen.TransitRouterArgs{
    			CenId:             _default.ID(),
    			TransitRouterName: pulumi.String(name),
    		})
    		if err != nil {
    			return err
    		}
    		defaultTransitRouterRouteTable, err := cen.NewTransitRouterRouteTable(ctx, "default", &cen.TransitRouterRouteTableArgs{
    			TransitRouterId:                    defaultTransitRouter.TransitRouterId,
    			TransitRouterRouteTableDescription: pulumi.String(name),
    			TransitRouterRouteTableName:        pulumi.String(name),
    		})
    		if err != nil {
    			return err
    		}
    		ids := cen.GetTransitRouterRouteTablesOutput(ctx, cen.GetTransitRouterRouteTablesOutputArgs{
    			TransitRouterId: defaultTransitRouterRouteTable.TransitRouterId,
    			Ids: pulumi.StringArray{
    				defaultTransitRouterRouteTable.TransitRouterRouteTableId,
    			},
    		}, nil)
    		ctx.Export("cenTransitRouterRouteTableId0", ids.ApplyT(func(ids cen.GetTransitRouterRouteTablesResult) (*string, error) {
    			return &ids.Tables[0].Id, nil
    		}).(pulumi.StringPtrOutput))
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var name = config.Get("name") ?? "terraform-example";
        var @default = new AliCloud.Cen.Instance("default", new()
        {
            CenInstanceName = name,
            ProtectionLevel = "REDUCED",
        });
    
        var defaultTransitRouter = new AliCloud.Cen.TransitRouter("default", new()
        {
            CenId = @default.Id,
            TransitRouterName = name,
        });
    
        var defaultTransitRouterRouteTable = new AliCloud.Cen.TransitRouterRouteTable("default", new()
        {
            TransitRouterId = defaultTransitRouter.TransitRouterId,
            TransitRouterRouteTableDescription = name,
            TransitRouterRouteTableName = name,
        });
    
        var ids = AliCloud.Cen.GetTransitRouterRouteTables.Invoke(new()
        {
            TransitRouterId = defaultTransitRouterRouteTable.TransitRouterId,
            Ids = new[]
            {
                defaultTransitRouterRouteTable.TransitRouterRouteTableId,
            },
        });
    
        return new Dictionary<string, object?>
        {
            ["cenTransitRouterRouteTableId0"] = ids.Apply(getTransitRouterRouteTablesResult => getTransitRouterRouteTablesResult.Tables[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.cen.Instance;
    import com.pulumi.alicloud.cen.InstanceArgs;
    import com.pulumi.alicloud.cen.TransitRouter;
    import com.pulumi.alicloud.cen.TransitRouterArgs;
    import com.pulumi.alicloud.cen.TransitRouterRouteTable;
    import com.pulumi.alicloud.cen.TransitRouterRouteTableArgs;
    import com.pulumi.alicloud.cen.CenFunctions;
    import com.pulumi.alicloud.cen.inputs.GetTransitRouterRouteTablesArgs;
    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 config = ctx.config();
            final var name = config.get("name").orElse("terraform-example");
            var default_ = new Instance("default", InstanceArgs.builder()
                .cenInstanceName(name)
                .protectionLevel("REDUCED")
                .build());
    
            var defaultTransitRouter = new TransitRouter("defaultTransitRouter", TransitRouterArgs.builder()
                .cenId(default_.id())
                .transitRouterName(name)
                .build());
    
            var defaultTransitRouterRouteTable = new TransitRouterRouteTable("defaultTransitRouterRouteTable", TransitRouterRouteTableArgs.builder()
                .transitRouterId(defaultTransitRouter.transitRouterId())
                .transitRouterRouteTableDescription(name)
                .transitRouterRouteTableName(name)
                .build());
    
            final var ids = CenFunctions.getTransitRouterRouteTables(GetTransitRouterRouteTablesArgs.builder()
                .transitRouterId(defaultTransitRouterRouteTable.transitRouterId())
                .ids(defaultTransitRouterRouteTable.transitRouterRouteTableId())
                .build());
    
            ctx.export("cenTransitRouterRouteTableId0", ids.applyValue(_ids -> _ids.tables()[0].id()));
        }
    }
    
    configuration:
      name:
        type: string
        default: terraform-example
    resources:
      default:
        type: alicloud:cen:Instance
        properties:
          cenInstanceName: ${name}
          protectionLevel: REDUCED
      defaultTransitRouter:
        type: alicloud:cen:TransitRouter
        name: default
        properties:
          cenId: ${default.id}
          transitRouterName: ${name}
      defaultTransitRouterRouteTable:
        type: alicloud:cen:TransitRouterRouteTable
        name: default
        properties:
          transitRouterId: ${defaultTransitRouter.transitRouterId}
          transitRouterRouteTableDescription: ${name}
          transitRouterRouteTableName: ${name}
    variables:
      ids:
        fn::invoke:
          function: alicloud:cen:getTransitRouterRouteTables
          arguments:
            transitRouterId: ${defaultTransitRouterRouteTable.transitRouterId}
            ids:
              - ${defaultTransitRouterRouteTable.transitRouterRouteTableId}
    outputs:
      cenTransitRouterRouteTableId0: ${ids.tables[0].id}
    

    Using getTransitRouterRouteTables

    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 getTransitRouterRouteTables(args: GetTransitRouterRouteTablesArgs, opts?: InvokeOptions): Promise<GetTransitRouterRouteTablesResult>
    function getTransitRouterRouteTablesOutput(args: GetTransitRouterRouteTablesOutputArgs, opts?: InvokeOptions): Output<GetTransitRouterRouteTablesResult>
    def get_transit_router_route_tables(ids: Optional[Sequence[str]] = None,
                                        name_regex: Optional[str] = None,
                                        output_file: Optional[str] = None,
                                        status: Optional[str] = None,
                                        transit_router_id: Optional[str] = None,
                                        transit_router_route_table_ids: Optional[Sequence[str]] = None,
                                        transit_router_route_table_names: Optional[Sequence[str]] = None,
                                        transit_router_route_table_status: Optional[str] = None,
                                        transit_router_route_table_type: Optional[str] = None,
                                        opts: Optional[InvokeOptions] = None) -> GetTransitRouterRouteTablesResult
    def get_transit_router_route_tables_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                                        name_regex: Optional[pulumi.Input[str]] = None,
                                        output_file: Optional[pulumi.Input[str]] = None,
                                        status: Optional[pulumi.Input[str]] = None,
                                        transit_router_id: Optional[pulumi.Input[str]] = None,
                                        transit_router_route_table_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                                        transit_router_route_table_names: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                                        transit_router_route_table_status: Optional[pulumi.Input[str]] = None,
                                        transit_router_route_table_type: Optional[pulumi.Input[str]] = None,
                                        opts: Optional[InvokeOptions] = None) -> Output[GetTransitRouterRouteTablesResult]
    func GetTransitRouterRouteTables(ctx *Context, args *GetTransitRouterRouteTablesArgs, opts ...InvokeOption) (*GetTransitRouterRouteTablesResult, error)
    func GetTransitRouterRouteTablesOutput(ctx *Context, args *GetTransitRouterRouteTablesOutputArgs, opts ...InvokeOption) GetTransitRouterRouteTablesResultOutput

    > Note: This function is named GetTransitRouterRouteTables in the Go SDK.

    public static class GetTransitRouterRouteTables 
    {
        public static Task<GetTransitRouterRouteTablesResult> InvokeAsync(GetTransitRouterRouteTablesArgs args, InvokeOptions? opts = null)
        public static Output<GetTransitRouterRouteTablesResult> Invoke(GetTransitRouterRouteTablesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetTransitRouterRouteTablesResult> getTransitRouterRouteTables(GetTransitRouterRouteTablesArgs args, InvokeOptions options)
    public static Output<GetTransitRouterRouteTablesResult> getTransitRouterRouteTables(GetTransitRouterRouteTablesArgs args, InvokeOptions options)
    
    fn::invoke:
      function: alicloud:cen/getTransitRouterRouteTables:getTransitRouterRouteTables
      arguments:
        # arguments dictionary

    The following arguments are supported:

    TransitRouterId string
    The ID of the Enterprise Edition transit router.
    Ids List<string>
    A list of Transit Router Route Table IDs.
    NameRegex string
    A regex string to filter results by Transit Router Route Table name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Status string
    The status of the route table. Valid values: Creating, Active, Deleting.
    TransitRouterRouteTableIds List<string>
    A list of ID of the CEN Transit Router Route Table.
    TransitRouterRouteTableNames List<string>
    A list of name of the CEN Transit Router Route Table.
    TransitRouterRouteTableStatus string
    The status of the route table. Valid values: Creating, Active, Deleting.
    TransitRouterRouteTableType string
    The type of the route table. Valid values: System, Custom.
    TransitRouterId string
    The ID of the Enterprise Edition transit router.
    Ids []string
    A list of Transit Router Route Table IDs.
    NameRegex string
    A regex string to filter results by Transit Router Route Table name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Status string
    The status of the route table. Valid values: Creating, Active, Deleting.
    TransitRouterRouteTableIds []string
    A list of ID of the CEN Transit Router Route Table.
    TransitRouterRouteTableNames []string
    A list of name of the CEN Transit Router Route Table.
    TransitRouterRouteTableStatus string
    The status of the route table. Valid values: Creating, Active, Deleting.
    TransitRouterRouteTableType string
    The type of the route table. Valid values: System, Custom.
    transitRouterId String
    The ID of the Enterprise Edition transit router.
    ids List<String>
    A list of Transit Router Route Table IDs.
    nameRegex String
    A regex string to filter results by Transit Router Route Table name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    status String
    The status of the route table. Valid values: Creating, Active, Deleting.
    transitRouterRouteTableIds List<String>
    A list of ID of the CEN Transit Router Route Table.
    transitRouterRouteTableNames List<String>
    A list of name of the CEN Transit Router Route Table.
    transitRouterRouteTableStatus String
    The status of the route table. Valid values: Creating, Active, Deleting.
    transitRouterRouteTableType String
    The type of the route table. Valid values: System, Custom.
    transitRouterId string
    The ID of the Enterprise Edition transit router.
    ids string[]
    A list of Transit Router Route Table IDs.
    nameRegex string
    A regex string to filter results by Transit Router Route Table name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    status string
    The status of the route table. Valid values: Creating, Active, Deleting.
    transitRouterRouteTableIds string[]
    A list of ID of the CEN Transit Router Route Table.
    transitRouterRouteTableNames string[]
    A list of name of the CEN Transit Router Route Table.
    transitRouterRouteTableStatus string
    The status of the route table. Valid values: Creating, Active, Deleting.
    transitRouterRouteTableType string
    The type of the route table. Valid values: System, Custom.
    transit_router_id str
    The ID of the Enterprise Edition transit router.
    ids Sequence[str]
    A list of Transit Router Route Table IDs.
    name_regex str
    A regex string to filter results by Transit Router Route Table name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    status str
    The status of the route table. Valid values: Creating, Active, Deleting.
    transit_router_route_table_ids Sequence[str]
    A list of ID of the CEN Transit Router Route Table.
    transit_router_route_table_names Sequence[str]
    A list of name of the CEN Transit Router Route Table.
    transit_router_route_table_status str
    The status of the route table. Valid values: Creating, Active, Deleting.
    transit_router_route_table_type str
    The type of the route table. Valid values: System, Custom.
    transitRouterId String
    The ID of the Enterprise Edition transit router.
    ids List<String>
    A list of Transit Router Route Table IDs.
    nameRegex String
    A regex string to filter results by Transit Router Route Table name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    status String
    The status of the route table. Valid values: Creating, Active, Deleting.
    transitRouterRouteTableIds List<String>
    A list of ID of the CEN Transit Router Route Table.
    transitRouterRouteTableNames List<String>
    A list of name of the CEN Transit Router Route Table.
    transitRouterRouteTableStatus String
    The status of the route table. Valid values: Creating, Active, Deleting.
    transitRouterRouteTableType String
    The type of the route table. Valid values: System, Custom.

    getTransitRouterRouteTables Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    Names List<string>
    A list of Transit Router Route Table names.
    Tables List<Pulumi.AliCloud.Cen.Outputs.GetTransitRouterRouteTablesTable>
    A list of Transit Router Route Tables. Each element contains the following attributes:
    TransitRouterId string
    NameRegex string
    OutputFile string
    Status string
    The status of the route table.
    TransitRouterRouteTableIds List<string>
    TransitRouterRouteTableNames List<string>
    TransitRouterRouteTableStatus string
    TransitRouterRouteTableType string
    The type of the route table.
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Names []string
    A list of Transit Router Route Table names.
    Tables []GetTransitRouterRouteTablesTable
    A list of Transit Router Route Tables. Each element contains the following attributes:
    TransitRouterId string
    NameRegex string
    OutputFile string
    Status string
    The status of the route table.
    TransitRouterRouteTableIds []string
    TransitRouterRouteTableNames []string
    TransitRouterRouteTableStatus string
    TransitRouterRouteTableType string
    The type of the route table.
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    A list of Transit Router Route Table names.
    tables List<GetTransitRouterRouteTablesTable>
    A list of Transit Router Route Tables. Each element contains the following attributes:
    transitRouterId String
    nameRegex String
    outputFile String
    status String
    The status of the route table.
    transitRouterRouteTableIds List<String>
    transitRouterRouteTableNames List<String>
    transitRouterRouteTableStatus String
    transitRouterRouteTableType String
    The type of the route table.
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    names string[]
    A list of Transit Router Route Table names.
    tables GetTransitRouterRouteTablesTable[]
    A list of Transit Router Route Tables. Each element contains the following attributes:
    transitRouterId string
    nameRegex string
    outputFile string
    status string
    The status of the route table.
    transitRouterRouteTableIds string[]
    transitRouterRouteTableNames string[]
    transitRouterRouteTableStatus string
    transitRouterRouteTableType string
    The type of the route table.
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    names Sequence[str]
    A list of Transit Router Route Table names.
    tables Sequence[GetTransitRouterRouteTablesTable]
    A list of Transit Router Route Tables. Each element contains the following attributes:
    transit_router_id str
    name_regex str
    output_file str
    status str
    The status of the route table.
    transit_router_route_table_ids Sequence[str]
    transit_router_route_table_names Sequence[str]
    transit_router_route_table_status str
    transit_router_route_table_type str
    The type of the route table.
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    A list of Transit Router Route Table names.
    tables List<Property Map>
    A list of Transit Router Route Tables. Each element contains the following attributes:
    transitRouterId String
    nameRegex String
    outputFile String
    status String
    The status of the route table.
    transitRouterRouteTableIds List<String>
    transitRouterRouteTableNames List<String>
    transitRouterRouteTableStatus String
    transitRouterRouteTableType String
    The type of the route table.

    Supporting Types

    GetTransitRouterRouteTablesTable

    Id string
    The ID of the Transit Router Route Table.
    Status string
    The status of the route table. Valid values: Creating, Active, Deleting.
    TransitRouterRouteTableDescription string
    The description of the route table.
    TransitRouterRouteTableId string
    The ID of the Transit Router Route Table.
    TransitRouterRouteTableName string
    The name of the route table.
    TransitRouterRouteTableType string
    The type of the route table. Valid values: System, Custom.
    Id string
    The ID of the Transit Router Route Table.
    Status string
    The status of the route table. Valid values: Creating, Active, Deleting.
    TransitRouterRouteTableDescription string
    The description of the route table.
    TransitRouterRouteTableId string
    The ID of the Transit Router Route Table.
    TransitRouterRouteTableName string
    The name of the route table.
    TransitRouterRouteTableType string
    The type of the route table. Valid values: System, Custom.
    id String
    The ID of the Transit Router Route Table.
    status String
    The status of the route table. Valid values: Creating, Active, Deleting.
    transitRouterRouteTableDescription String
    The description of the route table.
    transitRouterRouteTableId String
    The ID of the Transit Router Route Table.
    transitRouterRouteTableName String
    The name of the route table.
    transitRouterRouteTableType String
    The type of the route table. Valid values: System, Custom.
    id string
    The ID of the Transit Router Route Table.
    status string
    The status of the route table. Valid values: Creating, Active, Deleting.
    transitRouterRouteTableDescription string
    The description of the route table.
    transitRouterRouteTableId string
    The ID of the Transit Router Route Table.
    transitRouterRouteTableName string
    The name of the route table.
    transitRouterRouteTableType string
    The type of the route table. Valid values: System, Custom.
    id str
    The ID of the Transit Router Route Table.
    status str
    The status of the route table. Valid values: Creating, Active, Deleting.
    transit_router_route_table_description str
    The description of the route table.
    transit_router_route_table_id str
    The ID of the Transit Router Route Table.
    transit_router_route_table_name str
    The name of the route table.
    transit_router_route_table_type str
    The type of the route table. Valid values: System, Custom.
    id String
    The ID of the Transit Router Route Table.
    status String
    The status of the route table. Valid values: Creating, Active, Deleting.
    transitRouterRouteTableDescription String
    The description of the route table.
    transitRouterRouteTableId String
    The ID of the Transit Router Route Table.
    transitRouterRouteTableName String
    The name of the route table.
    transitRouterRouteTableType String
    The type of the route table. Valid values: System, Custom.

    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.81.0 published on Monday, Jun 23, 2025 by Pulumi