2015-04-29 05:49:21 +02:00
|
|
|
---
|
|
|
|
layout: "aws"
|
|
|
|
page_title: "AWS: aws_ebs_volume"
|
|
|
|
sidebar_current: "docs-aws-resource-ebs-volume"
|
|
|
|
description: |-
|
2015-05-21 11:54:11 +02:00
|
|
|
Provides an elastic block storage resource.
|
2015-04-29 05:49:21 +02:00
|
|
|
---
|
|
|
|
|
|
|
|
# aws\_ebs\_volume
|
|
|
|
|
|
|
|
Manages a single EBS volume.
|
|
|
|
|
|
|
|
## Example Usage
|
|
|
|
|
|
|
|
```
|
|
|
|
resource "aws_ebs_volume" "example" {
|
2015-12-02 21:19:19 +01:00
|
|
|
availability_zone = "us-west-2a"
|
2015-04-29 05:49:21 +02:00
|
|
|
size = 40
|
2015-05-29 09:05:21 +02:00
|
|
|
tags {
|
|
|
|
Name = "HelloWorld"
|
|
|
|
}
|
2015-04-29 05:49:21 +02:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2016-04-19 23:07:01 +02:00
|
|
|
~> **NOTE**: One of `size` or `snapshot_id` is required when specifying an EBS volume
|
|
|
|
|
2015-04-29 05:49:21 +02:00
|
|
|
## 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.
|
2016-08-16 22:07:59 +02:00
|
|
|
* `size` - (Optional) The size of the drive in GiBs.
|
2015-05-29 03:00:44 +02:00
|
|
|
* `snapshot_id` (Optional) A snapshot to base the EBS volume off of.
|
2017-02-13 20:52:57 +01:00
|
|
|
* `type` - (Optional) The type of EBS volume. Can be "standard", "gp2", "io1", "sc1" or "st1" (Default: "standard").
|
2016-11-30 12:50:26 +01:00
|
|
|
* `kms_key_id` - (Optional) The ARN for the KMS encryption key. When specifying `kms_key_id`, `encrypted` needs to be set to true.
|
2015-05-29 09:05:21 +02:00
|
|
|
* `tags` - (Optional) A mapping of tags to assign to the resource.
|
2015-05-21 12:06:13 +02:00
|
|
|
|
|
|
|
## Attributes Reference
|
|
|
|
|
|
|
|
The following attributes are exported:
|
|
|
|
|
|
|
|
* `id` - The volume ID (e.g. vol-59fcb34e).
|
|
|
|
|
|
|
|
|
2016-07-21 00:28:59 +02:00
|
|
|
## Import
|
|
|
|
|
|
|
|
EBS Volumes can be imported using the `id`, e.g.
|
|
|
|
|
|
|
|
```
|
|
|
|
$ terraform import aws_ebs_volume.data vol-049df61146c4d7901
|
2016-07-28 09:44:09 +02:00
|
|
|
```
|