aws_ebs_volume
Manages a single EBS volume.
Example Usage
resource "aws_ebs_volume" "example" { availability_zone = "us-west-2a" size = 40 tags { Name = "HelloWorld" } }
NOTE: One of
size
orsnapshot_id
is required when specifying an EBS volume
Argument Reference
The following arguments are supported:
-
availability_zone
- (Required) The AZ where the EBS volume will exist. -
encrypted
- (Optional) If true, the disk will be encrypted. -
iops
- (Optional) The amount of IOPS to provision for the disk. -
size
- (Optional) The size of the drive in GiBs. -
snapshot_id
(Optional) A snapshot to base the EBS volume off of. -
type
- (Optional) The type of EBS volume. Can be "standard", "gp2", "io1", "sc1" or "st1" (Default: "standard"). -
kms_key_id
- (Optional) The ARN for the KMS encryption key. When specifyingkms_key_id
,encrypted
needs to be set to true. -
tags
- (Optional) A mapping of tags to assign to the resource.
NOTE: When changing the
size
,iops
ortype
of an instance, there are considerations to be aware of that Amazon have written about this.
Attributes Reference
In addition to all arguments above, the following attributes are exported:
-
id
- The volume ID (e.g. vol-59fcb34e). -
arn
- The volume ARN (e.g. arn:aws:ec2:us-east-1:0123456789012:volume/vol-59fcb34e).
Import
EBS Volumes can be imported using the id
, e.g.
$ terraform import aws_ebs_volume.data vol-049df61146c4d7901
© 2018 HashiCorpLicensed under the MPL 2.0 License.
https://www.terraform.io/docs/providers/aws/r/ebs_volume.html