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
new SnapshotCopy(name: string, args: SnapshotCopyArgs, opts?: CustomResourceOptions);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)public SnapshotCopy(string name, SnapshotCopyArgs args, CustomResourceOptions? opts = null)- 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:
- Source
Region string The region of the source snapshot.
- Source
Snapshot stringId The ARN for the snapshot to be copied.
- Description string
A description of what the snapshot is.
- Encrypted bool
Whether the snapshot is encrypted.
- Kms
Key stringId The ARN for the KMS encryption key.
- Dictionary<string, string>
A map of tags for the snapshot.
- Source
Region string The region of the source snapshot.
- Source
Snapshot stringId The ARN for the snapshot to be copied.
- Description string
A description of what the snapshot is.
- Encrypted bool
Whether the snapshot is encrypted.
- Kms
Key stringId The ARN for the KMS encryption key.
- map[string]string
A map of tags for the snapshot.
- source
Region string The region of the source snapshot.
- source
Snapshot stringId The ARN for the snapshot to be copied.
- description string
A description of what the snapshot is.
- encrypted boolean
Whether the snapshot is encrypted.
- kms
Key stringId The ARN for the KMS encryption key.
- {[key: string]: string}
A map of tags for the snapshot.
- source_
region str The region of the source snapshot.
- source_
snapshot_ strid 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_ strid The ARN for the KMS encryption key.
- 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.
- Data
Encryption stringKey Id The data encryption key identifier for the snapshot. *
source_snapshot_idThe ARN of the copied snapshot. *source_regionThe region of the source snapshot.- Id string
- The provider-assigned unique ID for this managed resource.
- Owner
Alias string Value from an Amazon-maintained list (
amazon,aws-marketplace,microsoft) of snapshot owners.- Owner
Id string The AWS account ID of the snapshot owner.
- Volume
Id string - Volume
Size int The size of the drive in GiBs.
- Arn string
Amazon Resource Name (ARN) of the EBS Snapshot.
- Data
Encryption stringKey Id The data encryption key identifier for the snapshot. *
source_snapshot_idThe ARN of the copied snapshot. *source_regionThe region of the source snapshot.- Id string
- The provider-assigned unique ID for this managed resource.
- Owner
Alias string Value from an Amazon-maintained list (
amazon,aws-marketplace,microsoft) of snapshot owners.- Owner
Id string The AWS account ID of the snapshot owner.
- Volume
Id string - Volume
Size int The size of the drive in GiBs.
- arn string
Amazon Resource Name (ARN) of the EBS Snapshot.
- data
Encryption stringKey Id The data encryption key identifier for the snapshot. *
source_snapshot_idThe ARN of the copied snapshot. *source_regionThe region of the source snapshot.- id string
- The provider-assigned unique ID for this managed resource.
- owner
Alias string Value from an Amazon-maintained list (
amazon,aws-marketplace,microsoft) of snapshot owners.- owner
Id string The AWS account ID of the snapshot owner.
- volume
Id string - volume
Size number The size of the drive in GiBs.
- arn str
Amazon Resource Name (ARN) of the EBS Snapshot.
- data_
encryption_ strkey_ id The data encryption key identifier for the snapshot. *
source_snapshot_idThe ARN of the copied snapshot. *source_regionThe 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): SnapshotCopystatic 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.
- Data
Encryption stringKey Id The data encryption key identifier for the snapshot. *
source_snapshot_idThe ARN of the copied snapshot. *source_regionThe region of the source snapshot.- Description string
A description of what the snapshot is.
- Encrypted bool
Whether the snapshot is encrypted.
- Kms
Key stringId The ARN for the KMS encryption key.
- Owner
Alias string Value from an Amazon-maintained list (
amazon,aws-marketplace,microsoft) of snapshot owners.- Owner
Id string The AWS account ID of the snapshot owner.
- Source
Region string The region of the source snapshot.
- Source
Snapshot stringId The ARN for the snapshot to be copied.
- Dictionary<string, string>
A map of tags for the snapshot.
- Volume
Id string - Volume
Size int The size of the drive in GiBs.
- Arn string
Amazon Resource Name (ARN) of the EBS Snapshot.
- Data
Encryption stringKey Id The data encryption key identifier for the snapshot. *
source_snapshot_idThe ARN of the copied snapshot. *source_regionThe region of the source snapshot.- Description string
A description of what the snapshot is.
- Encrypted bool
Whether the snapshot is encrypted.
- Kms
Key stringId The ARN for the KMS encryption key.
- Owner
Alias string Value from an Amazon-maintained list (
amazon,aws-marketplace,microsoft) of snapshot owners.- Owner
Id string The AWS account ID of the snapshot owner.
- Source
Region string The region of the source snapshot.
- Source
Snapshot stringId The ARN for the snapshot to be copied.
- map[string]string
A map of tags for the snapshot.
- Volume
Id string - Volume
Size int The size of the drive in GiBs.
- arn string
Amazon Resource Name (ARN) of the EBS Snapshot.
- data
Encryption stringKey Id The data encryption key identifier for the snapshot. *
source_snapshot_idThe ARN of the copied snapshot. *source_regionThe region of the source snapshot.- description string
A description of what the snapshot is.
- encrypted boolean
Whether the snapshot is encrypted.
- kms
Key stringId The ARN for the KMS encryption key.
- owner
Alias string Value from an Amazon-maintained list (
amazon,aws-marketplace,microsoft) of snapshot owners.- owner
Id string The AWS account ID of the snapshot owner.
- source
Region string The region of the source snapshot.
- source
Snapshot stringId The ARN for the snapshot to be copied.
- {[key: string]: string}
A map of tags for the snapshot.
- volume
Id string - volume
Size number The size of the drive in GiBs.
- arn str
Amazon Resource Name (ARN) of the EBS Snapshot.
- data_
encryption_ strkey_ id The data encryption key identifier for the snapshot. *
source_snapshot_idThe ARN of the copied snapshot. *source_regionThe region of the source snapshot.- description str
A description of what the snapshot is.
- encrypted bool
Whether the snapshot is encrypted.
- kms_
key_ strid 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_ strid The ARN for the snapshot to be copied.
- 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
awsTerraform Provider.