Resource: aws_ebs_volume#
Manages a single volume.
Example usage#
resource "aws_ebs_volume" "example" {
availability_zone = "ru-msk-vol52"
size = 40
tags = {
Name = "HelloWorld"
}
}
Argument reference#
The following arguments are required:
availability_zone- (Required, Forces new resource, String) The availability zone to create the volume in.
The following arguments are optional:
iops- (Optional, Editable, Integer) The amount of IOPS to provision for the volume.- Constrains: Can be applied to volumes only with
typeset toio2
- Constrains: Can be applied to volumes only with
size- (Optional, Editable, Integer) The size of the volume in GiB.- Constraints: This argument is required if the
snapshot_idargument is not specified
- Constraints: This argument is required if the
snapshot_id(Optional, Forces new resource, String) The ID of the snapshot.- Constraints: This argument is required if the
sizeargument is not specified
- Constraints: This argument is required if the
tags- (Optional, Editable, Map of tags) Key-value pairs to assign to the volume. If thedefault_tagsconfiguration block is used within a provider configuration, the tags with matching keys will overwrite those defined at the provider level.type- (Optional, Editable, String) The type of the volume.
Attribute reference#
Supported attributes#
In addition to all arguments above, the following attributes are exported:
arn- (String) The Amazon Resource Name (ARN) of the volume.id- (String) The ID of the volume.- Example:
vol-12345678
- Example:
tags_all- (Map of strings) Key-value pairs assigned to the volume, including any tags inherited from thedefault_tagsconfiguration block if used within a provider configuration.throughput- (Integer) 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 the volume. This includes the time required for the volume to become available.update- (Default5 minutes) Used for updating the volume.delete- (Default5 minutes) Used for destroying the volume.
Import#
The volume can be imported using id, for example:
$ terraform import aws_ebs_volume.id vol-12345678