1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. expressconnect
  5. RouterGrantAssociation
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.expressconnect.RouterGrantAssociation

Explore with Pulumi AI

Provides a Express Connect Router Grant Association resource.

Network instances authorized to the leased line Gateway.

For information about Express Connect Router Grant Association and how to use it, see What is Grant Association.

NOTE: Available since v1.239.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 vpcId = config.get("vpcId") || "vpc-xxx";
const ecrOwnerUid = config.get("ecrOwnerUid") || "18xxx";
const ecrId = config.get("ecrId") || "ecr-xxx";
const region = config.get("region") || "cn-hangzhou";
const _default = new alicloud.expressconnect.RouterGrantAssociation("default", {
    ecrId: ecrId,
    instanceRegionId: region,
    instanceId: vpcId,
    ecrOwnerAliUid: ecrOwnerUid,
    instanceType: "VPC",
});
Copy
import pulumi
import pulumi_alicloud as alicloud

config = pulumi.Config()
name = config.get("name")
if name is None:
    name = "terraform-example"
vpc_id = config.get("vpcId")
if vpc_id is None:
    vpc_id = "vpc-xxx"
ecr_owner_uid = config.get("ecrOwnerUid")
if ecr_owner_uid is None:
    ecr_owner_uid = "18xxx"
ecr_id = config.get("ecrId")
if ecr_id is None:
    ecr_id = "ecr-xxx"
region = config.get("region")
if region is None:
    region = "cn-hangzhou"
default = alicloud.expressconnect.RouterGrantAssociation("default",
    ecr_id=ecr_id,
    instance_region_id=region,
    instance_id=vpc_id,
    ecr_owner_ali_uid=ecr_owner_uid,
    instance_type="VPC")
Copy
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
		}
		vpcId := "vpc-xxx"
		if param := cfg.Get("vpcId"); param != "" {
			vpcId = param
		}
		ecrOwnerUid := "18xxx"
		if param := cfg.Get("ecrOwnerUid"); param != "" {
			ecrOwnerUid = param
		}
		ecrId := "ecr-xxx"
		if param := cfg.Get("ecrId"); param != "" {
			ecrId = param
		}
		region := "cn-hangzhou"
		if param := cfg.Get("region"); param != "" {
			region = param
		}
		_, err := expressconnect.NewRouterGrantAssociation(ctx, "default", &expressconnect.RouterGrantAssociationArgs{
			EcrId:            pulumi.String(ecrId),
			InstanceRegionId: pulumi.String(region),
			InstanceId:       pulumi.String(vpcId),
			EcrOwnerAliUid:   pulumi.String(ecrOwnerUid),
			InstanceType:     pulumi.String("VPC"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
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 vpcId = config.Get("vpcId") ?? "vpc-xxx";
    var ecrOwnerUid = config.Get("ecrOwnerUid") ?? "18xxx";
    var ecrId = config.Get("ecrId") ?? "ecr-xxx";
    var region = config.Get("region") ?? "cn-hangzhou";
    var @default = new AliCloud.ExpressConnect.RouterGrantAssociation("default", new()
    {
        EcrId = ecrId,
        InstanceRegionId = region,
        InstanceId = vpcId,
        EcrOwnerAliUid = ecrOwnerUid,
        InstanceType = "VPC",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.expressconnect.RouterGrantAssociation;
import com.pulumi.alicloud.expressconnect.RouterGrantAssociationArgs;
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");
        final var vpcId = config.get("vpcId").orElse("vpc-xxx");
        final var ecrOwnerUid = config.get("ecrOwnerUid").orElse("18xxx");
        final var ecrId = config.get("ecrId").orElse("ecr-xxx");
        final var region = config.get("region").orElse("cn-hangzhou");
        var default_ = new RouterGrantAssociation("default", RouterGrantAssociationArgs.builder()
            .ecrId(ecrId)
            .instanceRegionId(region)
            .instanceId(vpcId)
            .ecrOwnerAliUid(ecrOwnerUid)
            .instanceType("VPC")
            .build());

    }
}
Copy
configuration:
  name:
    type: string
    default: terraform-example
  vpcId:
    type: string
    default: vpc-xxx
  ecrOwnerUid:
    type: string
    default: 18xxx
  ecrId:
    type: string
    default: ecr-xxx
  region:
    type: string
    default: cn-hangzhou
resources:
  default:
    type: alicloud:expressconnect:RouterGrantAssociation
    properties:
      ecrId: ${ecrId}
      instanceRegionId: ${region}
      instanceId: ${vpcId}
      ecrOwnerAliUid: ${ecrOwnerUid}
      instanceType: VPC
Copy

Create RouterGrantAssociation Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new RouterGrantAssociation(name: string, args: RouterGrantAssociationArgs, opts?: CustomResourceOptions);
@overload
def RouterGrantAssociation(resource_name: str,
                           args: RouterGrantAssociationArgs,
                           opts: Optional[ResourceOptions] = None)

@overload
def RouterGrantAssociation(resource_name: str,
                           opts: Optional[ResourceOptions] = None,
                           ecr_id: Optional[str] = None,
                           ecr_owner_ali_uid: Optional[int] = None,
                           instance_id: Optional[str] = None,
                           instance_region_id: Optional[str] = None,
                           instance_type: Optional[str] = None)
func NewRouterGrantAssociation(ctx *Context, name string, args RouterGrantAssociationArgs, opts ...ResourceOption) (*RouterGrantAssociation, error)
public RouterGrantAssociation(string name, RouterGrantAssociationArgs args, CustomResourceOptions? opts = null)
public RouterGrantAssociation(String name, RouterGrantAssociationArgs args)
public RouterGrantAssociation(String name, RouterGrantAssociationArgs args, CustomResourceOptions options)
type: alicloud:expressconnect:RouterGrantAssociation
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. RouterGrantAssociationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. RouterGrantAssociationArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. RouterGrantAssociationArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. RouterGrantAssociationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. RouterGrantAssociationArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var routerGrantAssociationResource = new AliCloud.ExpressConnect.RouterGrantAssociation("routerGrantAssociationResource", new()
{
    EcrId = "string",
    EcrOwnerAliUid = 0,
    InstanceId = "string",
    InstanceRegionId = "string",
    InstanceType = "string",
});
Copy
example, err := expressconnect.NewRouterGrantAssociation(ctx, "routerGrantAssociationResource", &expressconnect.RouterGrantAssociationArgs{
	EcrId:            pulumi.String("string"),
	EcrOwnerAliUid:   pulumi.Int(0),
	InstanceId:       pulumi.String("string"),
	InstanceRegionId: pulumi.String("string"),
	InstanceType:     pulumi.String("string"),
})
Copy
var routerGrantAssociationResource = new RouterGrantAssociation("routerGrantAssociationResource", RouterGrantAssociationArgs.builder()
    .ecrId("string")
    .ecrOwnerAliUid(0)
    .instanceId("string")
    .instanceRegionId("string")
    .instanceType("string")
    .build());
Copy
router_grant_association_resource = alicloud.expressconnect.RouterGrantAssociation("routerGrantAssociationResource",
    ecr_id="string",
    ecr_owner_ali_uid=0,
    instance_id="string",
    instance_region_id="string",
    instance_type="string")
Copy
const routerGrantAssociationResource = new alicloud.expressconnect.RouterGrantAssociation("routerGrantAssociationResource", {
    ecrId: "string",
    ecrOwnerAliUid: 0,
    instanceId: "string",
    instanceRegionId: "string",
    instanceType: "string",
});
Copy
type: alicloud:expressconnect:RouterGrantAssociation
properties:
    ecrId: string
    ecrOwnerAliUid: 0
    instanceId: string
    instanceRegionId: string
    instanceType: string
Copy

RouterGrantAssociation Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The RouterGrantAssociation resource accepts the following input properties:

EcrId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the associated Leased Line Gateway instance.
EcrOwnerAliUid
This property is required.
Changes to this property will trigger replacement.
int
The ID of the Alibaba Cloud account (primary account) to which the leased line gateway instance is authorized.
InstanceId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the network instance.
InstanceRegionId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the region where the authorized network instance is located.
InstanceType
This property is required.
Changes to this property will trigger replacement.
string
The type of the network instance. Value:

  • VBR: the VBR instance.
  • VPC: VPC instance.
EcrId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the associated Leased Line Gateway instance.
EcrOwnerAliUid
This property is required.
Changes to this property will trigger replacement.
int
The ID of the Alibaba Cloud account (primary account) to which the leased line gateway instance is authorized.
InstanceId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the network instance.
InstanceRegionId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the region where the authorized network instance is located.
InstanceType
This property is required.
Changes to this property will trigger replacement.
string
The type of the network instance. Value:

  • VBR: the VBR instance.
  • VPC: VPC instance.
ecrId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the associated Leased Line Gateway instance.
ecrOwnerAliUid
This property is required.
Changes to this property will trigger replacement.
Integer
The ID of the Alibaba Cloud account (primary account) to which the leased line gateway instance is authorized.
instanceId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the network instance.
instanceRegionId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the region where the authorized network instance is located.
instanceType
This property is required.
Changes to this property will trigger replacement.
String
The type of the network instance. Value:

  • VBR: the VBR instance.
  • VPC: VPC instance.
ecrId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the associated Leased Line Gateway instance.
ecrOwnerAliUid
This property is required.
Changes to this property will trigger replacement.
number
The ID of the Alibaba Cloud account (primary account) to which the leased line gateway instance is authorized.
instanceId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the network instance.
instanceRegionId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the region where the authorized network instance is located.
instanceType
This property is required.
Changes to this property will trigger replacement.
string
The type of the network instance. Value:

  • VBR: the VBR instance.
  • VPC: VPC instance.
ecr_id
This property is required.
Changes to this property will trigger replacement.
str
The ID of the associated Leased Line Gateway instance.
ecr_owner_ali_uid
This property is required.
Changes to this property will trigger replacement.
int
The ID of the Alibaba Cloud account (primary account) to which the leased line gateway instance is authorized.
instance_id
This property is required.
Changes to this property will trigger replacement.
str
The ID of the network instance.
instance_region_id
This property is required.
Changes to this property will trigger replacement.
str
The ID of the region where the authorized network instance is located.
instance_type
This property is required.
Changes to this property will trigger replacement.
str
The type of the network instance. Value:

  • VBR: the VBR instance.
  • VPC: VPC instance.
ecrId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the associated Leased Line Gateway instance.
ecrOwnerAliUid
This property is required.
Changes to this property will trigger replacement.
Number
The ID of the Alibaba Cloud account (primary account) to which the leased line gateway instance is authorized.
instanceId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the network instance.
instanceRegionId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the region where the authorized network instance is located.
instanceType
This property is required.
Changes to this property will trigger replacement.
String
The type of the network instance. Value:

  • VBR: the VBR instance.
  • VPC: VPC instance.

Outputs

All input properties are implicitly available as output properties. Additionally, the RouterGrantAssociation resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Status string
The status of the resource
Id string
The provider-assigned unique ID for this managed resource.
Status string
The status of the resource
id String
The provider-assigned unique ID for this managed resource.
status String
The status of the resource
id string
The provider-assigned unique ID for this managed resource.
status string
The status of the resource
id str
The provider-assigned unique ID for this managed resource.
status str
The status of the resource
id String
The provider-assigned unique ID for this managed resource.
status String
The status of the resource

Look up Existing RouterGrantAssociation Resource

Get an existing RouterGrantAssociation resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: RouterGrantAssociationState, opts?: CustomResourceOptions): RouterGrantAssociation
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        ecr_id: Optional[str] = None,
        ecr_owner_ali_uid: Optional[int] = None,
        instance_id: Optional[str] = None,
        instance_region_id: Optional[str] = None,
        instance_type: Optional[str] = None,
        status: Optional[str] = None) -> RouterGrantAssociation
func GetRouterGrantAssociation(ctx *Context, name string, id IDInput, state *RouterGrantAssociationState, opts ...ResourceOption) (*RouterGrantAssociation, error)
public static RouterGrantAssociation Get(string name, Input<string> id, RouterGrantAssociationState? state, CustomResourceOptions? opts = null)
public static RouterGrantAssociation get(String name, Output<String> id, RouterGrantAssociationState state, CustomResourceOptions options)
resources:  _:    type: alicloud:expressconnect:RouterGrantAssociation    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
EcrId Changes to this property will trigger replacement. string
The ID of the associated Leased Line Gateway instance.
EcrOwnerAliUid Changes to this property will trigger replacement. int
The ID of the Alibaba Cloud account (primary account) to which the leased line gateway instance is authorized.
InstanceId Changes to this property will trigger replacement. string
The ID of the network instance.
InstanceRegionId Changes to this property will trigger replacement. string
The ID of the region where the authorized network instance is located.
InstanceType Changes to this property will trigger replacement. string
The type of the network instance. Value:

  • VBR: the VBR instance.
  • VPC: VPC instance.
Status string
The status of the resource
EcrId Changes to this property will trigger replacement. string
The ID of the associated Leased Line Gateway instance.
EcrOwnerAliUid Changes to this property will trigger replacement. int
The ID of the Alibaba Cloud account (primary account) to which the leased line gateway instance is authorized.
InstanceId Changes to this property will trigger replacement. string
The ID of the network instance.
InstanceRegionId Changes to this property will trigger replacement. string
The ID of the region where the authorized network instance is located.
InstanceType Changes to this property will trigger replacement. string
The type of the network instance. Value:

  • VBR: the VBR instance.
  • VPC: VPC instance.
Status string
The status of the resource
ecrId Changes to this property will trigger replacement. String
The ID of the associated Leased Line Gateway instance.
ecrOwnerAliUid Changes to this property will trigger replacement. Integer
The ID of the Alibaba Cloud account (primary account) to which the leased line gateway instance is authorized.
instanceId Changes to this property will trigger replacement. String
The ID of the network instance.
instanceRegionId Changes to this property will trigger replacement. String
The ID of the region where the authorized network instance is located.
instanceType Changes to this property will trigger replacement. String
The type of the network instance. Value:

  • VBR: the VBR instance.
  • VPC: VPC instance.
status String
The status of the resource
ecrId Changes to this property will trigger replacement. string
The ID of the associated Leased Line Gateway instance.
ecrOwnerAliUid Changes to this property will trigger replacement. number
The ID of the Alibaba Cloud account (primary account) to which the leased line gateway instance is authorized.
instanceId Changes to this property will trigger replacement. string
The ID of the network instance.
instanceRegionId Changes to this property will trigger replacement. string
The ID of the region where the authorized network instance is located.
instanceType Changes to this property will trigger replacement. string
The type of the network instance. Value:

  • VBR: the VBR instance.
  • VPC: VPC instance.
status string
The status of the resource
ecr_id Changes to this property will trigger replacement. str
The ID of the associated Leased Line Gateway instance.
ecr_owner_ali_uid Changes to this property will trigger replacement. int
The ID of the Alibaba Cloud account (primary account) to which the leased line gateway instance is authorized.
instance_id Changes to this property will trigger replacement. str
The ID of the network instance.
instance_region_id Changes to this property will trigger replacement. str
The ID of the region where the authorized network instance is located.
instance_type Changes to this property will trigger replacement. str
The type of the network instance. Value:

  • VBR: the VBR instance.
  • VPC: VPC instance.
status str
The status of the resource
ecrId Changes to this property will trigger replacement. String
The ID of the associated Leased Line Gateway instance.
ecrOwnerAliUid Changes to this property will trigger replacement. Number
The ID of the Alibaba Cloud account (primary account) to which the leased line gateway instance is authorized.
instanceId Changes to this property will trigger replacement. String
The ID of the network instance.
instanceRegionId Changes to this property will trigger replacement. String
The ID of the region where the authorized network instance is located.
instanceType Changes to this property will trigger replacement. String
The type of the network instance. Value:

  • VBR: the VBR instance.
  • VPC: VPC instance.
status String
The status of the resource

Import

Express Connect Router Grant Association can be imported using the id, e.g.

$ pulumi import alicloud:expressconnect/routerGrantAssociation:RouterGrantAssociation example <ecr_id>:<instance_id>:<instance_region_id>:<ecr_owner_ali_uid>:<instance_type>
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.