1. Packages
  2. Alicloud Provider
  3. API Docs
  4. cen
  5. getTransitRouterRouteTables
Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi

alicloud.cen.getTransitRouterRouteTables

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi

    This data source provides CEN Transit Router Route Tables available to the user.What is Cen Transit Router Route Tables

    NOTE: Available since v1.126.0.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "tf-example";
    const defaultInstance = new alicloud.cen.Instance("default", {
        cenInstanceName: name,
        protectionLevel: "REDUCED",
    });
    const defaultTransitRouter = new alicloud.cen.TransitRouter("default", {
        cenId: defaultInstance.id,
        transitRouterName: name,
    });
    const defaultTransitRouterRouteTable = new alicloud.cen.TransitRouterRouteTable("default", {
        transitRouterId: defaultTransitRouter.transitRouterId,
        transitRouterRouteTableDescription: "desp",
        transitRouterRouteTableName: name,
    });
    const default = alicloud.cen.getTransitRouterRouteTablesOutput({
        transitRouterId: defaultTransitRouter.transitRouterId,
    });
    export const firstTransitRouterRouteTableType = _default.apply(_default => _default.tables?.[0]?.transitRouterRouteTableType);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "tf-example"
    default_instance = alicloud.cen.Instance("default",
        cen_instance_name=name,
        protection_level="REDUCED")
    default_transit_router = alicloud.cen.TransitRouter("default",
        cen_id=default_instance.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="desp",
        transit_router_route_table_name=name)
    default = alicloud.cen.get_transit_router_route_tables_output(transit_router_id=default_transit_router.transit_router_id)
    pulumi.export("firstTransitRouterRouteTableType", default.tables[0].transit_router_route_table_type)
    
    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 := "tf-example";
    if param := cfg.Get("name"); param != ""{
    name = param
    }
    defaultInstance, 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: defaultInstance.ID(),
    TransitRouterName: pulumi.String(name),
    })
    if err != nil {
    return err
    }
    _, err = cen.NewTransitRouterRouteTable(ctx, "default", &cen.TransitRouterRouteTableArgs{
    TransitRouterId: defaultTransitRouter.TransitRouterId,
    TransitRouterRouteTableDescription: pulumi.String("desp"),
    TransitRouterRouteTableName: pulumi.String(name),
    })
    if err != nil {
    return err
    }
    _default := cen.GetTransitRouterRouteTablesOutput(ctx, cen.GetTransitRouterRouteTablesOutputArgs{
    TransitRouterId: defaultTransitRouter.TransitRouterId,
    }, nil);
    ctx.Export("firstTransitRouterRouteTableType", _default.ApplyT(func(_default cen.GetTransitRouterRouteTablesResult) (*string, error) {
    return &default.Tables[0].TransitRouterRouteTableType, 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") ?? "tf-example";
        var defaultInstance = new AliCloud.Cen.Instance("default", new()
        {
            CenInstanceName = name,
            ProtectionLevel = "REDUCED",
        });
    
        var defaultTransitRouter = new AliCloud.Cen.TransitRouter("default", new()
        {
            CenId = defaultInstance.Id,
            TransitRouterName = name,
        });
    
        var defaultTransitRouterRouteTable = new AliCloud.Cen.TransitRouterRouteTable("default", new()
        {
            TransitRouterId = defaultTransitRouter.TransitRouterId,
            TransitRouterRouteTableDescription = "desp",
            TransitRouterRouteTableName = name,
        });
    
        var @default = AliCloud.Cen.GetTransitRouterRouteTables.Invoke(new()
        {
            TransitRouterId = defaultTransitRouter.TransitRouterId,
        });
    
        return new Dictionary<string, object?>
        {
            ["firstTransitRouterRouteTableType"] = @default.Apply(@default => @default.Apply(getTransitRouterRouteTablesResult => getTransitRouterRouteTablesResult.Tables[0]?.TransitRouterRouteTableType)),
        };
    });
    
    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("tf-example");
            var defaultInstance = new Instance("defaultInstance", InstanceArgs.builder()
                .cenInstanceName(name)
                .protectionLevel("REDUCED")
                .build());
    
            var defaultTransitRouter = new TransitRouter("defaultTransitRouter", TransitRouterArgs.builder()
                .cenId(defaultInstance.id())
                .transitRouterName(name)
                .build());
    
            var defaultTransitRouterRouteTable = new TransitRouterRouteTable("defaultTransitRouterRouteTable", TransitRouterRouteTableArgs.builder()
                .transitRouterId(defaultTransitRouter.transitRouterId())
                .transitRouterRouteTableDescription("desp")
                .transitRouterRouteTableName(name)
                .build());
    
            final var default = CenFunctions.getTransitRouterRouteTables(GetTransitRouterRouteTablesArgs.builder()
                .transitRouterId(defaultTransitRouter.transitRouterId())
                .build());
    
            ctx.export("firstTransitRouterRouteTableType", default_.applyValue(default_ -> default_.tables()[0].transitRouterRouteTableType()));
        }
    }
    
    configuration:
      name:
        type: string
        default: tf-example
    resources:
      defaultInstance:
        type: alicloud:cen:Instance
        name: default
        properties:
          cenInstanceName: ${name}
          protectionLevel: REDUCED
      defaultTransitRouter:
        type: alicloud:cen:TransitRouter
        name: default
        properties:
          cenId: ${defaultInstance.id}
          transitRouterName: ${name}
      defaultTransitRouterRouteTable:
        type: alicloud:cen:TransitRouterRouteTable
        name: default
        properties:
          transitRouterId: ${defaultTransitRouter.transitRouterId}
          transitRouterRouteTableDescription: desp
          transitRouterRouteTableName: ${name}
    variables:
      default:
        fn::invoke:
          Function: alicloud:cen:getTransitRouterRouteTables
          Arguments:
            transitRouterId: ${defaultTransitRouter.transitRouterId}
    outputs:
      firstTransitRouterRouteTableType: ${default.tables[0].transitRouterRouteTableType}
    

    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)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:cen/getTransitRouterRouteTables:getTransitRouterRouteTables
      arguments:
        # arguments dictionary

    The following arguments are supported:

    TransitRouterId string
    ID of the CEN Transit Router Route Table.
    Ids List<string>
    A list of CEN Transit Router Route Table IDs.
    NameRegex string
    A regex string to filter CEN Transit Router Route Table by name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Status string
    The status of the transit router route table to query. Valid values Creating, Active and 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 transit router route table to query. Valid values Creating, Active and Deleting..
    TransitRouterRouteTableType string
    The type of the transit router route table to query. Valid values System and Custom.
    TransitRouterId string
    ID of the CEN Transit Router Route Table.
    Ids []string
    A list of CEN Transit Router Route Table IDs.
    NameRegex string
    A regex string to filter CEN Transit Router Route Table by name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Status string
    The status of the transit router route table to query. Valid values Creating, Active and 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 transit router route table to query. Valid values Creating, Active and Deleting..
    TransitRouterRouteTableType string
    The type of the transit router route table to query. Valid values System and Custom.
    transitRouterId String
    ID of the CEN Transit Router Route Table.
    ids List<String>
    A list of CEN Transit Router Route Table IDs.
    nameRegex String
    A regex string to filter CEN Transit Router Route Table by name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    status String
    The status of the transit router route table to query. Valid values Creating, Active and 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 transit router route table to query. Valid values Creating, Active and Deleting..
    transitRouterRouteTableType String
    The type of the transit router route table to query. Valid values System and Custom.
    transitRouterId string
    ID of the CEN Transit Router Route Table.
    ids string[]
    A list of CEN Transit Router Route Table IDs.
    nameRegex string
    A regex string to filter CEN Transit Router Route Table by name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    status string
    The status of the transit router route table to query. Valid values Creating, Active and 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 transit router route table to query. Valid values Creating, Active and Deleting..
    transitRouterRouteTableType string
    The type of the transit router route table to query. Valid values System and Custom.
    transit_router_id str
    ID of the CEN Transit Router Route Table.
    ids Sequence[str]
    A list of CEN Transit Router Route Table IDs.
    name_regex str
    A regex string to filter CEN Transit Router Route Table by name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    status str
    The status of the transit router route table to query. Valid values Creating, Active and 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 transit router route table to query. Valid values Creating, Active and Deleting..
    transit_router_route_table_type str
    The type of the transit router route table to query. Valid values System and Custom.
    transitRouterId String
    ID of the CEN Transit Router Route Table.
    ids List<String>
    A list of CEN Transit Router Route Table IDs.
    nameRegex String
    A regex string to filter CEN Transit Router Route Table by name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    status String
    The status of the transit router route table to query. Valid values Creating, Active and 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 transit router route table to query. Valid values Creating, Active and Deleting..
    transitRouterRouteTableType String
    The type of the transit router route table to query. Valid values System and 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 name of CEN Transit Router Route Tables.
    Tables List<Pulumi.AliCloud.Cen.Outputs.GetTransitRouterRouteTablesTable>
    A list of CEN Route Entries. 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
    Type of the transit router route table.
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Names []string
    A list of name of CEN Transit Router Route Tables.
    Tables []GetTransitRouterRouteTablesTable
    A list of CEN Route Entries. 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
    Type of the transit router route table.
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    A list of name of CEN Transit Router Route Tables.
    tables List<GetTransitRouterRouteTablesTable>
    A list of CEN Route Entries. 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
    Type of the transit router route table.
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    names string[]
    A list of name of CEN Transit Router Route Tables.
    tables GetTransitRouterRouteTablesTable[]
    A list of CEN Route Entries. 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
    Type of the transit router route table.
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    names Sequence[str]
    A list of name of CEN Transit Router Route Tables.
    tables Sequence[GetTransitRouterRouteTablesTable]
    A list of CEN Route Entries. 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
    Type of the transit router route table.
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    A list of name of CEN Transit Router Route Tables.
    tables List<Property Map>
    A list of CEN Route Entries. 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
    Type of the transit router route table.

    Supporting Types

    GetTransitRouterRouteTablesTable

    Id string
    ID of resource.
    Status string
    The status of the transit router route table to query. Valid values Creating, Active and Deleting..
    TransitRouterRouteTableDescription string
    The description of the transit router route table.
    TransitRouterRouteTableId string
    ID of the trabsit router route table.
    TransitRouterRouteTableName string
    Name of the transit router route table.
    TransitRouterRouteTableType string
    The type of the transit router route table to query. Valid values System and Custom.
    Id string
    ID of resource.
    Status string
    The status of the transit router route table to query. Valid values Creating, Active and Deleting..
    TransitRouterRouteTableDescription string
    The description of the transit router route table.
    TransitRouterRouteTableId string
    ID of the trabsit router route table.
    TransitRouterRouteTableName string
    Name of the transit router route table.
    TransitRouterRouteTableType string
    The type of the transit router route table to query. Valid values System and Custom.
    id String
    ID of resource.
    status String
    The status of the transit router route table to query. Valid values Creating, Active and Deleting..
    transitRouterRouteTableDescription String
    The description of the transit router route table.
    transitRouterRouteTableId String
    ID of the trabsit router route table.
    transitRouterRouteTableName String
    Name of the transit router route table.
    transitRouterRouteTableType String
    The type of the transit router route table to query. Valid values System and Custom.
    id string
    ID of resource.
    status string
    The status of the transit router route table to query. Valid values Creating, Active and Deleting..
    transitRouterRouteTableDescription string
    The description of the transit router route table.
    transitRouterRouteTableId string
    ID of the trabsit router route table.
    transitRouterRouteTableName string
    Name of the transit router route table.
    transitRouterRouteTableType string
    The type of the transit router route table to query. Valid values System and Custom.
    id str
    ID of resource.
    status str
    The status of the transit router route table to query. Valid values Creating, Active and Deleting..
    transit_router_route_table_description str
    The description of the transit router route table.
    transit_router_route_table_id str
    ID of the trabsit router route table.
    transit_router_route_table_name str
    Name of the transit router route table.
    transit_router_route_table_type str
    The type of the transit router route table to query. Valid values System and Custom.
    id String
    ID of resource.
    status String
    The status of the transit router route table to query. Valid values Creating, Active and Deleting..
    transitRouterRouteTableDescription String
    The description of the transit router route table.
    transitRouterRouteTableId String
    ID of the trabsit router route table.
    transitRouterRouteTableName String
    Name of the transit router route table.
    transitRouterRouteTableType String
    The type of the transit router route table to query. Valid values System and 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.62.1 published on Monday, Sep 16, 2024 by Pulumi