Skip to content

Data Source: awsEbsSnapshot

Use this data source to get information about an EBS Snapshot for use when provisioning EBS Volumes

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";
new aws.dataAwsEbsSnapshot.DataAwsEbsSnapshot(this, "ebs_volume", {
  filter: [
    {
      name: "volume-size",
      values: ["40"],
    },
    {
      name: "tag:Name",
      values: ["Example"],
    },
  ],
  mostRecent: true,
  owners: ["self"],
});

Argument Reference

The following arguments are supported:

  • mostRecent - (Optional) If more than one result is returned, use the most recent snapshot.

  • owners - (Optional) Returns the snapshots owned by the specified owner id. Multiple owners can be specified.

  • snapshotIds - (Optional) Returns information on a specific snapshot_id.

  • restorableByUserIds - (Optional) One or more AWS accounts IDs that can create volumes from the snapshot.

  • filter - (Optional) One or more name/value pairs to filter off of. There are several valid keys, for a full reference, check out describe-snapshots in the AWS CLI reference.

Attributes Reference

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

  • arn - ARN of the EBS Snapshot.
  • id - Snapshot ID (e.g., snap-59fcb34e).
  • snapshotId - Snapshot ID (e.g., snap-59fcb34e).
  • description - Description for the snapshot
  • ownerId - AWS account ID of the EBS snapshot owner.
  • ownerAlias - Value from an Amazon-maintained list (amazon, awsMarketplace, microsoft) of snapshot owners.
  • volumeId - Volume ID (e.g., vol-59fcb34e).
  • encrypted - Whether the snapshot is encrypted.
  • volumeSize - Size of the drive in GiBs.
  • kmsKeyId - ARN for the KMS encryption key.
  • dataEncryptionKeyId - The data encryption key identifier for the snapshot.
  • state - Snapshot state.
  • storageTier - Storage tier in which the snapshot is stored.
  • outpostArn - ARN of the Outpost on which the snapshot is stored.
  • tags - Map of tags for the resource.

Timeouts

Configuration options:

  • read - (Default 20M)