alicloud.ecs.EcsAutoSnapshotPolicyAttachment

Provides a ECS Auto Snapshot Policy Attachment resource.

For information about ECS Auto Snapshot Policy Attachment and how to use it, see What is Auto Snapshot Policy Attachment.

NOTE: Available in v1.122.0+.

Example Usage

Basic Usage

using System.Collections.Generic;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var example = new AliCloud.Ecs.EcsAutoSnapshotPolicyAttachment("example", new()
    {
        AutoSnapshotPolicyId = "s-ge465xxxx",
        DiskId = "d-gw835xxxx",
    });

});
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := ecs.NewEcsAutoSnapshotPolicyAttachment(ctx, "example", &ecs.EcsAutoSnapshotPolicyAttachmentArgs{
			AutoSnapshotPolicyId: pulumi.String("s-ge465xxxx"),
			DiskId:               pulumi.String("d-gw835xxxx"),
		})
		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.alicloud.ecs.EcsAutoSnapshotPolicyAttachment;
import com.pulumi.alicloud.ecs.EcsAutoSnapshotPolicyAttachmentArgs;
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 example = new EcsAutoSnapshotPolicyAttachment("example", EcsAutoSnapshotPolicyAttachmentArgs.builder()        
            .autoSnapshotPolicyId("s-ge465xxxx")
            .diskId("d-gw835xxxx")
            .build());

    }
}
import pulumi
import pulumi_alicloud as alicloud

example = alicloud.ecs.EcsAutoSnapshotPolicyAttachment("example",
    auto_snapshot_policy_id="s-ge465xxxx",
    disk_id="d-gw835xxxx")
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const example = new alicloud.ecs.EcsAutoSnapshotPolicyAttachment("example", {
    autoSnapshotPolicyId: "s-ge465xxxx",
    diskId: "d-gw835xxxx",
});
resources:
  example:
    type: alicloud:ecs:EcsAutoSnapshotPolicyAttachment
    properties:
      autoSnapshotPolicyId: s-ge465xxxx
      diskId: d-gw835xxxx

Create EcsAutoSnapshotPolicyAttachment Resource

new EcsAutoSnapshotPolicyAttachment(name: string, args: EcsAutoSnapshotPolicyAttachmentArgs, opts?: CustomResourceOptions);
@overload
def EcsAutoSnapshotPolicyAttachment(resource_name: str,
                                    opts: Optional[ResourceOptions] = None,
                                    auto_snapshot_policy_id: Optional[str] = None,
                                    disk_id: Optional[str] = None)
@overload
def EcsAutoSnapshotPolicyAttachment(resource_name: str,
                                    args: EcsAutoSnapshotPolicyAttachmentArgs,
                                    opts: Optional[ResourceOptions] = None)
func NewEcsAutoSnapshotPolicyAttachment(ctx *Context, name string, args EcsAutoSnapshotPolicyAttachmentArgs, opts ...ResourceOption) (*EcsAutoSnapshotPolicyAttachment, error)
public EcsAutoSnapshotPolicyAttachment(string name, EcsAutoSnapshotPolicyAttachmentArgs args, CustomResourceOptions? opts = null)
public EcsAutoSnapshotPolicyAttachment(String name, EcsAutoSnapshotPolicyAttachmentArgs args)
public EcsAutoSnapshotPolicyAttachment(String name, EcsAutoSnapshotPolicyAttachmentArgs args, CustomResourceOptions options)
type: alicloud:ecs:EcsAutoSnapshotPolicyAttachment
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args EcsAutoSnapshotPolicyAttachmentArgs
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 EcsAutoSnapshotPolicyAttachmentArgs
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 EcsAutoSnapshotPolicyAttachmentArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args EcsAutoSnapshotPolicyAttachmentArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args EcsAutoSnapshotPolicyAttachmentArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

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

AutoSnapshotPolicyId string

The auto snapshot policy id.

DiskId string

The disk id.

AutoSnapshotPolicyId string

The auto snapshot policy id.

DiskId string

The disk id.

autoSnapshotPolicyId String

The auto snapshot policy id.

diskId String

The disk id.

autoSnapshotPolicyId string

The auto snapshot policy id.

diskId string

The disk id.

auto_snapshot_policy_id str

The auto snapshot policy id.

disk_id str

The disk id.

autoSnapshotPolicyId String

The auto snapshot policy id.

diskId String

The disk id.

Outputs

All input properties are implicitly available as output properties. Additionally, the EcsAutoSnapshotPolicyAttachment 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 EcsAutoSnapshotPolicyAttachment Resource

Get an existing EcsAutoSnapshotPolicyAttachment 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?: EcsAutoSnapshotPolicyAttachmentState, opts?: CustomResourceOptions): EcsAutoSnapshotPolicyAttachment
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        auto_snapshot_policy_id: Optional[str] = None,
        disk_id: Optional[str] = None) -> EcsAutoSnapshotPolicyAttachment
func GetEcsAutoSnapshotPolicyAttachment(ctx *Context, name string, id IDInput, state *EcsAutoSnapshotPolicyAttachmentState, opts ...ResourceOption) (*EcsAutoSnapshotPolicyAttachment, error)
public static EcsAutoSnapshotPolicyAttachment Get(string name, Input<string> id, EcsAutoSnapshotPolicyAttachmentState? state, CustomResourceOptions? opts = null)
public static EcsAutoSnapshotPolicyAttachment get(String name, Output<String> id, EcsAutoSnapshotPolicyAttachmentState 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:
AutoSnapshotPolicyId string

The auto snapshot policy id.

DiskId string

The disk id.

AutoSnapshotPolicyId string

The auto snapshot policy id.

DiskId string

The disk id.

autoSnapshotPolicyId String

The auto snapshot policy id.

diskId String

The disk id.

autoSnapshotPolicyId string

The auto snapshot policy id.

diskId string

The disk id.

auto_snapshot_policy_id str

The auto snapshot policy id.

disk_id str

The disk id.

autoSnapshotPolicyId String

The auto snapshot policy id.

diskId String

The disk id.

Import

ECS Auto Snapshot Policy Attachment can be imported using the id, e.g.

 $ pulumi import alicloud:ecs/ecsAutoSnapshotPolicyAttachment:EcsAutoSnapshotPolicyAttachment example s-abcd12345:d-abcd12345

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.