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

alicloud.cen.TransitRouterGrantAttachment

Explore with Pulumi AI

Provides a Cloud Enterprise Network (CEN) Transit Router Grant Attachment resource.

For information about Cloud Enterprise Network (CEN) Transit Router Grant Attachment and how to use it, see What is Transit Router Grant Attachment.

NOTE: Available since v1.187.0.

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const _default = alicloud.getAccount({});
const example = new alicloud.vpc.Network("example", {
    vpcName: "tf_example",
    cidrBlock: "172.17.3.0/24",
});
const exampleInstance = new alicloud.cen.Instance("example", {
    cenInstanceName: "tf_example",
    description: "an example for cen",
});
const exampleTransitRouterGrantAttachment = new alicloud.cen.TransitRouterGrantAttachment("example", {
    cenId: exampleInstance.id,
    cenOwnerId: _default.then(_default => _default.id),
    instanceId: example.id,
    instanceType: "VPC",
    orderType: "PayByCenOwner",
});
Copy
import pulumi
import pulumi_alicloud as alicloud

default = alicloud.get_account()
example = alicloud.vpc.Network("example",
    vpc_name="tf_example",
    cidr_block="172.17.3.0/24")
example_instance = alicloud.cen.Instance("example",
    cen_instance_name="tf_example",
    description="an example for cen")
example_transit_router_grant_attachment = alicloud.cen.TransitRouterGrantAttachment("example",
    cen_id=example_instance.id,
    cen_owner_id=default.id,
    instance_id=example.id,
    instance_type="VPC",
    order_type="PayByCenOwner")
Copy
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cen"
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_default, err := alicloud.GetAccount(ctx, map[string]interface{}{}, nil)
		if err != nil {
			return err
		}
		example, err := vpc.NewNetwork(ctx, "example", &vpc.NetworkArgs{
			VpcName:   pulumi.String("tf_example"),
			CidrBlock: pulumi.String("172.17.3.0/24"),
		})
		if err != nil {
			return err
		}
		exampleInstance, err := cen.NewInstance(ctx, "example", &cen.InstanceArgs{
			CenInstanceName: pulumi.String("tf_example"),
			Description:     pulumi.String("an example for cen"),
		})
		if err != nil {
			return err
		}
		_, err = cen.NewTransitRouterGrantAttachment(ctx, "example", &cen.TransitRouterGrantAttachmentArgs{
			CenId:        exampleInstance.ID(),
			CenOwnerId:   pulumi.String(_default.Id),
			InstanceId:   example.ID(),
			InstanceType: pulumi.String("VPC"),
			OrderType:    pulumi.String("PayByCenOwner"),
		})
		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 @default = AliCloud.GetAccount.Invoke();

    var example = new AliCloud.Vpc.Network("example", new()
    {
        VpcName = "tf_example",
        CidrBlock = "172.17.3.0/24",
    });

    var exampleInstance = new AliCloud.Cen.Instance("example", new()
    {
        CenInstanceName = "tf_example",
        Description = "an example for cen",
    });

    var exampleTransitRouterGrantAttachment = new AliCloud.Cen.TransitRouterGrantAttachment("example", new()
    {
        CenId = exampleInstance.Id,
        CenOwnerId = @default.Apply(@default => @default.Apply(getAccountResult => getAccountResult.Id)),
        InstanceId = example.Id,
        InstanceType = "VPC",
        OrderType = "PayByCenOwner",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.AlicloudFunctions;
import com.pulumi.alicloud.vpc.Network;
import com.pulumi.alicloud.vpc.NetworkArgs;
import com.pulumi.alicloud.cen.Instance;
import com.pulumi.alicloud.cen.InstanceArgs;
import com.pulumi.alicloud.cen.TransitRouterGrantAttachment;
import com.pulumi.alicloud.cen.TransitRouterGrantAttachmentArgs;
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 default = AlicloudFunctions.getAccount();

        var example = new Network("example", NetworkArgs.builder()
            .vpcName("tf_example")
            .cidrBlock("172.17.3.0/24")
            .build());

        var exampleInstance = new Instance("exampleInstance", InstanceArgs.builder()
            .cenInstanceName("tf_example")
            .description("an example for cen")
            .build());

        var exampleTransitRouterGrantAttachment = new TransitRouterGrantAttachment("exampleTransitRouterGrantAttachment", TransitRouterGrantAttachmentArgs.builder()
            .cenId(exampleInstance.id())
            .cenOwnerId(default_.id())
            .instanceId(example.id())
            .instanceType("VPC")
            .orderType("PayByCenOwner")
            .build());

    }
}
Copy
resources:
  example:
    type: alicloud:vpc:Network
    properties:
      vpcName: tf_example
      cidrBlock: 172.17.3.0/24
  exampleInstance:
    type: alicloud:cen:Instance
    name: example
    properties:
      cenInstanceName: tf_example
      description: an example for cen
  exampleTransitRouterGrantAttachment:
    type: alicloud:cen:TransitRouterGrantAttachment
    name: example
    properties:
      cenId: ${exampleInstance.id}
      cenOwnerId: ${default.id}
      instanceId: ${example.id}
      instanceType: VPC
      orderType: PayByCenOwner
variables:
  default:
    fn::invoke:
      function: alicloud:getAccount
      arguments: {}
Copy

Create TransitRouterGrantAttachment Resource

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

Constructor syntax

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

@overload
def TransitRouterGrantAttachment(resource_name: str,
                                 opts: Optional[ResourceOptions] = None,
                                 cen_id: Optional[str] = None,
                                 cen_owner_id: Optional[str] = None,
                                 instance_id: Optional[str] = None,
                                 instance_type: Optional[str] = None,
                                 order_type: Optional[str] = None)
func NewTransitRouterGrantAttachment(ctx *Context, name string, args TransitRouterGrantAttachmentArgs, opts ...ResourceOption) (*TransitRouterGrantAttachment, error)
public TransitRouterGrantAttachment(string name, TransitRouterGrantAttachmentArgs args, CustomResourceOptions? opts = null)
public TransitRouterGrantAttachment(String name, TransitRouterGrantAttachmentArgs args)
public TransitRouterGrantAttachment(String name, TransitRouterGrantAttachmentArgs args, CustomResourceOptions options)
type: alicloud:cen:TransitRouterGrantAttachment
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. TransitRouterGrantAttachmentArgs
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. TransitRouterGrantAttachmentArgs
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. TransitRouterGrantAttachmentArgs
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. TransitRouterGrantAttachmentArgs
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. TransitRouterGrantAttachmentArgs
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 transitRouterGrantAttachmentResource = new AliCloud.Cen.TransitRouterGrantAttachment("transitRouterGrantAttachmentResource", new()
{
    CenId = "string",
    CenOwnerId = "string",
    InstanceId = "string",
    InstanceType = "string",
    OrderType = "string",
});
Copy
example, err := cen.NewTransitRouterGrantAttachment(ctx, "transitRouterGrantAttachmentResource", &cen.TransitRouterGrantAttachmentArgs{
	CenId:        pulumi.String("string"),
	CenOwnerId:   pulumi.String("string"),
	InstanceId:   pulumi.String("string"),
	InstanceType: pulumi.String("string"),
	OrderType:    pulumi.String("string"),
})
Copy
var transitRouterGrantAttachmentResource = new TransitRouterGrantAttachment("transitRouterGrantAttachmentResource", TransitRouterGrantAttachmentArgs.builder()
    .cenId("string")
    .cenOwnerId("string")
    .instanceId("string")
    .instanceType("string")
    .orderType("string")
    .build());
Copy
transit_router_grant_attachment_resource = alicloud.cen.TransitRouterGrantAttachment("transitRouterGrantAttachmentResource",
    cen_id="string",
    cen_owner_id="string",
    instance_id="string",
    instance_type="string",
    order_type="string")
Copy
const transitRouterGrantAttachmentResource = new alicloud.cen.TransitRouterGrantAttachment("transitRouterGrantAttachmentResource", {
    cenId: "string",
    cenOwnerId: "string",
    instanceId: "string",
    instanceType: "string",
    orderType: "string",
});
Copy
type: alicloud:cen:TransitRouterGrantAttachment
properties:
    cenId: string
    cenOwnerId: string
    instanceId: string
    instanceType: string
    orderType: string
Copy

TransitRouterGrantAttachment 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 TransitRouterGrantAttachment resource accepts the following input properties:

CenId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the Cloud Enterprise Network (CEN) instance to which the transit router belongs.
CenOwnerId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the Alibaba Cloud account to which the CEN instance belongs.
InstanceId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the network instance.
InstanceType
This property is required.
Changes to this property will trigger replacement.
string
The type of the network instance. Valid values: VPC, ExpressConnect, VPN.
OrderType Changes to this property will trigger replacement. string
The entity that pays the fees of the network instance. Valid values: PayByResourceOwner, PayByCenOwner.
CenId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the Cloud Enterprise Network (CEN) instance to which the transit router belongs.
CenOwnerId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the Alibaba Cloud account to which the CEN instance belongs.
InstanceId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the network instance.
InstanceType
This property is required.
Changes to this property will trigger replacement.
string
The type of the network instance. Valid values: VPC, ExpressConnect, VPN.
OrderType Changes to this property will trigger replacement. string
The entity that pays the fees of the network instance. Valid values: PayByResourceOwner, PayByCenOwner.
cenId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the Cloud Enterprise Network (CEN) instance to which the transit router belongs.
cenOwnerId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the Alibaba Cloud account to which the CEN instance belongs.
instanceId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the network instance.
instanceType
This property is required.
Changes to this property will trigger replacement.
String
The type of the network instance. Valid values: VPC, ExpressConnect, VPN.
orderType Changes to this property will trigger replacement. String
The entity that pays the fees of the network instance. Valid values: PayByResourceOwner, PayByCenOwner.
cenId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the Cloud Enterprise Network (CEN) instance to which the transit router belongs.
cenOwnerId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the Alibaba Cloud account to which the CEN instance belongs.
instanceId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the network instance.
instanceType
This property is required.
Changes to this property will trigger replacement.
string
The type of the network instance. Valid values: VPC, ExpressConnect, VPN.
orderType Changes to this property will trigger replacement. string
The entity that pays the fees of the network instance. Valid values: PayByResourceOwner, PayByCenOwner.
cen_id
This property is required.
Changes to this property will trigger replacement.
str
The ID of the Cloud Enterprise Network (CEN) instance to which the transit router belongs.
cen_owner_id
This property is required.
Changes to this property will trigger replacement.
str
The ID of the Alibaba Cloud account to which the CEN instance belongs.
instance_id
This property is required.
Changes to this property will trigger replacement.
str
The ID of the network instance.
instance_type
This property is required.
Changes to this property will trigger replacement.
str
The type of the network instance. Valid values: VPC, ExpressConnect, VPN.
order_type Changes to this property will trigger replacement. str
The entity that pays the fees of the network instance. Valid values: PayByResourceOwner, PayByCenOwner.
cenId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the Cloud Enterprise Network (CEN) instance to which the transit router belongs.
cenOwnerId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the Alibaba Cloud account to which the CEN instance belongs.
instanceId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the network instance.
instanceType
This property is required.
Changes to this property will trigger replacement.
String
The type of the network instance. Valid values: VPC, ExpressConnect, VPN.
orderType Changes to this property will trigger replacement. String
The entity that pays the fees of the network instance. Valid values: PayByResourceOwner, PayByCenOwner.

Outputs

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

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

Look up Existing TransitRouterGrantAttachment Resource

Get an existing TransitRouterGrantAttachment 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?: TransitRouterGrantAttachmentState, opts?: CustomResourceOptions): TransitRouterGrantAttachment
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        cen_id: Optional[str] = None,
        cen_owner_id: Optional[str] = None,
        instance_id: Optional[str] = None,
        instance_type: Optional[str] = None,
        order_type: Optional[str] = None) -> TransitRouterGrantAttachment
func GetTransitRouterGrantAttachment(ctx *Context, name string, id IDInput, state *TransitRouterGrantAttachmentState, opts ...ResourceOption) (*TransitRouterGrantAttachment, error)
public static TransitRouterGrantAttachment Get(string name, Input<string> id, TransitRouterGrantAttachmentState? state, CustomResourceOptions? opts = null)
public static TransitRouterGrantAttachment get(String name, Output<String> id, TransitRouterGrantAttachmentState state, CustomResourceOptions options)
resources:  _:    type: alicloud:cen:TransitRouterGrantAttachment    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:
CenId Changes to this property will trigger replacement. string
The ID of the Cloud Enterprise Network (CEN) instance to which the transit router belongs.
CenOwnerId Changes to this property will trigger replacement. string
The ID of the Alibaba Cloud account to which the CEN instance belongs.
InstanceId Changes to this property will trigger replacement. string
The ID of the network instance.
InstanceType Changes to this property will trigger replacement. string
The type of the network instance. Valid values: VPC, ExpressConnect, VPN.
OrderType Changes to this property will trigger replacement. string
The entity that pays the fees of the network instance. Valid values: PayByResourceOwner, PayByCenOwner.
CenId Changes to this property will trigger replacement. string
The ID of the Cloud Enterprise Network (CEN) instance to which the transit router belongs.
CenOwnerId Changes to this property will trigger replacement. string
The ID of the Alibaba Cloud account to which the CEN instance belongs.
InstanceId Changes to this property will trigger replacement. string
The ID of the network instance.
InstanceType Changes to this property will trigger replacement. string
The type of the network instance. Valid values: VPC, ExpressConnect, VPN.
OrderType Changes to this property will trigger replacement. string
The entity that pays the fees of the network instance. Valid values: PayByResourceOwner, PayByCenOwner.
cenId Changes to this property will trigger replacement. String
The ID of the Cloud Enterprise Network (CEN) instance to which the transit router belongs.
cenOwnerId Changes to this property will trigger replacement. String
The ID of the Alibaba Cloud account to which the CEN instance belongs.
instanceId Changes to this property will trigger replacement. String
The ID of the network instance.
instanceType Changes to this property will trigger replacement. String
The type of the network instance. Valid values: VPC, ExpressConnect, VPN.
orderType Changes to this property will trigger replacement. String
The entity that pays the fees of the network instance. Valid values: PayByResourceOwner, PayByCenOwner.
cenId Changes to this property will trigger replacement. string
The ID of the Cloud Enterprise Network (CEN) instance to which the transit router belongs.
cenOwnerId Changes to this property will trigger replacement. string
The ID of the Alibaba Cloud account to which the CEN instance belongs.
instanceId Changes to this property will trigger replacement. string
The ID of the network instance.
instanceType Changes to this property will trigger replacement. string
The type of the network instance. Valid values: VPC, ExpressConnect, VPN.
orderType Changes to this property will trigger replacement. string
The entity that pays the fees of the network instance. Valid values: PayByResourceOwner, PayByCenOwner.
cen_id Changes to this property will trigger replacement. str
The ID of the Cloud Enterprise Network (CEN) instance to which the transit router belongs.
cen_owner_id Changes to this property will trigger replacement. str
The ID of the Alibaba Cloud account to which the CEN instance belongs.
instance_id Changes to this property will trigger replacement. str
The ID of the network instance.
instance_type Changes to this property will trigger replacement. str
The type of the network instance. Valid values: VPC, ExpressConnect, VPN.
order_type Changes to this property will trigger replacement. str
The entity that pays the fees of the network instance. Valid values: PayByResourceOwner, PayByCenOwner.
cenId Changes to this property will trigger replacement. String
The ID of the Cloud Enterprise Network (CEN) instance to which the transit router belongs.
cenOwnerId Changes to this property will trigger replacement. String
The ID of the Alibaba Cloud account to which the CEN instance belongs.
instanceId Changes to this property will trigger replacement. String
The ID of the network instance.
instanceType Changes to this property will trigger replacement. String
The type of the network instance. Valid values: VPC, ExpressConnect, VPN.
orderType Changes to this property will trigger replacement. String
The entity that pays the fees of the network instance. Valid values: PayByResourceOwner, PayByCenOwner.

Import

Cloud Enterprise Network (CEN) Transit Router Grant Attachment can be imported using the id, e.g.

$ pulumi import alicloud:cen/transitRouterGrantAttachment:TransitRouterGrantAttachment example <instance_type>:<instance_id>:<cen_owner_id>:<cen_id>
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.