SnapshotCopy

Creates a Snapshot of a snapshot.

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,
        });
        var exampleCopy = new Aws.Ebs.SnapshotCopy("exampleCopy", new Aws.Ebs.SnapshotCopyArgs
        {
            SourceRegion = "us-west-2",
            SourceSnapshotId = exampleSnapshot.Id,
            Tags = 
            {
                { "Name", "HelloWorld_copy_snap" },
            },
        });
    }

}
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
        }
        exampleSnapshot, err := ebs.NewSnapshot(ctx, "exampleSnapshot", &ebs.SnapshotArgs{
            Tags: pulumi.StringMap{
                "Name": pulumi.String("HelloWorld_snap"),
            },
            VolumeId: example.ID(),
        })
        if err != nil {
            return err
        }
        _, err = ebs.NewSnapshotCopy(ctx, "exampleCopy", &ebs.SnapshotCopyArgs{
            SourceRegion:     pulumi.String("us-west-2"),
            SourceSnapshotId: exampleSnapshot.ID(),
            Tags: pulumi.StringMap{
                "Name": pulumi.String("HelloWorld_copy_snap"),
            },
        })
        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)
example_copy = aws.ebs.SnapshotCopy("exampleCopy",
    source_region="us-west-2",
    source_snapshot_id=example_snapshot.id,
    tags={
        "Name": "HelloWorld_copy_snap",
    })
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,
});
const exampleCopy = new aws.ebs.SnapshotCopy("example_copy", {
    sourceRegion: "us-west-2",
    sourceSnapshotId: exampleSnapshot.id,
    tags: {
        Name: "HelloWorld_copy_snap",
    },
});

Create a SnapshotCopy Resource

def SnapshotCopy(resource_name, opts=None, description=None, encrypted=None, kms_key_id=None, source_region=None, source_snapshot_id=None, tags=None, __props__=None);
func NewSnapshotCopy(ctx *Context, name string, args SnapshotCopyArgs, opts ...ResourceOption) (*SnapshotCopy, error)
name string
The unique name of the resource.
args SnapshotCopyArgs
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 SnapshotCopyArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args SnapshotCopyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

SnapshotCopy Resource Properties

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

Inputs

The SnapshotCopy resource accepts the following input properties:

SourceRegion string

The region of the source snapshot.

SourceSnapshotId string

The ARN for the snapshot to be copied.

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.

Tags Dictionary<string, string>

A map of tags for the snapshot.

SourceRegion string

The region of the source snapshot.

SourceSnapshotId string

The ARN for the snapshot to be copied.

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.

Tags map[string]string

A map of tags for the snapshot.

sourceRegion string

The region of the source snapshot.

sourceSnapshotId string

The ARN for the snapshot to be copied.

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.

tags {[key: string]: string}

A map of tags for the snapshot.

source_region str

The region of the source snapshot.

source_snapshot_id str

The ARN for the snapshot to be copied.

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.

tags Dict[str, str]

A map of tags for the snapshot.

Outputs

All input properties are implicitly available as output properties. Additionally, the SnapshotCopy 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. * source_snapshot_id The ARN of the copied snapshot. * source_region The region of the source snapshot.

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

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

OwnerId string

The AWS account ID of the snapshot owner.

VolumeId string
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. * source_snapshot_id The ARN of the copied snapshot. * source_region The region of the source snapshot.

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

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

OwnerId string

The AWS account ID of the snapshot owner.

VolumeId string
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. * source_snapshot_id The ARN of the copied snapshot. * source_region The region of the source snapshot.

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

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

ownerId string

The AWS account ID of the snapshot owner.

volumeId string
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. * source_snapshot_id The ARN of the copied snapshot. * source_region The region of the source snapshot.

id str
The provider-assigned unique ID for this managed resource.
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 snapshot owner.

volume_id str
volume_size float

The size of the drive in GiBs.

Look up an Existing SnapshotCopy Resource

Get an existing SnapshotCopy 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?: SnapshotCopyState, opts?: CustomResourceOptions): SnapshotCopy
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, source_region=None, source_snapshot_id=None, tags=None, volume_id=None, volume_size=None, __props__=None);
func GetSnapshotCopy(ctx *Context, name string, id IDInput, state *SnapshotCopyState, opts ...ResourceOption) (*SnapshotCopy, error)
public static SnapshotCopy Get(string name, Input<string> id, SnapshotCopyState? 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. * source_snapshot_id The ARN of the copied snapshot. * source_region The region of the source 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 snapshot owner.

SourceRegion string

The region of the source snapshot.

SourceSnapshotId string

The ARN for the snapshot to be copied.

Tags Dictionary<string, string>

A map of tags for the snapshot.

VolumeId string
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. * source_snapshot_id The ARN of the copied snapshot. * source_region The region of the source 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 snapshot owner.

SourceRegion string

The region of the source snapshot.

SourceSnapshotId string

The ARN for the snapshot to be copied.

Tags map[string]string

A map of tags for the snapshot.

VolumeId string
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. * source_snapshot_id The ARN of the copied snapshot. * source_region The region of the source 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 snapshot owner.

sourceRegion string

The region of the source snapshot.

sourceSnapshotId string

The ARN for the snapshot to be copied.

tags {[key: string]: string}

A map of tags for the snapshot.

volumeId string
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. * source_snapshot_id The ARN of the copied snapshot. * source_region The region of the source 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 snapshot owner.

source_region str

The region of the source snapshot.

source_snapshot_id str

The ARN for the snapshot to be copied.

tags Dict[str, str]

A map of tags for the snapshot.

volume_id str
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.