Skip to content

Resource: awsEbsSnapshotCopy

Creates a Snapshot of a snapshot.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
const awsEbsVolumeExample = new aws.ebsVolume.EbsVolume(this, "example", {
  availabilityZone: "us-west-2a",
  size: 40,
  tags: {
    Name: "HelloWorld",
  },
});
const awsEbsSnapshotExampleSnapshot = new aws.ebsSnapshot.EbsSnapshot(
  this,
  "example_snapshot",
  {
    tags: {
      Name: "HelloWorld_snap",
    },
    volumeId: awsEbsVolumeExample.id,
  }
);
new aws.ebsSnapshotCopy.EbsSnapshotCopy(this, "example_copy", {
  sourceRegion: "us-west-2",
  sourceSnapshotId: awsEbsSnapshotExampleSnapshot.id,
  tags: {
    Name: "HelloWorld_copy_snap",
  },
});

Argument Reference

The following arguments are supported:

  • description - (Optional) A description of what the snapshot is.
  • encrypted - Whether the snapshot is encrypted.
  • kmsKeyId - The ARN for the KMS encryption key.
  • sourceSnapshotId The ARN for the snapshot to be copied.
  • sourceRegion The region of the source snapshot.
  • storageTier - (Optional) The name of the storage tier. Valid values are archive and standard. Default value is standard.
  • permanentRestore - (Optional) Indicates whether to permanently restore an archived snapshot.
  • temporaryRestoreDays - (Optional) Specifies the number of days for which to temporarily restore an archived snapshot. Required for temporary restores only. The snapshot will be automatically re-archived after this period.
  • tags - A map of tags for the snapshot. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • arn - Amazon Resource Name (ARN) of the EBS Snapshot.
  • id - The snapshot ID (e.g., snap-59fcb34e).
  • ownerId - The AWS account ID of the snapshot owner.
  • ownerAlias - Value from an Amazon-maintained list (amazon, awsMarketplace, microsoft) of snapshot owners.
  • volumeSize - The size of the drive in GiBs.
  • dataEncryptionKeyId - The data encryption key identifier for the snapshot.
  • tagsAll - A map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.

Timeouts

Configuration options:

  • create - (Default 10M)
  • delete - (Default 10M)