Resource: aws_ebs_volume#
Manages a single EBS volume.
Example Usage#
resource "aws_ebs_volume" "example" {
availability_zone = "ru-msk-vol52"
size = 40
tags = {
Name = "HelloWorld"
}
}
~> Note At least one of size
or snapshot_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.iops
- (Optional) The amount of IOPS to provision for the disk. Only valid fortype
ofio2
.size
- (Optional) The size of the drive in GiB.snapshot_id
(Optional) A snapshot to base the EBS volume on.type
- (Optional) The type of EBS volume. Can best2
,gp2
orio2
(Default:st2
).tags
- (Optional) Map of tags to assign to the volume. If a providerdefault_tags
configuration block is used, tags with matching keys will overwrite those defined at the provider level.
Attribute Reference#
Supported attributes#
In addition to all arguments above, the following attributes are exported:
arn
- The Amazon Resource Name (ARN) of the volume.id
- The volume ID (e.g.,vol-12345678
).tags_all
- Map of tags assigned to the volume, including those inherited from the providerdefault_tags
configuration block.throughput
- The throughput that the volume supports, in MiB/s.
Unsupported attributes#
~> Note These attributes may be present in the terraform.tfstate
file, but they have preset values and cannot be specified in configuration files.
The following attributes are not currently supported:
encrypted
, kms_key_id
, multi_attach_enabled
, outpost_arn
.
Timeouts#
The timeouts
block allows you to specify timeouts for certain actions:
create
- (Default5 minutes
) Used for creating volumes. This includes the time required for the volume to become available.update
- (Default5 minutes
) Used forsize
,type
, oriops
volume changes.delete
- (Default5 minutes
) Used for destroying volumes.
Import#
EBS volumes can be imported using id
, e.g.,
$ terraform import aws_ebs_volume.id vol-12345678