terraform/website/source/docs/providers/aws/d/ebs_snapshot.html.markdown

1.9 KiB

layout page_title sidebar_current description
aws AWS: aws_ebs_snapshot docs-aws-datasource-ebs-snapshot Get information on an EBS Snapshot.

aws_ebs_snapshot

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

Example Usage

data "aws_ebs_snapshot" "ebs_volume" {
    owners = ["self"]
    filter {
        name = "volume-size"
        values = ["40"]
    }
    filter {
        name = "tag:Name"
        values = ["Example"]
    }
}

Argument Reference

The following arguments are supported:

  • 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-volumes in the AWS CLI reference.

Attributes Reference

The following attributes are exported:

  • id - The snapshot ID (e.g. snap-59fcb34e).
  • snapshot_id - The snapshot ID (e.g. snap-59fcb34e).
  • description - A description for the snapshot
  • owner_id - The 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 - The volume ID (e.g. vol-59fcb34e).
  • encrypted - Whether the snapshot is encrypted.
  • volume_size - The size of the drive in GiBs.
  • kms_key_id - The ARN for the KMS encryption key.
  • data_encryption_key_id - The data encryption key identifier for the snapshot.
  • state - The snapshot state.
  • tags - A mapping of tags for the resource.