yandex.ComputeSnapshot
Explore with Pulumi AI
Creates a new snapshot of a disk. For more information, see the official documentation.
Example Usage
using Pulumi;
using Yandex = Pulumi.Yandex;
class MyStack : Stack
{
    public MyStack()
    {
        var @default = new Yandex.ComputeSnapshot("default", new Yandex.ComputeSnapshotArgs
        {
            Labels = 
            {
                { "my-label", "my-label-value" },
            },
            SourceDiskId = "test_disk_id",
        });
    }
}
package main
import (
	"github.com/pulumi/pulumi-yandex/sdk/go/yandex"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := yandex.NewComputeSnapshot(ctx, "default", &yandex.ComputeSnapshotArgs{
			Labels: pulumi.StringMap{
				"my-label": pulumi.String("my-label-value"),
			},
			SourceDiskId: pulumi.String("test_disk_id"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Coming soon!
import * as pulumi from "@pulumi/pulumi";
import * as yandex from "@pulumi/yandex";
const defaultComputeSnapshot = new yandex.ComputeSnapshot("default", {
    labels: {
        "my-label": "my-label-value",
    },
    sourceDiskId: "test_disk_id",
});
import pulumi
import pulumi_yandex as yandex
default = yandex.ComputeSnapshot("default",
    labels={
        "my-label": "my-label-value",
    },
    source_disk_id="test_disk_id")
Coming soon!
Create ComputeSnapshot Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ComputeSnapshot(name: string, args: ComputeSnapshotArgs, opts?: CustomResourceOptions);@overload
def ComputeSnapshot(resource_name: str,
                    args: ComputeSnapshotArgs,
                    opts: Optional[ResourceOptions] = None)
@overload
def ComputeSnapshot(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    source_disk_id: Optional[str] = None,
                    description: Optional[str] = None,
                    folder_id: Optional[str] = None,
                    labels: Optional[Mapping[str, str]] = None,
                    name: Optional[str] = None)func NewComputeSnapshot(ctx *Context, name string, args ComputeSnapshotArgs, opts ...ResourceOption) (*ComputeSnapshot, error)public ComputeSnapshot(string name, ComputeSnapshotArgs args, CustomResourceOptions? opts = null)
public ComputeSnapshot(String name, ComputeSnapshotArgs args)
public ComputeSnapshot(String name, ComputeSnapshotArgs args, CustomResourceOptions options)
type: yandex:ComputeSnapshot
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 ComputeSnapshotArgs
- 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 ComputeSnapshotArgs
- 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 ComputeSnapshotArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ComputeSnapshotArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ComputeSnapshotArgs
- 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 computeSnapshotResource = new Yandex.ComputeSnapshot("computeSnapshotResource", new()
{
    SourceDiskId = "string",
    Description = "string",
    FolderId = "string",
    Labels = 
    {
        { "string", "string" },
    },
    Name = "string",
});
example, err := yandex.NewComputeSnapshot(ctx, "computeSnapshotResource", &yandex.ComputeSnapshotArgs{
	SourceDiskId: pulumi.String("string"),
	Description:  pulumi.String("string"),
	FolderId:     pulumi.String("string"),
	Labels: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	Name: pulumi.String("string"),
})
var computeSnapshotResource = new ComputeSnapshot("computeSnapshotResource", ComputeSnapshotArgs.builder()
    .sourceDiskId("string")
    .description("string")
    .folderId("string")
    .labels(Map.of("string", "string"))
    .name("string")
    .build());
compute_snapshot_resource = yandex.ComputeSnapshot("computeSnapshotResource",
    source_disk_id="string",
    description="string",
    folder_id="string",
    labels={
        "string": "string",
    },
    name="string")
const computeSnapshotResource = new yandex.ComputeSnapshot("computeSnapshotResource", {
    sourceDiskId: "string",
    description: "string",
    folderId: "string",
    labels: {
        string: "string",
    },
    name: "string",
});
type: yandex:ComputeSnapshot
properties:
    description: string
    folderId: string
    labels:
        string: string
    name: string
    sourceDiskId: string
ComputeSnapshot 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 ComputeSnapshot resource accepts the following input properties:
- SourceDisk stringId 
- ID of the disk to create a snapshot from.
- Description string
- Description of the resource.
- FolderId string
- The ID of the folder that the resource belongs to. If it is not provided, the default provider folder is used.
- Labels Dictionary<string, string>
- A set of key/value label pairs to assign to the snapshot.
- Name string
- A name for the resource.
- SourceDisk stringId 
- ID of the disk to create a snapshot from.
- Description string
- Description of the resource.
- FolderId string
- The ID of the folder that the resource belongs to. If it is not provided, the default provider folder is used.
- Labels map[string]string
- A set of key/value label pairs to assign to the snapshot.
- Name string
- A name for the resource.
- sourceDisk StringId 
- ID of the disk to create a snapshot from.
- description String
- Description of the resource.
- folderId String
- The ID of the folder that the resource belongs to. If it is not provided, the default provider folder is used.
- labels Map<String,String>
- A set of key/value label pairs to assign to the snapshot.
- name String
- A name for the resource.
- sourceDisk stringId 
- ID of the disk to create a snapshot from.
- description string
- Description of the resource.
- folderId string
- The ID of the folder that the resource belongs to. If it is not provided, the default provider folder is used.
- labels {[key: string]: string}
- A set of key/value label pairs to assign to the snapshot.
- name string
- A name for the resource.
- source_disk_ strid 
- ID of the disk to create a snapshot from.
- description str
- Description of the resource.
- folder_id str
- The ID of the folder that the resource belongs to. If it is not provided, the default provider folder is used.
- labels Mapping[str, str]
- A set of key/value label pairs to assign to the snapshot.
- name str
- A name for the resource.
- sourceDisk StringId 
- ID of the disk to create a snapshot from.
- description String
- Description of the resource.
- folderId String
- The ID of the folder that the resource belongs to. If it is not provided, the default provider folder is used.
- labels Map<String>
- A set of key/value label pairs to assign to the snapshot.
- name String
- A name for the resource.
Outputs
All input properties are implicitly available as output properties. Additionally, the ComputeSnapshot resource produces the following output properties:
- CreatedAt string
- Creation timestamp of the snapshot.
- DiskSize int
- Size of the disk when the snapshot was created, specified in GB.
- Id string
- The provider-assigned unique ID for this managed resource.
- StorageSize int
- Size of the snapshot, specified in GB.
- CreatedAt string
- Creation timestamp of the snapshot.
- DiskSize int
- Size of the disk when the snapshot was created, specified in GB.
- Id string
- The provider-assigned unique ID for this managed resource.
- StorageSize int
- Size of the snapshot, specified in GB.
- createdAt String
- Creation timestamp of the snapshot.
- diskSize Integer
- Size of the disk when the snapshot was created, specified in GB.
- id String
- The provider-assigned unique ID for this managed resource.
- storageSize Integer
- Size of the snapshot, specified in GB.
- createdAt string
- Creation timestamp of the snapshot.
- diskSize number
- Size of the disk when the snapshot was created, specified in GB.
- id string
- The provider-assigned unique ID for this managed resource.
- storageSize number
- Size of the snapshot, specified in GB.
- created_at str
- Creation timestamp of the snapshot.
- disk_size int
- Size of the disk when the snapshot was created, specified in GB.
- id str
- The provider-assigned unique ID for this managed resource.
- storage_size int
- Size of the snapshot, specified in GB.
- createdAt String
- Creation timestamp of the snapshot.
- diskSize Number
- Size of the disk when the snapshot was created, specified in GB.
- id String
- The provider-assigned unique ID for this managed resource.
- storageSize Number
- Size of the snapshot, specified in GB.
Look up Existing ComputeSnapshot Resource
Get an existing ComputeSnapshot 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?: ComputeSnapshotState, opts?: CustomResourceOptions): ComputeSnapshot@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        created_at: Optional[str] = None,
        description: Optional[str] = None,
        disk_size: Optional[int] = None,
        folder_id: Optional[str] = None,
        labels: Optional[Mapping[str, str]] = None,
        name: Optional[str] = None,
        source_disk_id: Optional[str] = None,
        storage_size: Optional[int] = None) -> ComputeSnapshotfunc GetComputeSnapshot(ctx *Context, name string, id IDInput, state *ComputeSnapshotState, opts ...ResourceOption) (*ComputeSnapshot, error)public static ComputeSnapshot Get(string name, Input<string> id, ComputeSnapshotState? state, CustomResourceOptions? opts = null)public static ComputeSnapshot get(String name, Output<String> id, ComputeSnapshotState state, CustomResourceOptions options)resources:  _:    type: yandex:ComputeSnapshot    get:      id: ${id}- 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.
- CreatedAt string
- Creation timestamp of the snapshot.
- Description string
- Description of the resource.
- DiskSize int
- Size of the disk when the snapshot was created, specified in GB.
- FolderId string
- The ID of the folder that the resource belongs to. If it is not provided, the default provider folder is used.
- Labels Dictionary<string, string>
- A set of key/value label pairs to assign to the snapshot.
- Name string
- A name for the resource.
- SourceDisk stringId 
- ID of the disk to create a snapshot from.
- StorageSize int
- Size of the snapshot, specified in GB.
- CreatedAt string
- Creation timestamp of the snapshot.
- Description string
- Description of the resource.
- DiskSize int
- Size of the disk when the snapshot was created, specified in GB.
- FolderId string
- The ID of the folder that the resource belongs to. If it is not provided, the default provider folder is used.
- Labels map[string]string
- A set of key/value label pairs to assign to the snapshot.
- Name string
- A name for the resource.
- SourceDisk stringId 
- ID of the disk to create a snapshot from.
- StorageSize int
- Size of the snapshot, specified in GB.
- createdAt String
- Creation timestamp of the snapshot.
- description String
- Description of the resource.
- diskSize Integer
- Size of the disk when the snapshot was created, specified in GB.
- folderId String
- The ID of the folder that the resource belongs to. If it is not provided, the default provider folder is used.
- labels Map<String,String>
- A set of key/value label pairs to assign to the snapshot.
- name String
- A name for the resource.
- sourceDisk StringId 
- ID of the disk to create a snapshot from.
- storageSize Integer
- Size of the snapshot, specified in GB.
- createdAt string
- Creation timestamp of the snapshot.
- description string
- Description of the resource.
- diskSize number
- Size of the disk when the snapshot was created, specified in GB.
- folderId string
- The ID of the folder that the resource belongs to. If it is not provided, the default provider folder is used.
- labels {[key: string]: string}
- A set of key/value label pairs to assign to the snapshot.
- name string
- A name for the resource.
- sourceDisk stringId 
- ID of the disk to create a snapshot from.
- storageSize number
- Size of the snapshot, specified in GB.
- created_at str
- Creation timestamp of the snapshot.
- description str
- Description of the resource.
- disk_size int
- Size of the disk when the snapshot was created, specified in GB.
- folder_id str
- The ID of the folder that the resource belongs to. If it is not provided, the default provider folder is used.
- labels Mapping[str, str]
- A set of key/value label pairs to assign to the snapshot.
- name str
- A name for the resource.
- source_disk_ strid 
- ID of the disk to create a snapshot from.
- storage_size int
- Size of the snapshot, specified in GB.
- createdAt String
- Creation timestamp of the snapshot.
- description String
- Description of the resource.
- diskSize Number
- Size of the disk when the snapshot was created, specified in GB.
- folderId String
- The ID of the folder that the resource belongs to. If it is not provided, the default provider folder is used.
- labels Map<String>
- A set of key/value label pairs to assign to the snapshot.
- name String
- A name for the resource.
- sourceDisk StringId 
- ID of the disk to create a snapshot from.
- storageSize Number
- Size of the snapshot, specified in GB.
Import
A snapshot can be imported using the id of the resource, e.g.
 $ pulumi import yandex:index/computeSnapshot:ComputeSnapshot disk-snapshot shapshot_id
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Yandex pulumi/pulumi-yandex
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the yandexTerraform Provider.