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

alicloud.cen.TransitRouterGrantAttachment

Explore with Pulumi AI

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

    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",
    });
    
    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")
    
    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, nil, 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
    	})
    }
    
    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",
        });
    
    });
    
    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());
    
        }
    }
    
    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: {}
    

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

    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",
    });
    
    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"),
    })
    
    var transitRouterGrantAttachmentResource = new TransitRouterGrantAttachment("transitRouterGrantAttachmentResource", TransitRouterGrantAttachmentArgs.builder()
        .cenId("string")
        .cenOwnerId("string")
        .instanceId("string")
        .instanceType("string")
        .orderType("string")
        .build());
    
    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")
    
    const transitRouterGrantAttachmentResource = new alicloud.cen.TransitRouterGrantAttachment("transitRouterGrantAttachmentResource", {
        cenId: "string",
        cenOwnerId: "string",
        instanceId: "string",
        instanceType: "string",
        orderType: "string",
    });
    
    type: alicloud:cen:TransitRouterGrantAttachment
    properties:
        cenId: string
        cenOwnerId: string
        instanceId: string
        instanceType: string
        orderType: string
    

    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>
    

    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.
    alicloud logo
    Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi