Class 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,
});
}
}
Inherited Members
Namespace: Pulumi.AliCloud.Ots
Assembly: Pulumi.AliCloud.dll
Syntax
public class InstanceAttachment : CustomResource
Constructors
View SourceInstanceAttachment(String, InstanceAttachmentArgs, CustomResourceOptions)
Create a InstanceAttachment resource with the given unique name, arguments, and options.
Declaration
public InstanceAttachment(string name, InstanceAttachmentArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| InstanceAttachmentArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceInstanceName
The name of the OTS instance.
Declaration
public Output<string> InstanceName { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
VpcId
The ID of attaching VPC to instance.
Declaration
public Output<string> VpcId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
VpcName
The name of attaching VPC to instance.
Declaration
public Output<string> VpcName { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
VswitchId
The ID of attaching VSwitch to instance.
Declaration
public Output<string> VswitchId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, InstanceAttachmentState, CustomResourceOptions)
Get an existing InstanceAttachment resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static InstanceAttachment Get(string name, Input<string> id, InstanceAttachmentState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| InstanceAttachmentState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| InstanceAttachment |