alicloud.cen.TransitRouterGrantAttachment

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 in v1.187.0+.

Example Usage

Basic Usage

using System.Collections.Generic;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var defaultNetworks = AliCloud.Vpc.GetNetworks.Invoke(new()
    {
        NameRegex = "default-NODELETING",
    });

    var defaultInstance = new AliCloud.Cen.Instance("defaultInstance", new()
    {
        CenInstanceName = @var.Name,
        Description = "test for transit router grant attachment",
    });

    var defaultTransitRouterGrantAttachment = new AliCloud.Cen.TransitRouterGrantAttachment("defaultTransitRouterGrantAttachment", new()
    {
        CenId = defaultInstance.Id,
        CenOwnerId = "your_cen_owner_id",
        InstanceId = defaultNetworks.Apply(getNetworksResult => getNetworksResult.Ids[0]),
        InstanceType = "VPC",
        OrderType = "PayByCenOwner",
    });

});
package main

import (
	"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 {
		defaultNetworks, err := vpc.GetNetworks(ctx, &vpc.GetNetworksArgs{
			NameRegex: pulumi.StringRef("default-NODELETING"),
		}, nil)
		if err != nil {
			return err
		}
		defaultInstance, err := cen.NewInstance(ctx, "defaultInstance", &cen.InstanceArgs{
			CenInstanceName: pulumi.Any(_var.Name),
			Description:     pulumi.String("test for transit router grant attachment"),
		})
		if err != nil {
			return err
		}
		_, err = cen.NewTransitRouterGrantAttachment(ctx, "defaultTransitRouterGrantAttachment", &cen.TransitRouterGrantAttachmentArgs{
			CenId:        defaultInstance.ID(),
			CenOwnerId:   pulumi.String("your_cen_owner_id"),
			InstanceId:   *pulumi.String(defaultNetworks.Ids[0]),
			InstanceType: pulumi.String("VPC"),
			OrderType:    pulumi.String("PayByCenOwner"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.vpc.VpcFunctions;
import com.pulumi.alicloud.vpc.inputs.GetNetworksArgs;
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 defaultNetworks = VpcFunctions.getNetworks(GetNetworksArgs.builder()
            .nameRegex("default-NODELETING")
            .build());

        var defaultInstance = new Instance("defaultInstance", InstanceArgs.builder()        
            .cenInstanceName(var_.name())
            .description("test for transit router grant attachment")
            .build());

        var defaultTransitRouterGrantAttachment = new TransitRouterGrantAttachment("defaultTransitRouterGrantAttachment", TransitRouterGrantAttachmentArgs.builder()        
            .cenId(defaultInstance.id())
            .cenOwnerId("your_cen_owner_id")
            .instanceId(defaultNetworks.applyValue(getNetworksResult -> getNetworksResult.ids()[0]))
            .instanceType("VPC")
            .orderType("PayByCenOwner")
            .build());

    }
}
import pulumi
import pulumi_alicloud as alicloud

default_networks = alicloud.vpc.get_networks(name_regex="default-NODELETING")
default_instance = alicloud.cen.Instance("defaultInstance",
    cen_instance_name=var["name"],
    description="test for transit router grant attachment")
default_transit_router_grant_attachment = alicloud.cen.TransitRouterGrantAttachment("defaultTransitRouterGrantAttachment",
    cen_id=default_instance.id,
    cen_owner_id="your_cen_owner_id",
    instance_id=default_networks.ids[0],
    instance_type="VPC",
    order_type="PayByCenOwner")
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const defaultNetworks = alicloud.vpc.getNetworks({
    nameRegex: "default-NODELETING",
});
const defaultInstance = new alicloud.cen.Instance("defaultInstance", {
    cenInstanceName: _var.name,
    description: "test for transit router grant attachment",
});
const defaultTransitRouterGrantAttachment = new alicloud.cen.TransitRouterGrantAttachment("defaultTransitRouterGrantAttachment", {
    cenId: defaultInstance.id,
    cenOwnerId: "your_cen_owner_id",
    instanceId: defaultNetworks.then(defaultNetworks => defaultNetworks.ids?.[0]),
    instanceType: "VPC",
    orderType: "PayByCenOwner",
});
resources:
  defaultInstance:
    type: alicloud:cen:Instance
    properties:
      cenInstanceName: ${var.name}
      description: test for transit router grant attachment
  defaultTransitRouterGrantAttachment:
    type: alicloud:cen:TransitRouterGrantAttachment
    properties:
      cenId: ${defaultInstance.id}
      cenOwnerId: your_cen_owner_id
      instanceId: ${defaultNetworks.ids[0]}
      instanceType: VPC
      orderType: PayByCenOwner
variables:
  defaultNetworks:
    fn::invoke:
      Function: alicloud:vpc:getNetworks
      Arguments:
        nameRegex: default-NODELETING

Create TransitRouterGrantAttachment Resource

new TransitRouterGrantAttachment(name: string, args: TransitRouterGrantAttachmentArgs, opts?: CustomResourceOptions);
@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)
@overload
def TransitRouterGrantAttachment(resource_name: str,
                                 args: TransitRouterGrantAttachmentArgs,
                                 opts: Optional[ResourceOptions] = 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.

name string
The unique name of the resource.
args TransitRouterGrantAttachmentArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args 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 string
The unique name of the resource.
args TransitRouterGrantAttachmentArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args TransitRouterGrantAttachmentArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args TransitRouterGrantAttachmentArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

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

The TransitRouterGrantAttachment resource accepts the following input properties:

CenId string

The ID of the Cloud Enterprise Network (CEN) instance to which the transit router belongs.

CenOwnerId string

The ID of the Alibaba Cloud account to which the CEN instance belongs.

InstanceId string

The ID of the network instance.

InstanceType string

The type of the network instance. Valid values: VPC, ExpressConnect, VPN.

OrderType string

The entity that pays the fees of the network instance. Valid values: PayByResourceOwner, PayByCenOwner.

CenId string

The ID of the Cloud Enterprise Network (CEN) instance to which the transit router belongs.

CenOwnerId string

The ID of the Alibaba Cloud account to which the CEN instance belongs.

InstanceId string

The ID of the network instance.

InstanceType string

The type of the network instance. Valid values: VPC, ExpressConnect, VPN.

OrderType string

The entity that pays the fees of the network instance. Valid values: PayByResourceOwner, PayByCenOwner.

cenId String

The ID of the Cloud Enterprise Network (CEN) instance to which the transit router belongs.

cenOwnerId String

The ID of the Alibaba Cloud account to which the CEN instance belongs.

instanceId String

The ID of the network instance.

instanceType String

The type of the network instance. Valid values: VPC, ExpressConnect, VPN.

orderType String

The entity that pays the fees of the network instance. Valid values: PayByResourceOwner, PayByCenOwner.

cenId string

The ID of the Cloud Enterprise Network (CEN) instance to which the transit router belongs.

cenOwnerId string

The ID of the Alibaba Cloud account to which the CEN instance belongs.

instanceId string

The ID of the network instance.

instanceType string

The type of the network instance. Valid values: VPC, ExpressConnect, VPN.

orderType string

The entity that pays the fees of the network instance. Valid values: PayByResourceOwner, PayByCenOwner.

cen_id str

The ID of the Cloud Enterprise Network (CEN) instance to which the transit router belongs.

cen_owner_id str

The ID of the Alibaba Cloud account to which the CEN instance belongs.

instance_id str

The ID of the network instance.

instance_type str

The type of the network instance. Valid values: VPC, ExpressConnect, VPN.

order_type str

The entity that pays the fees of the network instance. Valid values: PayByResourceOwner, PayByCenOwner.

cenId String

The ID of the Cloud Enterprise Network (CEN) instance to which the transit router belongs.

cenOwnerId String

The ID of the Alibaba Cloud account to which the CEN instance belongs.

instanceId String

The ID of the network instance.

instanceType String

The type of the network instance. Valid values: VPC, ExpressConnect, VPN.

orderType 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)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
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
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
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
The unique name of the resulting resource.
id
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
The unique name of the resulting resource.
id
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 string

The ID of the Cloud Enterprise Network (CEN) instance to which the transit router belongs.

CenOwnerId string

The ID of the Alibaba Cloud account to which the CEN instance belongs.

InstanceId string

The ID of the network instance.

InstanceType string

The type of the network instance. Valid values: VPC, ExpressConnect, VPN.

OrderType string

The entity that pays the fees of the network instance. Valid values: PayByResourceOwner, PayByCenOwner.

CenId string

The ID of the Cloud Enterprise Network (CEN) instance to which the transit router belongs.

CenOwnerId string

The ID of the Alibaba Cloud account to which the CEN instance belongs.

InstanceId string

The ID of the network instance.

InstanceType string

The type of the network instance. Valid values: VPC, ExpressConnect, VPN.

OrderType string

The entity that pays the fees of the network instance. Valid values: PayByResourceOwner, PayByCenOwner.

cenId String

The ID of the Cloud Enterprise Network (CEN) instance to which the transit router belongs.

cenOwnerId String

The ID of the Alibaba Cloud account to which the CEN instance belongs.

instanceId String

The ID of the network instance.

instanceType String

The type of the network instance. Valid values: VPC, ExpressConnect, VPN.

orderType String

The entity that pays the fees of the network instance. Valid values: PayByResourceOwner, PayByCenOwner.

cenId string

The ID of the Cloud Enterprise Network (CEN) instance to which the transit router belongs.

cenOwnerId string

The ID of the Alibaba Cloud account to which the CEN instance belongs.

instanceId string

The ID of the network instance.

instanceType string

The type of the network instance. Valid values: VPC, ExpressConnect, VPN.

orderType string

The entity that pays the fees of the network instance. Valid values: PayByResourceOwner, PayByCenOwner.

cen_id str

The ID of the Cloud Enterprise Network (CEN) instance to which the transit router belongs.

cen_owner_id str

The ID of the Alibaba Cloud account to which the CEN instance belongs.

instance_id str

The ID of the network instance.

instance_type str

The type of the network instance. Valid values: VPC, ExpressConnect, VPN.

order_type str

The entity that pays the fees of the network instance. Valid values: PayByResourceOwner, PayByCenOwner.

cenId String

The ID of the Cloud Enterprise Network (CEN) instance to which the transit router belongs.

cenOwnerId String

The ID of the Alibaba Cloud account to which the CEN instance belongs.

instanceId String

The ID of the network instance.

instanceType String

The type of the network instance. Valid values: VPC, ExpressConnect, VPN.

orderType 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>

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.