1. Packages
  2. Volcengine
  3. API Docs
  4. cen
  5. AttachInstance
Volcengine v0.0.26 published on Friday, Sep 13, 2024 by Volcengine

volcengine.cen.AttachInstance

Explore with Pulumi AI

volcengine logo
Volcengine v0.0.26 published on Friday, Sep 13, 2024 by Volcengine

    Provides a resource to manage cen attach instance

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Volcengine = Pulumi.Volcengine;
    
    return await Deployment.RunAsync(() => 
    {
        var fooVpc = new Volcengine.Vpc.Vpc("fooVpc", new()
        {
            VpcName = "acc-test-vpc",
            CidrBlock = "172.16.0.0/16",
        });
    
        var fooCen = new Volcengine.Cen.Cen("fooCen", new()
        {
            CenName = "acc-test-cen",
            Description = "acc-test",
            ProjectName = "default",
            Tags = new[]
            {
                new Volcengine.Cen.Inputs.CenTagArgs
                {
                    Key = "k1",
                    Value = "v1",
                },
            },
        });
    
        var fooAttachInstance = new Volcengine.Cen.AttachInstance("fooAttachInstance", new()
        {
            CenId = fooCen.Id,
            InstanceId = fooVpc.Id,
            InstanceRegionId = "cn-beijing",
            InstanceType = "VPC",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/cen"
    	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/vpc"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		fooVpc, err := vpc.NewVpc(ctx, "fooVpc", &vpc.VpcArgs{
    			VpcName:   pulumi.String("acc-test-vpc"),
    			CidrBlock: pulumi.String("172.16.0.0/16"),
    		})
    		if err != nil {
    			return err
    		}
    		fooCen, err := cen.NewCen(ctx, "fooCen", &cen.CenArgs{
    			CenName:     pulumi.String("acc-test-cen"),
    			Description: pulumi.String("acc-test"),
    			ProjectName: pulumi.String("default"),
    			Tags: cen.CenTagArray{
    				&cen.CenTagArgs{
    					Key:   pulumi.String("k1"),
    					Value: pulumi.String("v1"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = cen.NewAttachInstance(ctx, "fooAttachInstance", &cen.AttachInstanceArgs{
    			CenId:            fooCen.ID(),
    			InstanceId:       fooVpc.ID(),
    			InstanceRegionId: pulumi.String("cn-beijing"),
    			InstanceType:     pulumi.String("VPC"),
    		})
    		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.volcengine.vpc.Vpc;
    import com.pulumi.volcengine.vpc.VpcArgs;
    import com.pulumi.volcengine.cen.Cen;
    import com.pulumi.volcengine.cen.CenArgs;
    import com.pulumi.volcengine.cen.inputs.CenTagArgs;
    import com.pulumi.volcengine.cen.AttachInstance;
    import com.pulumi.volcengine.cen.AttachInstanceArgs;
    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) {
            var fooVpc = new Vpc("fooVpc", VpcArgs.builder()        
                .vpcName("acc-test-vpc")
                .cidrBlock("172.16.0.0/16")
                .build());
    
            var fooCen = new Cen("fooCen", CenArgs.builder()        
                .cenName("acc-test-cen")
                .description("acc-test")
                .projectName("default")
                .tags(CenTagArgs.builder()
                    .key("k1")
                    .value("v1")
                    .build())
                .build());
    
            var fooAttachInstance = new AttachInstance("fooAttachInstance", AttachInstanceArgs.builder()        
                .cenId(fooCen.id())
                .instanceId(fooVpc.id())
                .instanceRegionId("cn-beijing")
                .instanceType("VPC")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_volcengine as volcengine
    
    foo_vpc = volcengine.vpc.Vpc("fooVpc",
        vpc_name="acc-test-vpc",
        cidr_block="172.16.0.0/16")
    foo_cen = volcengine.cen.Cen("fooCen",
        cen_name="acc-test-cen",
        description="acc-test",
        project_name="default",
        tags=[volcengine.cen.CenTagArgs(
            key="k1",
            value="v1",
        )])
    foo_attach_instance = volcengine.cen.AttachInstance("fooAttachInstance",
        cen_id=foo_cen.id,
        instance_id=foo_vpc.id,
        instance_region_id="cn-beijing",
        instance_type="VPC")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as volcengine from "@volcengine/pulumi";
    
    const fooVpc = new volcengine.vpc.Vpc("fooVpc", {
        vpcName: "acc-test-vpc",
        cidrBlock: "172.16.0.0/16",
    });
    const fooCen = new volcengine.cen.Cen("fooCen", {
        cenName: "acc-test-cen",
        description: "acc-test",
        projectName: "default",
        tags: [{
            key: "k1",
            value: "v1",
        }],
    });
    const fooAttachInstance = new volcengine.cen.AttachInstance("fooAttachInstance", {
        cenId: fooCen.id,
        instanceId: fooVpc.id,
        instanceRegionId: "cn-beijing",
        instanceType: "VPC",
    });
    
    resources:
      fooVpc:
        type: volcengine:vpc:Vpc
        properties:
          vpcName: acc-test-vpc
          cidrBlock: 172.16.0.0/16
      fooCen:
        type: volcengine:cen:Cen
        properties:
          cenName: acc-test-cen
          description: acc-test
          projectName: default
          tags:
            - key: k1
              value: v1
      fooAttachInstance:
        type: volcengine:cen:AttachInstance
        properties:
          cenId: ${fooCen.id}
          instanceId: ${fooVpc.id}
          instanceRegionId: cn-beijing
          instanceType: VPC
    

    Create AttachInstance Resource

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

    Constructor syntax

    new AttachInstance(name: string, args: AttachInstanceArgs, opts?: CustomResourceOptions);
    @overload
    def AttachInstance(resource_name: str,
                       args: AttachInstanceArgs,
                       opts: Optional[ResourceOptions] = None)
    
    @overload
    def AttachInstance(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       cen_id: Optional[str] = None,
                       instance_id: Optional[str] = None,
                       instance_region_id: Optional[str] = None,
                       instance_type: Optional[str] = None,
                       instance_owner_id: Optional[str] = None)
    func NewAttachInstance(ctx *Context, name string, args AttachInstanceArgs, opts ...ResourceOption) (*AttachInstance, error)
    public AttachInstance(string name, AttachInstanceArgs args, CustomResourceOptions? opts = null)
    public AttachInstance(String name, AttachInstanceArgs args)
    public AttachInstance(String name, AttachInstanceArgs args, CustomResourceOptions options)
    
    type: volcengine:cen:AttachInstance
    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 AttachInstanceArgs
    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 AttachInstanceArgs
    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 AttachInstanceArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AttachInstanceArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AttachInstanceArgs
    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 attachInstanceResource = new Volcengine.Cen.AttachInstance("attachInstanceResource", new()
    {
        CenId = "string",
        InstanceId = "string",
        InstanceRegionId = "string",
        InstanceType = "string",
        InstanceOwnerId = "string",
    });
    
    example, err := cen.NewAttachInstance(ctx, "attachInstanceResource", &cen.AttachInstanceArgs{
    	CenId:            pulumi.String("string"),
    	InstanceId:       pulumi.String("string"),
    	InstanceRegionId: pulumi.String("string"),
    	InstanceType:     pulumi.String("string"),
    	InstanceOwnerId:  pulumi.String("string"),
    })
    
    var attachInstanceResource = new AttachInstance("attachInstanceResource", AttachInstanceArgs.builder()
        .cenId("string")
        .instanceId("string")
        .instanceRegionId("string")
        .instanceType("string")
        .instanceOwnerId("string")
        .build());
    
    attach_instance_resource = volcengine.cen.AttachInstance("attachInstanceResource",
        cen_id="string",
        instance_id="string",
        instance_region_id="string",
        instance_type="string",
        instance_owner_id="string")
    
    const attachInstanceResource = new volcengine.cen.AttachInstance("attachInstanceResource", {
        cenId: "string",
        instanceId: "string",
        instanceRegionId: "string",
        instanceType: "string",
        instanceOwnerId: "string",
    });
    
    type: volcengine:cen:AttachInstance
    properties:
        cenId: string
        instanceId: string
        instanceOwnerId: string
        instanceRegionId: string
        instanceType: string
    

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

    CenId string
    The ID of the cen.
    InstanceId string
    The ID of the instance.
    InstanceRegionId string
    The region ID of the instance.
    InstanceType string
    The type of the instance. Valid values: VPC, DCGW.
    InstanceOwnerId string
    The owner ID of the instance.
    CenId string
    The ID of the cen.
    InstanceId string
    The ID of the instance.
    InstanceRegionId string
    The region ID of the instance.
    InstanceType string
    The type of the instance. Valid values: VPC, DCGW.
    InstanceOwnerId string
    The owner ID of the instance.
    cenId String
    The ID of the cen.
    instanceId String
    The ID of the instance.
    instanceRegionId String
    The region ID of the instance.
    instanceType String
    The type of the instance. Valid values: VPC, DCGW.
    instanceOwnerId String
    The owner ID of the instance.
    cenId string
    The ID of the cen.
    instanceId string
    The ID of the instance.
    instanceRegionId string
    The region ID of the instance.
    instanceType string
    The type of the instance. Valid values: VPC, DCGW.
    instanceOwnerId string
    The owner ID of the instance.
    cen_id str
    The ID of the cen.
    instance_id str
    The ID of the instance.
    instance_region_id str
    The region ID of the instance.
    instance_type str
    The type of the instance. Valid values: VPC, DCGW.
    instance_owner_id str
    The owner ID of the instance.
    cenId String
    The ID of the cen.
    instanceId String
    The ID of the instance.
    instanceRegionId String
    The region ID of the instance.
    instanceType String
    The type of the instance. Valid values: VPC, DCGW.
    instanceOwnerId String
    The owner ID of the instance.

    Outputs

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

    CreationTime string
    The create time of the cen attaching instance.
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of the cen attaching instance.
    CreationTime string
    The create time of the cen attaching instance.
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of the cen attaching instance.
    creationTime String
    The create time of the cen attaching instance.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of the cen attaching instance.
    creationTime string
    The create time of the cen attaching instance.
    id string
    The provider-assigned unique ID for this managed resource.
    status string
    The status of the cen attaching instance.
    creation_time str
    The create time of the cen attaching instance.
    id str
    The provider-assigned unique ID for this managed resource.
    status str
    The status of the cen attaching instance.
    creationTime String
    The create time of the cen attaching instance.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of the cen attaching instance.

    Look up Existing AttachInstance Resource

    Get an existing AttachInstance 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?: AttachInstanceState, opts?: CustomResourceOptions): AttachInstance
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            cen_id: Optional[str] = None,
            creation_time: Optional[str] = None,
            instance_id: Optional[str] = None,
            instance_owner_id: Optional[str] = None,
            instance_region_id: Optional[str] = None,
            instance_type: Optional[str] = None,
            status: Optional[str] = None) -> AttachInstance
    func GetAttachInstance(ctx *Context, name string, id IDInput, state *AttachInstanceState, opts ...ResourceOption) (*AttachInstance, error)
    public static AttachInstance Get(string name, Input<string> id, AttachInstanceState? state, CustomResourceOptions? opts = null)
    public static AttachInstance get(String name, Output<String> id, AttachInstanceState 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 cen.
    CreationTime string
    The create time of the cen attaching instance.
    InstanceId string
    The ID of the instance.
    InstanceOwnerId string
    The owner ID of the instance.
    InstanceRegionId string
    The region ID of the instance.
    InstanceType string
    The type of the instance. Valid values: VPC, DCGW.
    Status string
    The status of the cen attaching instance.
    CenId string
    The ID of the cen.
    CreationTime string
    The create time of the cen attaching instance.
    InstanceId string
    The ID of the instance.
    InstanceOwnerId string
    The owner ID of the instance.
    InstanceRegionId string
    The region ID of the instance.
    InstanceType string
    The type of the instance. Valid values: VPC, DCGW.
    Status string
    The status of the cen attaching instance.
    cenId String
    The ID of the cen.
    creationTime String
    The create time of the cen attaching instance.
    instanceId String
    The ID of the instance.
    instanceOwnerId String
    The owner ID of the instance.
    instanceRegionId String
    The region ID of the instance.
    instanceType String
    The type of the instance. Valid values: VPC, DCGW.
    status String
    The status of the cen attaching instance.
    cenId string
    The ID of the cen.
    creationTime string
    The create time of the cen attaching instance.
    instanceId string
    The ID of the instance.
    instanceOwnerId string
    The owner ID of the instance.
    instanceRegionId string
    The region ID of the instance.
    instanceType string
    The type of the instance. Valid values: VPC, DCGW.
    status string
    The status of the cen attaching instance.
    cen_id str
    The ID of the cen.
    creation_time str
    The create time of the cen attaching instance.
    instance_id str
    The ID of the instance.
    instance_owner_id str
    The owner ID of the instance.
    instance_region_id str
    The region ID of the instance.
    instance_type str
    The type of the instance. Valid values: VPC, DCGW.
    status str
    The status of the cen attaching instance.
    cenId String
    The ID of the cen.
    creationTime String
    The create time of the cen attaching instance.
    instanceId String
    The ID of the instance.
    instanceOwnerId String
    The owner ID of the instance.
    instanceRegionId String
    The region ID of the instance.
    instanceType String
    The type of the instance. Valid values: VPC, DCGW.
    status String
    The status of the cen attaching instance.

    Import

    Cen attach instance can be imported using the CenId:InstanceId:InstanceType:RegionId, e.g.

     $ pulumi import volcengine:cen/attachInstance:AttachInstance default cen-7qthudw0ll6jmc***:vpc-2fexiqjlgjif45oxruvso****:VPC:cn-beijing
    

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

    Package Details

    Repository
    volcengine volcengine/pulumi-volcengine
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the volcengine Terraform Provider.
    volcengine logo
    Volcengine v0.0.26 published on Friday, Sep 13, 2024 by Volcengine