Skip to content

Resource: awsEbsSnapshot

Creates a Snapshot of an EBS Volume.

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",
  },
});
new aws.ebsSnapshot.EbsSnapshot(this, "example_snapshot", {
  tags: {
    Name: "HelloWorld_snap",
  },
  volumeId: awsEbsVolumeExample.id,
});

Argument Reference

The following arguments are supported:

  • volumeId - (Required) The Volume ID of which to make a snapshot.
  • description - (Optional) A description of what the snapshot is.
  • outpostArn - (Optional) The Amazon Resource Name (ARN) of the Outpost on which to create a local 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 - (Optional) A map of tags to assign to 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 EBS snapshot owner.
  • ownerAlias - Value from an Amazon-maintained list (amazon, awsMarketplace, microsoft) of snapshot owners.
  • encrypted - Whether the snapshot is encrypted.
  • volumeSize - The size of the drive in GiBs.
  • kmsKeyId - The ARN for the KMS encryption key.
  • 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)

Import

EBS Snapshot can be imported using the id, e.g.,

$ terraform import aws_ebs_snapshot.id snap-049df61146c4d7901