1. Registry
  2. Packages
  3. Alibaba Cloud Provider
  4. API Docs
  5. expressconnect
  6. getRouterExpressConnectRouters
Viewing docs for Alibaba Cloud v3.108.0
published on Thursday, Sep 17, 2026 by Pulumi
alicloud logo alicloud logo
Viewing docs for Alibaba Cloud v3.108.0
published on Thursday, Sep 17, 2026 by Pulumi

    This data source provides the Express Connect Router Express Connect Router of the current Alibaba Cloud user.

    NOTE: Available since v1.291.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.expressconnect.RouterExpressConnectRouter("default", {alibabaSideAsn: 65533});
    const ids = alicloud.expressconnect.getRouterExpressConnectRoutersOutput({
        ids: [_default.id],
    });
    export const expressConnectRouterExpressConnectRoutersId0 = ids.apply(ids => ids.routers?.[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.expressconnect.RouterExpressConnectRouter("default", alibaba_side_asn=65533)
    ids = alicloud.expressconnect.get_router_express_connect_routers_output(ids=[default.id])
    pulumi.export("expressConnectRouterExpressConnectRoutersId0", ids.routers[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/expressconnect"
    	"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 := expressconnect.NewRouterExpressConnectRouter(ctx, "default", &expressconnect.RouterExpressConnectRouterArgs{
    			AlibabaSideAsn: pulumi.Int(65533),
    		})
    		if err != nil {
    			return err
    		}
    		ids := expressconnect.GetRouterExpressConnectRoutersOutput(ctx, expressconnect.GetRouterExpressConnectRoutersOutputArgs{
    			Ids: pulumi.StringArray{
    				_default.ID().ToIDOutput().ToStringOutput(),
    			},
    		}, nil)
    		ctx.Export("expressConnectRouterExpressConnectRoutersId0", ids.ApplyT(func(ids expressconnect.GetRouterExpressConnectRoutersResult) (*string, error) {
    			return ids.Routers[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.ExpressConnect.RouterExpressConnectRouter("default", new()
        {
            AlibabaSideAsn = 65533,
        });
    
        var ids = AliCloud.ExpressConnect.GetRouterExpressConnectRouters.Invoke(new()
        {
            Ids = new[]
            {
                @default.Id,
            },
        });
    
        return new Dictionary<string, object?>
        {
            ["expressConnectRouterExpressConnectRoutersId0"] = ids.Apply(getRouterExpressConnectRoutersResult => getRouterExpressConnectRoutersResult.Routers[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.expressconnect.RouterExpressConnectRouter;
    import com.pulumi.alicloud.expressconnect.RouterExpressConnectRouterArgs;
    import com.pulumi.alicloud.expressconnect.ExpressconnectFunctions;
    import com.pulumi.alicloud.expressconnect.inputs.GetRouterExpressConnectRoutersArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    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 RouterExpressConnectRouter("default", RouterExpressConnectRouterArgs.builder()
                .alibabaSideAsn(65533)
                .build());
    
            final var ids = ExpressconnectFunctions.getRouterExpressConnectRouters(GetRouterExpressConnectRoutersArgs.builder()
                .ids(default_.id())
                .build());
    
            ctx.export("expressConnectRouterExpressConnectRoutersId0", ids.applyValue(_ids -> _ids.routers()[0].id()));
        }
    }
    
    configuration:
      name:
        type: string
        default: terraform-example
    resources:
      default:
        type: alicloud:expressconnect:RouterExpressConnectRouter
        properties:
          alibabaSideAsn: '65533'
    variables:
      ids:
        fn::invoke:
          function: alicloud:expressconnect:getRouterExpressConnectRouters
          arguments:
            ids:
              - ${default.id}
    outputs:
      expressConnectRouterExpressConnectRoutersId0: ${ids.routers[0].id}
    
    pulumi {
      required_providers {
        alicloud = {
          source = "pulumi/alicloud"
        }
      }
    }
    
    data "alicloud_expressconnect_getrouterexpressconnectrouters" "ids" {
      ids = [alicloud_expressconnect_routerexpressconnectrouter.default.id]
    }
    
    resource "alicloud_expressconnect_routerexpressconnectrouter" "default" {
      alibaba_side_asn = "65533"
    }
    variable "name" {
      type    = string
      default = "terraform-example"
    }
    output "expressConnectRouterExpressConnectRoutersId0" {
      value = data.alicloud_expressconnect_getrouterexpressconnectrouters.ids.routers[0].id
    }
    

    Using getRouterExpressConnectRouters

    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 getRouterExpressConnectRouters(args: GetRouterExpressConnectRoutersArgs, opts?: InvokeOptions): Promise<GetRouterExpressConnectRoutersResult>
    function getRouterExpressConnectRoutersOutput(args: GetRouterExpressConnectRoutersOutputArgs, opts?: InvokeOutputOptions): Output<GetRouterExpressConnectRoutersResult>
    def get_router_express_connect_routers(ecr_id: Optional[str] = None,
                                           ecr_name: Optional[str] = None,
                                           ids: Optional[Sequence[str]] = None,
                                           name_regex: Optional[str] = None,
                                           output_file: Optional[str] = None,
                                           resource_group_id: Optional[str] = None,
                                           status: Optional[str] = None,
                                           tags: Optional[Mapping[str, str]] = None,
                                           opts: Optional[InvokeOptions] = None) -> GetRouterExpressConnectRoutersResult
    def get_router_express_connect_routers_output(ecr_id: pulumi.Input[Optional[str]] = None,
                                           ecr_name: pulumi.Input[Optional[str]] = None,
                                           ids: pulumi.Input[Optional[Sequence[pulumi.Input[str]]]] = None,
                                           name_regex: pulumi.Input[Optional[str]] = None,
                                           output_file: pulumi.Input[Optional[str]] = None,
                                           resource_group_id: pulumi.Input[Optional[str]] = None,
                                           status: pulumi.Input[Optional[str]] = None,
                                           tags: pulumi.Input[Optional[Mapping[str, pulumi.Input[str]]]] = None,
                                           opts: Optional[InvokeOutputOptions] = None) -> Output[GetRouterExpressConnectRoutersResult]
    func GetRouterExpressConnectRouters(ctx *Context, args *GetRouterExpressConnectRoutersArgs, opts ...InvokeOption) (*GetRouterExpressConnectRoutersResult, error)
    func GetRouterExpressConnectRoutersOutput(ctx *Context, args *GetRouterExpressConnectRoutersOutputArgs, opts ...InvokeOption) GetRouterExpressConnectRoutersResultOutput

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

    public static class GetRouterExpressConnectRouters 
    {
        public static Task<GetRouterExpressConnectRoutersResult> InvokeAsync(GetRouterExpressConnectRoutersArgs args, InvokeOptions? opts = null)
        public static Output<GetRouterExpressConnectRoutersResult> Invoke(GetRouterExpressConnectRoutersInvokeArgs args, InvokeOptions? opts = null)
        public static Output<GetRouterExpressConnectRoutersResult> Invoke(GetRouterExpressConnectRoutersInvokeArgs args, InvokeOutputOptions opts)
    }
    public static CompletableFuture<GetRouterExpressConnectRoutersResult> getRouterExpressConnectRouters(GetRouterExpressConnectRoutersArgs args, InvokeOptions options)
    public static Output<GetRouterExpressConnectRoutersResult> getRouterExpressConnectRouters(GetRouterExpressConnectRoutersArgs args, InvokeOptions options)
    public static Output<GetRouterExpressConnectRoutersResult> getRouterExpressConnectRouters(GetRouterExpressConnectRoutersArgs args, InvokeOutputOptions options)
    
    fn::invoke:
      function: alicloud:expressconnect/getRouterExpressConnectRouters:getRouterExpressConnectRouters
      arguments:
        # arguments dictionary
    data "alicloud_expressconnect_get_router_express_connect_routers" "name" {
        # arguments
    }

    The following arguments are supported:

    EcrId string
    The ID of ECR.
    EcrName string
    The name of ECR.
    Ids List<string>
    A list of Express Connect Router IDs.
    NameRegex string
    A regex string to filter results by Express Connect Router name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    ResourceGroupId string
    The ID of the resource group to which the ECR belongs.
    Status string
    The deployment status of the service instance. Valid values: ACTIVE, UPDATING, ASSOCIATING, DISSOCIATING, LOCKED_ATTACHING, LOCKED_DETACHING, RECLAIMING, DELETING.
    Tags Dictionary<string, string>
    A mapping of tags to assign to the resource.
    EcrId string
    The ID of ECR.
    EcrName string
    The name of ECR.
    Ids []string
    A list of Express Connect Router IDs.
    NameRegex string
    A regex string to filter results by Express Connect Router name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    ResourceGroupId string
    The ID of the resource group to which the ECR belongs.
    Status string
    The deployment status of the service instance. Valid values: ACTIVE, UPDATING, ASSOCIATING, DISSOCIATING, LOCKED_ATTACHING, LOCKED_DETACHING, RECLAIMING, DELETING.
    Tags map[string]string
    A mapping of tags to assign to the resource.
    ecr_id string
    The ID of ECR.
    ecr_name string
    The name of ECR.
    ids list(string)
    A list of Express Connect Router IDs.
    name_regex string
    A regex string to filter results by Express Connect Router name.
    output_file string
    File name where to save data source results (after running pulumi preview).
    resource_group_id string
    The ID of the resource group to which the ECR belongs.
    status string
    The deployment status of the service instance. Valid values: ACTIVE, UPDATING, ASSOCIATING, DISSOCIATING, LOCKED_ATTACHING, LOCKED_DETACHING, RECLAIMING, DELETING.
    tags map(string)
    A mapping of tags to assign to the resource.
    ecrId String
    The ID of ECR.
    ecrName String
    The name of ECR.
    ids List<String>
    A list of Express Connect Router IDs.
    nameRegex String
    A regex string to filter results by Express Connect Router name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    resourceGroupId String
    The ID of the resource group to which the ECR belongs.
    status String
    The deployment status of the service instance. Valid values: ACTIVE, UPDATING, ASSOCIATING, DISSOCIATING, LOCKED_ATTACHING, LOCKED_DETACHING, RECLAIMING, DELETING.
    tags Map<String,String>
    A mapping of tags to assign to the resource.
    ecrId string
    The ID of ECR.
    ecrName string
    The name of ECR.
    ids string[]
    A list of Express Connect Router IDs.
    nameRegex string
    A regex string to filter results by Express Connect Router name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    resourceGroupId string
    The ID of the resource group to which the ECR belongs.
    status string
    The deployment status of the service instance. Valid values: ACTIVE, UPDATING, ASSOCIATING, DISSOCIATING, LOCKED_ATTACHING, LOCKED_DETACHING, RECLAIMING, DELETING.
    tags {[key: string]: string}
    A mapping of tags to assign to the resource.
    ecr_id str
    The ID of ECR.
    ecr_name str
    The name of ECR.
    ids Sequence[str]
    A list of Express Connect Router IDs.
    name_regex str
    A regex string to filter results by Express Connect Router name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    resource_group_id str
    The ID of the resource group to which the ECR belongs.
    status str
    The deployment status of the service instance. Valid values: ACTIVE, UPDATING, ASSOCIATING, DISSOCIATING, LOCKED_ATTACHING, LOCKED_DETACHING, RECLAIMING, DELETING.
    tags Mapping[str, str]
    A mapping of tags to assign to the resource.
    ecrId String
    The ID of ECR.
    ecrName String
    The name of ECR.
    ids List<String>
    A list of Express Connect Router IDs.
    nameRegex String
    A regex string to filter results by Express Connect Router name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    resourceGroupId String
    The ID of the resource group to which the ECR belongs.
    status String
    The deployment status of the service instance. Valid values: ACTIVE, UPDATING, ASSOCIATING, DISSOCIATING, LOCKED_ATTACHING, LOCKED_DETACHING, RECLAIMING, DELETING.
    tags Map<String>
    A mapping of tags to assign to the resource.

    getRouterExpressConnectRouters 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 Express Connect Router names.
    Routers List<Pulumi.AliCloud.ExpressConnect.Outputs.GetRouterExpressConnectRoutersRouter>
    A list of Express Connect Routers. Each element contains the following attributes:
    EcrId string
    The ID of ECR.
    EcrName string
    The name of ECR.
    NameRegex string
    OutputFile string
    ResourceGroupId string
    The ID of the resource group to which the ECR instance belongs.
    Status string
    The deployment status of the service instance.
    Tags Dictionary<string, string>
    A mapping of tags to assign to the resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Names []string
    A list of Express Connect Router names.
    Routers []GetRouterExpressConnectRoutersRouter
    A list of Express Connect Routers. Each element contains the following attributes:
    EcrId string
    The ID of ECR.
    EcrName string
    The name of ECR.
    NameRegex string
    OutputFile string
    ResourceGroupId string
    The ID of the resource group to which the ECR instance belongs.
    Status string
    The deployment status of the service instance.
    Tags map[string]string
    A mapping of tags to assign to the resource.
    id string
    The provider-assigned unique ID for this managed resource.
    ids list(string)
    names list(string)
    A list of Express Connect Router names.
    routers list(object)
    A list of Express Connect Routers. Each element contains the following attributes:
    ecr_id string
    The ID of ECR.
    ecr_name string
    The name of ECR.
    name_regex string
    output_file string
    resource_group_id string
    The ID of the resource group to which the ECR instance belongs.
    status string
    The deployment status of the service instance.
    tags map(string)
    A mapping of tags to assign to the resource.
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    A list of Express Connect Router names.
    routers List<GetRouterExpressConnectRoutersRouter>
    A list of Express Connect Routers. Each element contains the following attributes:
    ecrId String
    The ID of ECR.
    ecrName String
    The name of ECR.
    nameRegex String
    outputFile String
    resourceGroupId String
    The ID of the resource group to which the ECR instance belongs.
    status String
    The deployment status of the service instance.
    tags Map<String,String>
    A mapping of tags to assign to the resource.
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    names string[]
    A list of Express Connect Router names.
    routers GetRouterExpressConnectRoutersRouter[]
    A list of Express Connect Routers. Each element contains the following attributes:
    ecrId string
    The ID of ECR.
    ecrName string
    The name of ECR.
    nameRegex string
    outputFile string
    resourceGroupId string
    The ID of the resource group to which the ECR instance belongs.
    status string
    The deployment status of the service instance.
    tags {[key: string]: string}
    A mapping of tags to assign to the resource.
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    names Sequence[str]
    A list of Express Connect Router names.
    routers Sequence[GetRouterExpressConnectRoutersRouter]
    A list of Express Connect Routers. Each element contains the following attributes:
    ecr_id str
    The ID of ECR.
    ecr_name str
    The name of ECR.
    name_regex str
    output_file str
    resource_group_id str
    The ID of the resource group to which the ECR instance belongs.
    status str
    The deployment status of the service instance.
    tags Mapping[str, str]
    A mapping of tags to assign to the resource.
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    A list of Express Connect Router names.
    routers List<Property Map>
    A list of Express Connect Routers. Each element contains the following attributes:
    ecrId String
    The ID of ECR.
    ecrName String
    The name of ECR.
    nameRegex String
    outputFile String
    resourceGroupId String
    The ID of the resource group to which the ECR instance belongs.
    status String
    The deployment status of the service instance.
    tags Map<String>
    A mapping of tags to assign to the resource.

    Supporting Types

    GetRouterExpressConnectRoutersRouter

    AlibabaSideAsn string
    The ASN of the ECR instance.
    BizStatus string
    The business status of the service instance.
    CreateTime string
    The time when the ECR was created.
    Description string
    The description of the ECR instance.
    EcrId string
    The ID of ECR.
    EcrName string
    The name of ECR.
    Id string
    The ID of the Express Connect Router.
    ModifyTime string
    The time when the ECR was modified.
    OwnerId string
    The ID of the Alibaba Cloud account to which the ECR belongs.
    ResourceGroupId string
    The ID of the resource group to which the ECR belongs.
    Status string
    The deployment status of the service instance. Valid values: ACTIVE, UPDATING, ASSOCIATING, DISSOCIATING, LOCKED_ATTACHING, LOCKED_DETACHING, RECLAIMING, DELETING.
    Tags Dictionary<string, string>
    A mapping of tags to assign to the resource.
    AlibabaSideAsn string
    The ASN of the ECR instance.
    BizStatus string
    The business status of the service instance.
    CreateTime string
    The time when the ECR was created.
    Description string
    The description of the ECR instance.
    EcrId string
    The ID of ECR.
    EcrName string
    The name of ECR.
    Id string
    The ID of the Express Connect Router.
    ModifyTime string
    The time when the ECR was modified.
    OwnerId string
    The ID of the Alibaba Cloud account to which the ECR belongs.
    ResourceGroupId string
    The ID of the resource group to which the ECR belongs.
    Status string
    The deployment status of the service instance. Valid values: ACTIVE, UPDATING, ASSOCIATING, DISSOCIATING, LOCKED_ATTACHING, LOCKED_DETACHING, RECLAIMING, DELETING.
    Tags map[string]string
    A mapping of tags to assign to the resource.
    alibaba_side_asn string
    The ASN of the ECR instance.
    biz_status string
    The business status of the service instance.
    create_time string
    The time when the ECR was created.
    description string
    The description of the ECR instance.
    ecr_id string
    The ID of ECR.
    ecr_name string
    The name of ECR.
    id string
    The ID of the Express Connect Router.
    modify_time string
    The time when the ECR was modified.
    owner_id string
    The ID of the Alibaba Cloud account to which the ECR belongs.
    resource_group_id string
    The ID of the resource group to which the ECR belongs.
    status string
    The deployment status of the service instance. Valid values: ACTIVE, UPDATING, ASSOCIATING, DISSOCIATING, LOCKED_ATTACHING, LOCKED_DETACHING, RECLAIMING, DELETING.
    tags map(string)
    A mapping of tags to assign to the resource.
    alibabaSideAsn String
    The ASN of the ECR instance.
    bizStatus String
    The business status of the service instance.
    createTime String
    The time when the ECR was created.
    description String
    The description of the ECR instance.
    ecrId String
    The ID of ECR.
    ecrName String
    The name of ECR.
    id String
    The ID of the Express Connect Router.
    modifyTime String
    The time when the ECR was modified.
    ownerId String
    The ID of the Alibaba Cloud account to which the ECR belongs.
    resourceGroupId String
    The ID of the resource group to which the ECR belongs.
    status String
    The deployment status of the service instance. Valid values: ACTIVE, UPDATING, ASSOCIATING, DISSOCIATING, LOCKED_ATTACHING, LOCKED_DETACHING, RECLAIMING, DELETING.
    tags Map<String,String>
    A mapping of tags to assign to the resource.
    alibabaSideAsn string
    The ASN of the ECR instance.
    bizStatus string
    The business status of the service instance.
    createTime string
    The time when the ECR was created.
    description string
    The description of the ECR instance.
    ecrId string
    The ID of ECR.
    ecrName string
    The name of ECR.
    id string
    The ID of the Express Connect Router.
    modifyTime string
    The time when the ECR was modified.
    ownerId string
    The ID of the Alibaba Cloud account to which the ECR belongs.
    resourceGroupId string
    The ID of the resource group to which the ECR belongs.
    status string
    The deployment status of the service instance. Valid values: ACTIVE, UPDATING, ASSOCIATING, DISSOCIATING, LOCKED_ATTACHING, LOCKED_DETACHING, RECLAIMING, DELETING.
    tags {[key: string]: string}
    A mapping of tags to assign to the resource.
    alibaba_side_asn str
    The ASN of the ECR instance.
    biz_status str
    The business status of the service instance.
    create_time str
    The time when the ECR was created.
    description str
    The description of the ECR instance.
    ecr_id str
    The ID of ECR.
    ecr_name str
    The name of ECR.
    id str
    The ID of the Express Connect Router.
    modify_time str
    The time when the ECR was modified.
    owner_id str
    The ID of the Alibaba Cloud account to which the ECR belongs.
    resource_group_id str
    The ID of the resource group to which the ECR belongs.
    status str
    The deployment status of the service instance. Valid values: ACTIVE, UPDATING, ASSOCIATING, DISSOCIATING, LOCKED_ATTACHING, LOCKED_DETACHING, RECLAIMING, DELETING.
    tags Mapping[str, str]
    A mapping of tags to assign to the resource.
    alibabaSideAsn String
    The ASN of the ECR instance.
    bizStatus String
    The business status of the service instance.
    createTime String
    The time when the ECR was created.
    description String
    The description of the ECR instance.
    ecrId String
    The ID of ECR.
    ecrName String
    The name of ECR.
    id String
    The ID of the Express Connect Router.
    modifyTime String
    The time when the ECR was modified.
    ownerId String
    The ID of the Alibaba Cloud account to which the ECR belongs.
    resourceGroupId String
    The ID of the resource group to which the ECR belongs.
    status String
    The deployment status of the service instance. Valid values: ACTIVE, UPDATING, ASSOCIATING, DISSOCIATING, LOCKED_ATTACHING, LOCKED_DETACHING, RECLAIMING, DELETING.
    tags Map<String>
    A mapping of tags to assign to the resource.

    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 alicloud logo
    Viewing docs for Alibaba Cloud v3.108.0
    published on Thursday, Sep 17, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial