Use this data source to get a list of EBS Snapshot IDs matching the specified criteria.
data "aws_ebs_snapshot_ids" "ebs_volumes" {
owners = ["self"]
filter {
name = "volume-size"
values = ["40"]
}
filter {
name = "tag:Name"
values = ["Example"]
}
}
The following arguments are supported:
owners - (Optional) Returns the snapshots owned by the specified owner id. Multiple owners can be specified.
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-volumes in the AWS CLI reference.
ids is set to the list of EBS snapshot IDs, sorted by creation time in descending order.
© 2018 HashiCorpLicensed under the MPL 2.0 License.
https://www.terraform.io/docs/providers/aws/d/ebs_snapshot_ids.html