Use this data source to get information about an EBS Snapshot for use when provisioning EBS Volumes
data "aws_ebs_snapshot" "ebs_volume" {
most_recent = true
owners = ["self"]
filter {
name = "volume-size"
values = ["40"]
}
filter {
name = "tag:Name"
values = ["Example"]
}
}
This data source supports the following arguments:
most_recent
- (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.
snapshot_ids
- (Optional) Returns information on a specific snapshot_id.
restorable_by_user_ids
- (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.
This data source exports the following attributes in addition to the arguments above:
arn
- ARN of the EBS Snapshot.id
- Snapshot ID (e.g., snap-59fcb34e).snapshot_id
- Snapshot ID (e.g., snap-59fcb34e).description
- Description for the snapshotowner_id
- AWS account ID of the EBS snapshot owner.owner_alias
- Value from an Amazon-maintained list (amazon
, aws-marketplace
, microsoft
) of snapshot owners.volume_id
- Volume ID (e.g., vol-59fcb34e).encrypted
- Whether the snapshot is encrypted.volume_size
- Size of the drive in GiBs.kms_key_id
- ARN for the KMS encryption key.data_encryption_key_id
- The data encryption key identifier for the snapshot.state
- Snapshot state.storage_tier
- Storage tier in which the snapshot is stored.outpost_arn
- ARN of the Outpost on which the snapshot is stored.tags
- Map of tags for the resource.read
- (Default 20m
)