1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. ens
  5. Snapshot
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

alicloud.ens.Snapshot

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

    Provides a ENS Snapshot resource. Snapshot. When you use it for the first time, please contact the product classmates to add a resource whitelist.

    For information about ENS Snapshot and how to use it, see What is Snapshot.

    NOTE: Available since v1.213.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "terraform-example";
    const disk = new alicloud.ens.Disk("disk", {
        category: "cloud_efficiency",
        size: 20,
        paymentType: "PayAsYouGo",
        ensRegionId: "ch-zurich-1",
    });
    const _default = new alicloud.ens.Snapshot("default", {
        description: name,
        ensRegionId: "ch-zurich-1",
        snapshotName: name,
        diskId: disk.id,
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "terraform-example"
    disk = alicloud.ens.Disk("disk",
        category="cloud_efficiency",
        size=20,
        payment_type="PayAsYouGo",
        ens_region_id="ch-zurich-1")
    default = alicloud.ens.Snapshot("default",
        description=name,
        ens_region_id="ch-zurich-1",
        snapshot_name=name,
        disk_id=disk.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ens"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		name := "terraform-example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		disk, err := ens.NewDisk(ctx, "disk", &ens.DiskArgs{
    			Category:    pulumi.String("cloud_efficiency"),
    			Size:        pulumi.Int(20),
    			PaymentType: pulumi.String("PayAsYouGo"),
    			EnsRegionId: pulumi.String("ch-zurich-1"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = ens.NewSnapshot(ctx, "default", &ens.SnapshotArgs{
    			Description:  pulumi.String(name),
    			EnsRegionId:  pulumi.String("ch-zurich-1"),
    			SnapshotName: pulumi.String(name),
    			DiskId:       disk.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var name = config.Get("name") ?? "terraform-example";
        var disk = new AliCloud.Ens.Disk("disk", new()
        {
            Category = "cloud_efficiency",
            Size = 20,
            PaymentType = "PayAsYouGo",
            EnsRegionId = "ch-zurich-1",
        });
    
        var @default = new AliCloud.Ens.Snapshot("default", new()
        {
            Description = name,
            EnsRegionId = "ch-zurich-1",
            SnapshotName = name,
            DiskId = disk.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.ens.Disk;
    import com.pulumi.alicloud.ens.DiskArgs;
    import com.pulumi.alicloud.ens.Snapshot;
    import com.pulumi.alicloud.ens.SnapshotArgs;
    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) {
            final var config = ctx.config();
            final var name = config.get("name").orElse("terraform-example");
            var disk = new Disk("disk", DiskArgs.builder()
                .category("cloud_efficiency")
                .size("20")
                .paymentType("PayAsYouGo")
                .ensRegionId("ch-zurich-1")
                .build());
    
            var default_ = new Snapshot("default", SnapshotArgs.builder()
                .description(name)
                .ensRegionId("ch-zurich-1")
                .snapshotName(name)
                .diskId(disk.id())
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: terraform-example
    resources:
      disk:
        type: alicloud:ens:Disk
        properties:
          category: cloud_efficiency
          size: '20'
          paymentType: PayAsYouGo
          ensRegionId: ch-zurich-1
      default:
        type: alicloud:ens:Snapshot
        properties:
          description: ${name}
          ensRegionId: ch-zurich-1
          snapshotName: ${name}
          diskId: ${disk.id}
    

    Create Snapshot Resource

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

    Constructor syntax

    new Snapshot(name: string, args: SnapshotArgs, opts?: CustomResourceOptions);
    @overload
    def Snapshot(resource_name: str,
                 args: SnapshotArgs,
                 opts: Optional[ResourceOptions] = None)
    
    @overload
    def Snapshot(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 disk_id: Optional[str] = None,
                 ens_region_id: Optional[str] = None,
                 description: Optional[str] = None,
                 snapshot_name: Optional[str] = None)
    func NewSnapshot(ctx *Context, name string, args SnapshotArgs, opts ...ResourceOption) (*Snapshot, error)
    public Snapshot(string name, SnapshotArgs args, CustomResourceOptions? opts = null)
    public Snapshot(String name, SnapshotArgs args)
    public Snapshot(String name, SnapshotArgs args, CustomResourceOptions options)
    
    type: alicloud:ens:Snapshot
    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 SnapshotArgs
    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 SnapshotArgs
    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 SnapshotArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SnapshotArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SnapshotArgs
    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 examplesnapshotResourceResourceFromEnssnapshot = new AliCloud.Ens.Snapshot("examplesnapshotResourceResourceFromEnssnapshot", new()
    {
        DiskId = "string",
        EnsRegionId = "string",
        Description = "string",
        SnapshotName = "string",
    });
    
    example, err := ens.NewSnapshot(ctx, "examplesnapshotResourceResourceFromEnssnapshot", &ens.SnapshotArgs{
    	DiskId:       pulumi.String("string"),
    	EnsRegionId:  pulumi.String("string"),
    	Description:  pulumi.String("string"),
    	SnapshotName: pulumi.String("string"),
    })
    
    var examplesnapshotResourceResourceFromEnssnapshot = new Snapshot("examplesnapshotResourceResourceFromEnssnapshot", SnapshotArgs.builder()
        .diskId("string")
        .ensRegionId("string")
        .description("string")
        .snapshotName("string")
        .build());
    
    examplesnapshot_resource_resource_from_enssnapshot = alicloud.ens.Snapshot("examplesnapshotResourceResourceFromEnssnapshot",
        disk_id="string",
        ens_region_id="string",
        description="string",
        snapshot_name="string")
    
    const examplesnapshotResourceResourceFromEnssnapshot = new alicloud.ens.Snapshot("examplesnapshotResourceResourceFromEnssnapshot", {
        diskId: "string",
        ensRegionId: "string",
        description: "string",
        snapshotName: "string",
    });
    
    type: alicloud:ens:Snapshot
    properties:
        description: string
        diskId: string
        ensRegionId: string
        snapshotName: string
    

    Snapshot Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The Snapshot resource accepts the following input properties:

    DiskId string
    Cloud Disk ID.
    EnsRegionId string
    The node ID of ENS.
    Description string
    Snapshot Description Information.
    SnapshotName string
    Name of the snapshot instance.
    DiskId string
    Cloud Disk ID.
    EnsRegionId string
    The node ID of ENS.
    Description string
    Snapshot Description Information.
    SnapshotName string
    Name of the snapshot instance.
    diskId String
    Cloud Disk ID.
    ensRegionId String
    The node ID of ENS.
    description String
    Snapshot Description Information.
    snapshotName String
    Name of the snapshot instance.
    diskId string
    Cloud Disk ID.
    ensRegionId string
    The node ID of ENS.
    description string
    Snapshot Description Information.
    snapshotName string
    Name of the snapshot instance.
    disk_id str
    Cloud Disk ID.
    ens_region_id str
    The node ID of ENS.
    description str
    Snapshot Description Information.
    snapshot_name str
    Name of the snapshot instance.
    diskId String
    Cloud Disk ID.
    ensRegionId String
    The node ID of ENS.
    description String
    Snapshot Description Information.
    snapshotName String
    Name of the snapshot instance.

    Outputs

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

    CreateTime string
    Instance creation timeIt is expressed in accordance with the ISO8601 standard and uses UTC +0 time in the format of yyyy-MM-ddTHH:mm:ssZ.Example value: 2020-08-20 T14:52:28Z.
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    Snapshot Status. Valid values: creating, available, deleting, error.
    CreateTime string
    Instance creation timeIt is expressed in accordance with the ISO8601 standard and uses UTC +0 time in the format of yyyy-MM-ddTHH:mm:ssZ.Example value: 2020-08-20 T14:52:28Z.
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    Snapshot Status. Valid values: creating, available, deleting, error.
    createTime String
    Instance creation timeIt is expressed in accordance with the ISO8601 standard and uses UTC +0 time in the format of yyyy-MM-ddTHH:mm:ssZ.Example value: 2020-08-20 T14:52:28Z.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    Snapshot Status. Valid values: creating, available, deleting, error.
    createTime string
    Instance creation timeIt is expressed in accordance with the ISO8601 standard and uses UTC +0 time in the format of yyyy-MM-ddTHH:mm:ssZ.Example value: 2020-08-20 T14:52:28Z.
    id string
    The provider-assigned unique ID for this managed resource.
    status string
    Snapshot Status. Valid values: creating, available, deleting, error.
    create_time str
    Instance creation timeIt is expressed in accordance with the ISO8601 standard and uses UTC +0 time in the format of yyyy-MM-ddTHH:mm:ssZ.Example value: 2020-08-20 T14:52:28Z.
    id str
    The provider-assigned unique ID for this managed resource.
    status str
    Snapshot Status. Valid values: creating, available, deleting, error.
    createTime String
    Instance creation timeIt is expressed in accordance with the ISO8601 standard and uses UTC +0 time in the format of yyyy-MM-ddTHH:mm:ssZ.Example value: 2020-08-20 T14:52:28Z.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    Snapshot Status. Valid values: creating, available, deleting, error.

    Look up Existing Snapshot Resource

    Get an existing Snapshot 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?: SnapshotState, opts?: CustomResourceOptions): Snapshot
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            create_time: Optional[str] = None,
            description: Optional[str] = None,
            disk_id: Optional[str] = None,
            ens_region_id: Optional[str] = None,
            snapshot_name: Optional[str] = None,
            status: Optional[str] = None) -> Snapshot
    func GetSnapshot(ctx *Context, name string, id IDInput, state *SnapshotState, opts ...ResourceOption) (*Snapshot, error)
    public static Snapshot Get(string name, Input<string> id, SnapshotState? state, CustomResourceOptions? opts = null)
    public static Snapshot get(String name, Output<String> id, SnapshotState 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:
    CreateTime string
    Instance creation timeIt is expressed in accordance with the ISO8601 standard and uses UTC +0 time in the format of yyyy-MM-ddTHH:mm:ssZ.Example value: 2020-08-20 T14:52:28Z.
    Description string
    Snapshot Description Information.
    DiskId string
    Cloud Disk ID.
    EnsRegionId string
    The node ID of ENS.
    SnapshotName string
    Name of the snapshot instance.
    Status string
    Snapshot Status. Valid values: creating, available, deleting, error.
    CreateTime string
    Instance creation timeIt is expressed in accordance with the ISO8601 standard and uses UTC +0 time in the format of yyyy-MM-ddTHH:mm:ssZ.Example value: 2020-08-20 T14:52:28Z.
    Description string
    Snapshot Description Information.
    DiskId string
    Cloud Disk ID.
    EnsRegionId string
    The node ID of ENS.
    SnapshotName string
    Name of the snapshot instance.
    Status string
    Snapshot Status. Valid values: creating, available, deleting, error.
    createTime String
    Instance creation timeIt is expressed in accordance with the ISO8601 standard and uses UTC +0 time in the format of yyyy-MM-ddTHH:mm:ssZ.Example value: 2020-08-20 T14:52:28Z.
    description String
    Snapshot Description Information.
    diskId String
    Cloud Disk ID.
    ensRegionId String
    The node ID of ENS.
    snapshotName String
    Name of the snapshot instance.
    status String
    Snapshot Status. Valid values: creating, available, deleting, error.
    createTime string
    Instance creation timeIt is expressed in accordance with the ISO8601 standard and uses UTC +0 time in the format of yyyy-MM-ddTHH:mm:ssZ.Example value: 2020-08-20 T14:52:28Z.
    description string
    Snapshot Description Information.
    diskId string
    Cloud Disk ID.
    ensRegionId string
    The node ID of ENS.
    snapshotName string
    Name of the snapshot instance.
    status string
    Snapshot Status. Valid values: creating, available, deleting, error.
    create_time str
    Instance creation timeIt is expressed in accordance with the ISO8601 standard and uses UTC +0 time in the format of yyyy-MM-ddTHH:mm:ssZ.Example value: 2020-08-20 T14:52:28Z.
    description str
    Snapshot Description Information.
    disk_id str
    Cloud Disk ID.
    ens_region_id str
    The node ID of ENS.
    snapshot_name str
    Name of the snapshot instance.
    status str
    Snapshot Status. Valid values: creating, available, deleting, error.
    createTime String
    Instance creation timeIt is expressed in accordance with the ISO8601 standard and uses UTC +0 time in the format of yyyy-MM-ddTHH:mm:ssZ.Example value: 2020-08-20 T14:52:28Z.
    description String
    Snapshot Description Information.
    diskId String
    Cloud Disk ID.
    ensRegionId String
    The node ID of ENS.
    snapshotName String
    Name of the snapshot instance.
    status String
    Snapshot Status. Valid values: creating, available, deleting, error.

    Import

    ENS Snapshot can be imported using the id, e.g.

    $ pulumi import alicloud:ens/snapshot:Snapshot example <id>
    

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

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi