InstanceAttachment
This resource will help you to bind a VPC to an OTS instance.
Example Usage
using Pulumi;
using AliCloud = Pulumi.AliCloud;
class MyStack : Stack
{
public MyStack()
{
// Create an OTS instance
var fooInstance = new AliCloud.Ots.Instance("fooInstance", new AliCloud.Ots.InstanceArgs
{
AccessedBy = "Vpc",
Description = "for table",
Tags =
{
{ "Created", "TF" },
{ "For", "Building table" },
},
});
var fooZones = Output.Create(AliCloud.GetZones.InvokeAsync(new AliCloud.GetZonesArgs
{
AvailableResourceCreation = "VSwitch",
}));
var fooNetwork = new AliCloud.Vpc.Network("fooNetwork", new AliCloud.Vpc.NetworkArgs
{
CidrBlock = "172.16.0.0/16",
});
var fooSwitch = new AliCloud.Vpc.Switch("fooSwitch", new AliCloud.Vpc.SwitchArgs
{
AvailabilityZone = fooZones.Apply(fooZones => fooZones.Zones[0].Id),
CidrBlock = "172.16.1.0/24",
VpcId = fooNetwork.Id,
});
var fooInstanceAttachment = new AliCloud.Ots.InstanceAttachment("fooInstanceAttachment", new AliCloud.Ots.InstanceAttachmentArgs
{
InstanceName = fooInstance.Name,
VpcName = "attachment1",
VswitchId = fooSwitch.Id,
});
}
}
Coming soon!
import pulumi
import pulumi_alicloud as alicloud
# Create an OTS instance
foo_instance = alicloud.ots.Instance("fooInstance",
accessed_by="Vpc",
description="for table",
tags={
"Created": "TF",
"For": "Building table",
})
foo_zones = alicloud.get_zones(available_resource_creation="VSwitch")
foo_network = alicloud.vpc.Network("fooNetwork", cidr_block="172.16.0.0/16")
foo_switch = alicloud.vpc.Switch("fooSwitch",
availability_zone=foo_zones.zones[0]["id"],
cidr_block="172.16.1.0/24",
vpc_id=foo_network.id)
foo_instance_attachment = alicloud.ots.InstanceAttachment("fooInstanceAttachment",
instance_name=foo_instance.name,
vpc_name="attachment1",
vswitch_id=foo_switch.id)import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
// Create an OTS instance
const fooInstance = new alicloud.ots.Instance("foo", {
accessedBy: "Vpc",
description: "for table",
tags: {
Created: "TF",
For: "Building table",
},
});
const fooZones = pulumi.output(alicloud.getZones({
availableResourceCreation: "VSwitch",
}, { async: true }));
const fooNetwork = new alicloud.vpc.Network("foo", {
cidrBlock: "172.16.0.0/16",
});
const fooSwitch = new alicloud.vpc.Switch("foo", {
availabilityZone: fooZones.zones[0].id,
cidrBlock: "172.16.1.0/24",
vpcId: fooNetwork.id,
});
const fooInstanceAttachment = new alicloud.ots.InstanceAttachment("foo", {
instanceName: fooInstance.name,
vpcName: "attachment1",
vswitchId: fooSwitch.id,
});Create a InstanceAttachment Resource
new InstanceAttachment(name: string, args: InstanceAttachmentArgs, opts?: CustomResourceOptions);def InstanceAttachment(resource_name, opts=None, instance_name=None, vpc_name=None, vswitch_id=None, __props__=None);func NewInstanceAttachment(ctx *Context, name string, args InstanceAttachmentArgs, opts ...ResourceOption) (*InstanceAttachment, error)public InstanceAttachment(string name, InstanceAttachmentArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args InstanceAttachmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args InstanceAttachmentArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args InstanceAttachmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
InstanceAttachment Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The InstanceAttachment resource accepts the following input properties:
- instance_
name str The name of the OTS instance.
- vpc_
name str The name of attaching VPC to instance.
- vswitch_
id str The ID of attaching VSwitch to instance.
Outputs
All input properties are implicitly available as output properties. Additionally, the InstanceAttachment resource produces the following output properties:
Look up an Existing InstanceAttachment Resource
Get an existing InstanceAttachment 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?: InstanceAttachmentState, opts?: CustomResourceOptions): InstanceAttachmentstatic get(resource_name, id, opts=None, instance_name=None, vpc_id=None, vpc_name=None, vswitch_id=None, __props__=None);func GetInstanceAttachment(ctx *Context, name string, id IDInput, state *InstanceAttachmentState, opts ...ResourceOption) (*InstanceAttachment, error)public static InstanceAttachment Get(string name, Input<string> id, InstanceAttachmentState? state, CustomResourceOptions? opts = null)- 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.
The following state arguments are supported:
- instance_
name str The name of the OTS instance.
- vpc_
id str The ID of attaching VPC to instance.
- vpc_
name str The name of attaching VPC to instance.
- vswitch_
id str The ID of attaching VSwitch to instance.
Package Details
- Repository
- https://github.com/pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloudTerraform Provider.