Snapshot Args
Provides an ECS snapshot resource. For information about snapshot and how to use it, see Snapshot.
NOTE: Deprecated since v1.120.0. DEPRECATED: This resource has been renamed to alicloud.ecs.EcsSnapshot from version 1.120.0.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const snapshot = new alicloud.ecs.Snapshot("snapshot", {
diskId: instance_attachment.diskId,
name: "test-snapshot",
description: "this snapshot is created for testing",
tags: {
version: "1.2",
},
});
import pulumi
import pulumi_alicloud as alicloud
snapshot = alicloud.ecs.Snapshot("snapshot",
disk_id=instance_attachment["diskId"],
name="test-snapshot",
description="this snapshot is created for testing",
tags={
"version": "1.2",
})
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var snapshot = new AliCloud.Ecs.Snapshot("snapshot", new()
{
DiskId = instance_attachment.DiskId,
Name = "test-snapshot",
Description = "this snapshot is created for testing",
Tags =
{
{ "version", "1.2" },
},
});
});
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.NewSnapshot(ctx, "snapshot", &ecs.SnapshotArgs{
DiskId: pulumi.Any(instance_attachment.DiskId),
Name: pulumi.String("test-snapshot"),
Description: pulumi.String("this snapshot is created for testing"),
Tags: pulumi.StringMap{
"version": pulumi.String("1.2"),
},
})
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.Snapshot;
import com.pulumi.alicloud.ecs.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) {
var snapshot = new Snapshot("snapshot", SnapshotArgs.builder()
.diskId(instance_attachment.diskId())
.name("test-snapshot")
.description("this snapshot is created for testing")
.tags(Map.of("version", "1.2"))
.build());
}
}
resources:
snapshot:
type: alicloud:ecs:Snapshot
properties:
diskId: ${["instance-attachment"].diskId}
name: test-snapshot
description: this snapshot is created for testing
tags:
version: '1.2'
Import
Snapshot can be imported using the id, e.g.
$ pulumi import alicloud:ecs/snapshot:Snapshot snapshot s-abc1234567890000
Constructors
Properties
Description of the snapshot. This description can have a string of 2 to 256 characters, It cannot begin with http:// or https://. Default value is null.
The name of the snapshot to be created. The name must be 2 to 128 characters in length. It must start with a letter and cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), and hyphens (-). It cannot start with auto, because snapshot names starting with auto are recognized as automatic snapshots.
The ID of the resource group.