Snapshot

Creates a Snapshot of an EBS Volume.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var example = new Aws.Ebs.Volume("example", new Aws.Ebs.VolumeArgs
        {
            AvailabilityZone = "us-west-2a",
            Size = 40,
            Tags = 
            {
                { "Name", "HelloWorld" },
            },
        });
        var exampleSnapshot = new Aws.Ebs.Snapshot("exampleSnapshot", new Aws.Ebs.SnapshotArgs
        {
            Tags = 
            {
                { "Name", "HelloWorld_snap" },
            },
            VolumeId = example.Id,
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/ebs"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        example, err := ebs.NewVolume(ctx, "example", &ebs.VolumeArgs{
            AvailabilityZone: pulumi.String("us-west-2a"),
            Size:             pulumi.Int(40),
            Tags: pulumi.StringMap{
                "Name": pulumi.String("HelloWorld"),
            },
        })
        if err != nil {
            return err
        }
        _, err = ebs.NewSnapshot(ctx, "exampleSnapshot", &ebs.SnapshotArgs{
            Tags: pulumi.StringMap{
                "Name": pulumi.String("HelloWorld_snap"),
            },
            VolumeId: example.ID(),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

example = aws.ebs.Volume("example",
    availability_zone="us-west-2a",
    size=40,
    tags={
        "Name": "HelloWorld",
    })
example_snapshot = aws.ebs.Snapshot("exampleSnapshot",
    tags={
        "Name": "HelloWorld_snap",
    },
    volume_id=example.id)
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.ebs.Volume("example", {
    availabilityZone: "us-west-2a",
    size: 40,
    tags: {
        Name: "HelloWorld",
    },
});
const exampleSnapshot = new aws.ebs.Snapshot("example_snapshot", {
    tags: {
        Name: "HelloWorld_snap",
    },
    volumeId: example.id,
});

Create a Snapshot Resource

def Snapshot(resource_name, opts=None, description=None, tags=None, volume_id=None, __props__=None);
func NewSnapshot(ctx *Context, name string, args SnapshotArgs, opts ...ResourceOption) (*Snapshot, error)
public Snapshot(string name, SnapshotArgs args, CustomResourceOptions? opts = null)
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.
opts ResourceOptions
A bag of options that control this 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.

Snapshot Resource Properties

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

Inputs

The Snapshot resource accepts the following input properties:

VolumeId string

The Volume ID of which to make a snapshot.

Description string

A description of what the snapshot is.

Tags Dictionary<string, string>

A map of tags to assign to the snapshot

VolumeId string

The Volume ID of which to make a snapshot.

Description string

A description of what the snapshot is.

Tags map[string]string

A map of tags to assign to the snapshot

volumeId string

The Volume ID of which to make a snapshot.

description string

A description of what the snapshot is.

tags {[key: string]: string}

A map of tags to assign to the snapshot

volume_id str

The Volume ID of which to make a snapshot.

description str

A description of what the snapshot is.

tags Dict[str, str]

A map of tags to assign to the snapshot

Outputs

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

Arn string

Amazon Resource Name (ARN) of the EBS Snapshot.

DataEncryptionKeyId string

The data encryption key identifier for the snapshot.

Encrypted bool

Whether the snapshot is encrypted.

Id string
The provider-assigned unique ID for this managed resource.
KmsKeyId string

The ARN for the KMS encryption key.

OwnerAlias string

Value from an Amazon-maintained list (amazon, aws-marketplace, microsoft) of snapshot owners.

OwnerId string

The AWS account ID of the EBS snapshot owner.

VolumeSize int

The size of the drive in GiBs.

Arn string

Amazon Resource Name (ARN) of the EBS Snapshot.

DataEncryptionKeyId string

The data encryption key identifier for the snapshot.

Encrypted bool

Whether the snapshot is encrypted.

Id string
The provider-assigned unique ID for this managed resource.
KmsKeyId string

The ARN for the KMS encryption key.

OwnerAlias string

Value from an Amazon-maintained list (amazon, aws-marketplace, microsoft) of snapshot owners.

OwnerId string

The AWS account ID of the EBS snapshot owner.

VolumeSize int

The size of the drive in GiBs.

arn string

Amazon Resource Name (ARN) of the EBS Snapshot.

dataEncryptionKeyId string

The data encryption key identifier for the snapshot.

encrypted boolean

Whether the snapshot is encrypted.

id string
The provider-assigned unique ID for this managed resource.
kmsKeyId string

The ARN for the KMS encryption key.

ownerAlias string

Value from an Amazon-maintained list (amazon, aws-marketplace, microsoft) of snapshot owners.

ownerId string

The AWS account ID of the EBS snapshot owner.

volumeSize number

The size of the drive in GiBs.

arn str

Amazon Resource Name (ARN) of the EBS Snapshot.

data_encryption_key_id str

The data encryption key identifier for the snapshot.

encrypted bool

Whether the snapshot is encrypted.

id str
The provider-assigned unique ID for this managed resource.
kms_key_id str

The ARN for the KMS encryption key.

owner_alias str

Value from an Amazon-maintained list (amazon, aws-marketplace, microsoft) of snapshot owners.

owner_id str

The AWS account ID of the EBS snapshot owner.

volume_size float

The size of the drive in GiBs.

Look up an 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
static get(resource_name, id, opts=None, arn=None, data_encryption_key_id=None, description=None, encrypted=None, kms_key_id=None, owner_alias=None, owner_id=None, tags=None, volume_id=None, volume_size=None, __props__=None);
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)
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.

The following state arguments are supported:

Arn string

Amazon Resource Name (ARN) of the EBS Snapshot.

DataEncryptionKeyId string

The data encryption key identifier for the snapshot.

Description string

A description of what the snapshot is.

Encrypted bool

Whether the snapshot is encrypted.

KmsKeyId string

The ARN for the KMS encryption key.

OwnerAlias string

Value from an Amazon-maintained list (amazon, aws-marketplace, microsoft) of snapshot owners.

OwnerId string

The AWS account ID of the EBS snapshot owner.

Tags Dictionary<string, string>

A map of tags to assign to the snapshot

VolumeId string

The Volume ID of which to make a snapshot.

VolumeSize int

The size of the drive in GiBs.

Arn string

Amazon Resource Name (ARN) of the EBS Snapshot.

DataEncryptionKeyId string

The data encryption key identifier for the snapshot.

Description string

A description of what the snapshot is.

Encrypted bool

Whether the snapshot is encrypted.

KmsKeyId string

The ARN for the KMS encryption key.

OwnerAlias string

Value from an Amazon-maintained list (amazon, aws-marketplace, microsoft) of snapshot owners.

OwnerId string

The AWS account ID of the EBS snapshot owner.

Tags map[string]string

A map of tags to assign to the snapshot

VolumeId string

The Volume ID of which to make a snapshot.

VolumeSize int

The size of the drive in GiBs.

arn string

Amazon Resource Name (ARN) of the EBS Snapshot.

dataEncryptionKeyId string

The data encryption key identifier for the snapshot.

description string

A description of what the snapshot is.

encrypted boolean

Whether the snapshot is encrypted.

kmsKeyId string

The ARN for the KMS encryption key.

ownerAlias string

Value from an Amazon-maintained list (amazon, aws-marketplace, microsoft) of snapshot owners.

ownerId string

The AWS account ID of the EBS snapshot owner.

tags {[key: string]: string}

A map of tags to assign to the snapshot

volumeId string

The Volume ID of which to make a snapshot.

volumeSize number

The size of the drive in GiBs.

arn str

Amazon Resource Name (ARN) of the EBS Snapshot.

data_encryption_key_id str

The data encryption key identifier for the snapshot.

description str

A description of what the snapshot is.

encrypted bool

Whether the snapshot is encrypted.

kms_key_id str

The ARN for the KMS encryption key.

owner_alias str

Value from an Amazon-maintained list (amazon, aws-marketplace, microsoft) of snapshot owners.

owner_id str

The AWS account ID of the EBS snapshot owner.

tags Dict[str, str]

A map of tags to assign to the snapshot

volume_id str

The Volume ID of which to make a snapshot.

volume_size float

The size of the drive in GiBs.

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.