Class InstanceGrant
Provides a CEN child instance grant resource, which allow you to authorize a VPC or VBR to a CEN of a different account.
For more information about how to use it, see Attach a network in a different account.
Example Usage
using Pulumi;
using AliCloud = Pulumi.AliCloud;
class MyStack : Stack
{
public MyStack()
{
// Create a new instance-grant and use it to grant one child instance of account1 to a new CEN of account 2.
var account1 = new AliCloud.Provider("account1", new AliCloud.ProviderArgs
{
AccessKey = "access123",
SecretKey = "secret123",
});
var account2 = new AliCloud.Provider("account2", new AliCloud.ProviderArgs
{
AccessKey = "access456",
SecretKey = "secret456",
});
var config = new Config();
var name = config.Get("name") ?? "tf-testAccCenInstanceGrantBasic";
var cen = new AliCloud.Cen.Instance("cen", new AliCloud.Cen.InstanceArgs
{
});
var vpc = new AliCloud.Vpc.Network("vpc", new AliCloud.Vpc.NetworkArgs
{
CidrBlock = "192.168.0.0/16",
});
var fooInstanceGrant = new AliCloud.Cen.InstanceGrant("fooInstanceGrant", new AliCloud.Cen.InstanceGrantArgs
{
CenId = cen.Id,
CenOwnerId = "uid2",
ChildInstanceId = vpc.Id,
});
var fooInstanceAttachment = new AliCloud.Cen.InstanceAttachment("fooInstanceAttachment", new AliCloud.Cen.InstanceAttachmentArgs
{
ChildInstanceId = vpc.Id,
ChildInstanceOwnerId = "uid1",
ChildInstanceRegionId = "cn-qingdao",
InstanceId = cen.Id,
});
}
}
Inherited Members
Namespace: Pulumi.AliCloud.Cen
Assembly: Pulumi.AliCloud.dll
Syntax
public class InstanceGrant : CustomResource
Constructors
View SourceInstanceGrant(String, InstanceGrantArgs, CustomResourceOptions)
Create a InstanceGrant resource with the given unique name, arguments, and options.
Declaration
public InstanceGrant(string name, InstanceGrantArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| InstanceGrantArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceCenId
The ID of the CEN.
Declaration
public Output<string> CenId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
CenOwnerId
The owner UID of the CEN which the child instance granted to.
Declaration
public Output<string> CenOwnerId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ChildInstanceId
The ID of the child instance to grant.
Declaration
public Output<string> ChildInstanceId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, InstanceGrantState, CustomResourceOptions)
Get an existing InstanceGrant resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static InstanceGrant Get(string name, Input<string> id, InstanceGrantState 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. |
| InstanceGrantState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| InstanceGrant |