Skip to content

Commit

Permalink
service/ec2: Additional support for volume type io2 (#14906)
Browse files Browse the repository at this point in the history
Output from acceptance testing:

```
--- PASS: TestAccAWSAMI_basic (55.61s)
--- PASS: TestAccAWSAMI_description (62.94s)
--- PASS: TestAccAWSAMI_disappears (53.64s)
--- PASS: TestAccAWSAMI_snapshotSize (55.61s)
--- PASS: TestAccAWSAMI_tags (76.21s)

--- PASS: TestAccAWSInstance_addSecondaryInterface (135.73s)
--- PASS: TestAccAWSInstance_addSecurityGroupNetworkInterface (140.60s)
--- PASS: TestAccAWSInstance_associatePublic_defaultPrivate (88.92s)
--- PASS: TestAccAWSInstance_associatePublic_defaultPublic (87.26s)
--- PASS: TestAccAWSInstance_associatePublic_explicitPrivate (95.89s)
--- PASS: TestAccAWSInstance_associatePublic_explicitPublic (107.11s)
--- PASS: TestAccAWSInstance_associatePublic_overridePrivate (88.66s)
--- PASS: TestAccAWSInstance_associatePublic_overridePublic (90.37s)
--- PASS: TestAccAWSInstance_associatePublicIPAndPrivateIP (112.06s)
--- PASS: TestAccAWSInstance_atLeastOneOtherEbsVolume (127.30s)
--- PASS: TestAccAWSInstance_basic (70.21s)
--- PASS: TestAccAWSInstance_blockDevices (99.92s)
--- PASS: TestAccAWSInstance_changeInstanceType (171.22s)
--- PASS: TestAccAWSInstance_CreditSpecification_Empty_NonBurstable (123.23s)
--- PASS: TestAccAWSInstance_creditSpecification_isNotAppliedToNonBurstable (99.79s)
--- PASS: TestAccAWSInstance_creditSpecification_standardCpuCredits (106.36s)
--- PASS: TestAccAWSInstance_creditSpecification_standardCpuCredits_t2Tot3Taint (209.53s)
--- PASS: TestAccAWSInstance_creditSpecification_unknownCpuCredits_t2 (90.07s)
--- PASS: TestAccAWSInstance_creditSpecification_unknownCpuCredits_t3 (308.54s)
--- PASS: TestAccAWSInstance_creditSpecification_unlimitedCpuCredits (93.51s)
--- PASS: TestAccAWSInstance_creditSpecification_unlimitedCpuCredits_t2Tot3Taint (173.27s)
--- PASS: TestAccAWSInstance_creditSpecification_unspecifiedDefaultsToStandard (92.45s)
--- PASS: TestAccAWSInstance_CreditSpecification_UnspecifiedToEmpty_NonBurstable (86.01s)
--- PASS: TestAccAWSInstance_creditSpecification_updateCpuCredits (128.83s)
--- PASS: TestAccAWSInstance_creditSpecificationT3_standardCpuCredits (113.19s)
--- PASS: TestAccAWSInstance_creditSpecificationT3_unlimitedCpuCredits (113.32s)
--- PASS: TestAccAWSInstance_creditSpecificationT3_unspecifiedDefaultsToUnlimited (97.62s)
--- PASS: TestAccAWSInstance_creditSpecificationT3_updateCpuCredits (147.45s)
--- PASS: TestAccAWSInstance_disableApiTermination (133.95s)
--- PASS: TestAccAWSInstance_disappears (89.43s)
--- PASS: TestAccAWSInstance_EbsBlockDevice_InvalidIopsForVolumeType (8.07s)
--- PASS: TestAccAWSInstance_EbsRootDevice_basic (116.88s)
--- PASS: TestAccAWSInstance_EbsRootDevice_ModifyIOPS_Io1 (165.67s)
--- PASS: TestAccAWSInstance_EbsRootDevice_ModifyIOPS_Io2 (243.64s)
--- PASS: TestAccAWSInstance_EbsRootDevice_ModifySize (127.52s)
--- PASS: TestAccAWSInstance_EbsRootDevice_ModifyType (135.86s)
--- PASS: TestAccAWSInstance_EbsRootDevice_MultipleBlockDevices_ModifySize (153.71s)
--- PASS: TestAccAWSInstance_EbsRootDevice_MultipleDynamicEBSBlockDevices (220.76s)
--- PASS: TestAccAWSInstance_Empty_PrivateIP (100.55s)
--- PASS: TestAccAWSInstance_forceNewAndTagsDrift (166.33s)
--- PASS: TestAccAWSInstance_getPasswordData_falseToTrue (141.17s)
--- PASS: TestAccAWSInstance_getPasswordData_trueToFalse (165.00s)
--- PASS: TestAccAWSInstance_GP2IopsDevice (80.15s)
--- PASS: TestAccAWSInstance_GP2WithIopsValue (6.92s)
--- PASS: TestAccAWSInstance_hibernation (245.69s)
--- PASS: TestAccAWSInstance_inDefaultVpcBySgId (82.14s)
--- PASS: TestAccAWSInstance_inDefaultVpcBySgName (194.00s)
--- PASS: TestAccAWSInstance_ipv6_supportAddressCount (82.72s)
--- PASS: TestAccAWSInstance_ipv6_supportAddressCountWithIpv4 (83.80s)
--- PASS: TestAccAWSInstance_ipv6AddressCountAndSingleAddressCausesError (10.75s)
--- PASS: TestAccAWSInstance_keyPairCheck (93.49s)
--- PASS: TestAccAWSInstance_multipleRegions (232.21s)
--- PASS: TestAccAWSInstance_NetworkInstanceRemovingAllSecurityGroups (91.40s)
--- PASS: TestAccAWSInstance_NetworkInstanceSecurityGroups (87.57s)
--- PASS: TestAccAWSInstance_NetworkInstanceVPCSecurityGroupIDs (98.99s)
--- PASS: TestAccAWSInstance_NewNetworkInterface_EmptyPrivateIPAndSecondaryPrivateIPs (91.98s)
--- PASS: TestAccAWSInstance_NewNetworkInterface_EmptyPrivateIPAndSecondaryPrivateIPsUpdate (110.87s)
--- PASS: TestAccAWSInstance_NewNetworkInterface_PrivateIPAndSecondaryPrivateIPs (74.45s)
--- PASS: TestAccAWSInstance_NewNetworkInterface_PrivateIPAndSecondaryPrivateIPsUpdate (105.33s)
--- PASS: TestAccAWSInstance_NewNetworkInterface_PublicIPAndSecondaryPrivateIPs (232.60s)
--- PASS: TestAccAWSInstance_noAMIEphemeralDevices (83.73s)
--- PASS: TestAccAWSInstance_placementGroup (79.02s)
--- PASS: TestAccAWSInstance_primaryNetworkInterface (94.55s)
--- PASS: TestAccAWSInstance_primaryNetworkInterfaceSourceDestCheck (105.53s)
--- PASS: TestAccAWSInstance_privateIP (120.50s)
--- PASS: TestAccAWSInstance_RootBlockDevice_KmsKeyArn (54.01s)
--- PASS: TestAccAWSInstance_rootBlockDeviceMismatch (95.10s)
--- PASS: TestAccAWSInstance_rootInstanceStore (79.26s)
--- PASS: TestAccAWSInstance_sourceDestCheck (150.80s)
--- PASS: TestAccAWSInstance_tags (135.57s)
--- PASS: TestAccAWSInstance_UserData_EmptyStringToUnspecified (126.91s)
--- PASS: TestAccAWSInstance_UserData_UnspecifiedToEmptyString (119.37s)
--- PASS: TestAccAWSInstance_userDataBase64 (224.57s)
--- PASS: TestAccAWSInstance_volumeTags (164.13s)
--- PASS: TestAccAWSInstance_volumeTagsComputed (157.24s)
--- PASS: TestAccAWSInstance_withIamInstanceProfile (140.61s)

--- PASS: TestAccAWSLaunchTemplate_associatePublicIPAddress (110.52s)
--- PASS: TestAccAWSLaunchTemplate_basic (36.38s)
--- PASS: TestAccAWSLaunchTemplate_BlockDeviceMappings_EBS (59.60s)
--- PASS: TestAccAWSLaunchTemplate_BlockDeviceMappings_EBS_DeleteOnTermination (98.20s)
--- PASS: TestAccAWSLaunchTemplate_capacityReservation_preference (41.18s)
--- PASS: TestAccAWSLaunchTemplate_capacityReservation_target (48.36s)
--- PASS: TestAccAWSLaunchTemplate_cpuOptions (38.41s)
--- PASS: TestAccAWSLaunchTemplate_creditSpecification_nonBurstable (50.34s)
--- PASS: TestAccAWSLaunchTemplate_creditSpecification_t2 (52.57s)
--- PASS: TestAccAWSLaunchTemplate_creditSpecification_t3 (50.78s)
--- PASS: TestAccAWSLaunchTemplate_data (47.03s)
--- PASS: TestAccAWSLaunchTemplate_defaultVersion (80.07s)
--- PASS: TestAccAWSLaunchTemplate_description (83.93s)
--- PASS: TestAccAWSLaunchTemplate_disappears (21.38s)
--- PASS: TestAccAWSLaunchTemplate_EbsOptimized (184.75s)
--- PASS: TestAccAWSLaunchTemplate_ElasticInferenceAccelerator (79.59s)
--- PASS: TestAccAWSLaunchTemplate_hibernation (84.05s)
--- PASS: TestAccAWSLaunchTemplate_IamInstanceProfile_EmptyConfigurationBlock (46.03s)
--- PASS: TestAccAWSLaunchTemplate_instanceMarketOptions (82.34s)
--- PASS: TestAccAWSLaunchTemplate_licenseSpecification (52.90s)
--- PASS: TestAccAWSLaunchTemplate_metadataOptions (52.30s)
--- PASS: TestAccAWSLaunchTemplate_networkInterface (56.67s)
--- PASS: TestAccAWSLaunchTemplate_networkInterface_ipv6AddressCount (54.73s)
--- PASS: TestAccAWSLaunchTemplate_networkInterface_ipv6Addresses (56.68s)
--- PASS: TestAccAWSLaunchTemplate_networkInterfaceAddresses (57.28s)
--- PASS: TestAccAWSLaunchTemplate_NetworkInterfaces_DeleteOnTermination (162.30s)
--- PASS: TestAccAWSLaunchTemplate_placement_partitionNum (90.28s)
--- PASS: TestAccAWSLaunchTemplate_tags (81.42s)
--- PASS: TestAccAWSLaunchTemplate_update (99.24s)
--- PASS: TestAccAWSLaunchTemplate_updateDefaultVersion (88.19s)

--- PASS: TestAccAWSSpotFleetRequest_associatePublicIpAddress (229.84s)
--- PASS: TestAccAWSSpotFleetRequest_basic (290.79s)
--- PASS: TestAccAWSSpotFleetRequest_changePriceForcesNewRequest (602.40s)
--- PASS: TestAccAWSSpotFleetRequest_disappears (213.79s)
--- PASS: TestAccAWSSpotFleetRequest_diversifiedAllocation (368.59s)
--- PASS: TestAccAWSSpotFleetRequest_fleetType (244.22s)
--- PASS: TestAccAWSSpotFleetRequest_iamInstanceProfileArn (234.39s)
--- PASS: TestAccAWSSpotFleetRequest_instanceInterruptionBehavior (323.72s)
--- PASS: TestAccAWSSpotFleetRequest_LaunchSpecification_EbsBlockDevice_KmsKeyId (143.85s)
--- PASS: TestAccAWSSpotFleetRequest_LaunchSpecification_RootBlockDevice_KmsKeyId (135.59s)
--- PASS: TestAccAWSSpotFleetRequest_launchSpecToLaunchTemplate (544.92s)
--- PASS: TestAccAWSSpotFleetRequest_launchTemplate (276.36s)
--- PASS: TestAccAWSSpotFleetRequest_launchTemplate_multiple (297.55s)
--- PASS: TestAccAWSSpotFleetRequest_launchTemplateToLaunchSpec (487.46s)
--- PASS: TestAccAWSSpotFleetRequest_launchTemplateWithOverrides (283.66s)
--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList (296.12s)
--- PASS: TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion (298.94s)
--- PASS: TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList (286.59s)
--- PASS: TestAccAWSSpotFleetRequest_multipleInstancePools (291.38s)
--- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz (276.34s)
--- PASS: TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet (277.54s)
--- PASS: TestAccAWSSpotFleetRequest_overriddingSpotPrice (277.17s)
--- PASS: TestAccAWSSpotFleetRequest_placementTenancyAndGroup (68.76s)
--- PASS: TestAccAWSSpotFleetRequest_tags (288.38s)
--- PASS: TestAccAWSSpotFleetRequest_updateExcessCapacityTerminationPolicy (580.71s)
--- PASS: TestAccAWSSpotFleetRequest_updateTargetCapacity (820.44s)
--- PASS: TestAccAWSSpotFleetRequest_withEBSDisk (225.31s)
--- PASS: TestAccAWSSpotFleetRequest_WithELBs (222.99s)
--- PASS: TestAccAWSSpotFleetRequest_withoutSpotPrice (228.61s)
--- PASS: TestAccAWSSpotFleetRequest_withTags (215.91s)
--- PASS: TestAccAWSSpotFleetRequest_WithTargetGroups (373.70s)
--- PASS: TestAccAWSSpotFleetRequest_withWeightedCapacity (295.64s)
--- PASS: TestAccAWSSpotFleetRequest_zero_capacity (355.42s)
```
  • Loading branch information
nikhil-goenka authored Sep 2, 2020
1 parent 5fc41d5 commit d5ca146
Show file tree
Hide file tree
Showing 9 changed files with 88 additions and 82 deletions.
16 changes: 5 additions & 11 deletions aws/resource_aws_ami.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,17 +119,11 @@ func resourceAwsAmi() *schema.Resource {
},

"volume_type": {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Default: ec2.VolumeTypeStandard,
ValidateFunc: validation.StringInSlice([]string{
ec2.VolumeTypeStandard,
ec2.VolumeTypeIo1,
ec2.VolumeTypeGp2,
ec2.VolumeTypeSc1,
ec2.VolumeTypeSt1,
}, false),
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Default: ec2.VolumeTypeStandard,
ValidateFunc: validation.StringInSlice(ec2.VolumeType_Values(), false),
},
},
},
Expand Down
44 changes: 16 additions & 28 deletions aws/resource_aws_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -392,17 +392,11 @@ func resourceAwsInstance() *schema.Resource {
},

"volume_type": {
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
ValidateFunc: validation.StringInSlice([]string{
ec2.VolumeTypeStandard,
ec2.VolumeTypeIo1,
ec2.VolumeTypeGp2,
ec2.VolumeTypeSc1,
ec2.VolumeTypeSt1,
}, false),
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
ValidateFunc: validation.StringInSlice(ec2.VolumeType_Values(), false),
},

"volume_id": {
Expand Down Expand Up @@ -504,16 +498,10 @@ func resourceAwsInstance() *schema.Resource {
},

"volume_type": {
Type: schema.TypeString,
Optional: true,
Computed: true,
ValidateFunc: validation.StringInSlice([]string{
ec2.VolumeTypeStandard,
ec2.VolumeTypeIo1,
ec2.VolumeTypeGp2,
ec2.VolumeTypeSc1,
ec2.VolumeTypeSt1,
}, false),
Type: schema.TypeString,
Optional: true,
Computed: true,
ValidateFunc: validation.StringInSlice(ec2.VolumeType_Values(), false),
},

"volume_id": {
Expand Down Expand Up @@ -592,11 +580,11 @@ func resourceAwsInstance() *schema.Resource {
}

func iopsDiffSuppressFunc(k, old, new string, d *schema.ResourceData) bool {
// Suppress diff if volume_type is not io1 and iops is unset or configured as 0
// Suppress diff if volume_type is not io1 or io2 and iops is unset or configured as 0
i := strings.LastIndexByte(k, '.')
vt := k[:i+1] + "volume_type"
v := d.Get(vt).(string)
return strings.ToLower(v) != ec2.VolumeTypeIo1 && new == "0"
return (strings.ToLower(v) != ec2.VolumeTypeIo1 || strings.ToLower(v) != ec2.VolumeTypeIo2) && new == "0"
}

func resourceAwsInstanceCreate(d *schema.ResourceData, meta interface{}) error {
Expand Down Expand Up @@ -1369,7 +1357,7 @@ func resourceAwsInstanceUpdate(d *schema.ResourceData, meta interface{}) error {
if v, ok := d.Get("root_block_device.0.iops").(int); ok && v != 0 {
// Enforce IOPs usage with a valid volume type
// Reference: https://github.com/terraform-providers/terraform-provider-aws/issues/12667
if t, ok := d.Get("root_block_device.0.volume_type").(string); ok && t != ec2.VolumeTypeIo1 {
if t, ok := d.Get("root_block_device.0.volume_type").(string); ok && t != ec2.VolumeTypeIo1 && t != ec2.VolumeTypeIo2 {
if t == "" {
// Volume defaults to gp2
t = ec2.VolumeTypeGp2
Expand Down Expand Up @@ -1833,8 +1821,8 @@ func readBlockDeviceMappingsFromConfig(d *schema.ResourceData, conn *ec2.EC2) ([
if v, ok := bd["volume_type"].(string); ok && v != "" {
ebs.VolumeType = aws.String(v)
if iops, ok := bd["iops"].(int); ok && iops > 0 {
if ec2.VolumeTypeIo1 == strings.ToLower(v) {
// Condition: This parameter is required for requests to create io1
if ec2.VolumeTypeIo1 == strings.ToLower(v) || ec2.VolumeTypeIo2 == strings.ToLower(v) {
// Condition: This parameter is required for requests to create io1 or io2
// volumes; it is not used in requests to create gp2, st1, sc1, or
// standard volumes.
// See: http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_EbsBlockDevice.html
Expand Down Expand Up @@ -1899,8 +1887,8 @@ func readBlockDeviceMappingsFromConfig(d *schema.ResourceData, conn *ec2.EC2) ([
if v, ok := bd["volume_type"].(string); ok && v != "" {
ebs.VolumeType = aws.String(v)
if iops, ok := bd["iops"].(int); ok && iops > 0 {
if ec2.VolumeTypeIo1 == strings.ToLower(v) {
// Only set the iops attribute if the volume type is io1. Setting otherwise
if ec2.VolumeTypeIo1 == strings.ToLower(v) || ec2.VolumeTypeIo2 == strings.ToLower(v) {
// Only set the iops attribute if the volume type is io1 or io2. Setting otherwise
// can trigger a refresh/plan loop based on the computed value that is given
// from AWS, and prevent us from specifying 0 as a valid iops.
// See https://github.com/hashicorp/terraform/pull/4146
Expand Down
44 changes: 43 additions & 1 deletion aws/resource_aws_instance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1600,7 +1600,7 @@ func TestAccAWSInstance_EbsRootDevice_ModifyType(t *testing.T) {
})
}

func TestAccAWSInstance_EbsRootDevice_ModifyIOPS(t *testing.T) {
func TestAccAWSInstance_EbsRootDevice_ModifyIOPS_Io1(t *testing.T) {
var original ec2.Instance
var updated ec2.Instance
resourceName := "aws_instance.test"
Expand Down Expand Up @@ -1642,6 +1642,48 @@ func TestAccAWSInstance_EbsRootDevice_ModifyIOPS(t *testing.T) {
})
}

func TestAccAWSInstance_EbsRootDevice_ModifyIOPS_Io2(t *testing.T) {
var original ec2.Instance
var updated ec2.Instance
resourceName := "aws_instance.test"

volumeSize := "30"
deleteOnTermination := "true"
volumeType := "io2"

originalIOPS := "100"
updatedIOPS := "200"

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckInstanceDestroy,
Steps: []resource.TestStep{
{
Config: testAccAwsEc2InstanceRootBlockDeviceWithIOPS(volumeSize, deleteOnTermination, volumeType, originalIOPS),
Check: resource.ComposeTestCheckFunc(
testAccCheckInstanceExists(resourceName, &original),
resource.TestCheckResourceAttr(resourceName, "root_block_device.0.volume_size", volumeSize),
resource.TestCheckResourceAttr(resourceName, "root_block_device.0.delete_on_termination", deleteOnTermination),
resource.TestCheckResourceAttr(resourceName, "root_block_device.0.volume_type", volumeType),
resource.TestCheckResourceAttr(resourceName, "root_block_device.0.iops", originalIOPS),
),
},
{
Config: testAccAwsEc2InstanceRootBlockDeviceWithIOPS(volumeSize, deleteOnTermination, volumeType, updatedIOPS),
Check: resource.ComposeTestCheckFunc(
testAccCheckInstanceExists(resourceName, &updated),
testAccCheckInstanceNotRecreated(t, &original, &updated),
resource.TestCheckResourceAttr(resourceName, "root_block_device.0.volume_size", volumeSize),
resource.TestCheckResourceAttr(resourceName, "root_block_device.0.delete_on_termination", deleteOnTermination),
resource.TestCheckResourceAttr(resourceName, "root_block_device.0.volume_type", volumeType),
resource.TestCheckResourceAttr(resourceName, "root_block_device.0.iops", updatedIOPS),
),
},
},
})
}

func TestAccAWSInstance_EbsRootDevice_ModifyDeleteOnTermination(t *testing.T) {
var original ec2.Instance
var updated ec2.Instance
Expand Down
14 changes: 4 additions & 10 deletions aws/resource_aws_launch_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,16 +139,10 @@ func resourceAwsLaunchTemplate() *schema.Resource {
Computed: true,
},
"volume_type": {
Type: schema.TypeString,
Optional: true,
Computed: true,
ValidateFunc: validation.StringInSlice([]string{
ec2.VolumeTypeStandard,
ec2.VolumeTypeGp2,
ec2.VolumeTypeIo1,
ec2.VolumeTypeSc1,
ec2.VolumeTypeSt1,
}, false),
Type: schema.TypeString,
Optional: true,
Computed: true,
ValidateFunc: validation.StringInSlice(ec2.VolumeType_Values(), false),
},
},
},
Expand Down
32 changes: 10 additions & 22 deletions aws/resource_aws_spot_fleet_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,11 @@ func resourceAwsSpotFleetRequest() *schema.Resource {
ForceNew: true,
},
"volume_type": {
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
ValidateFunc: validation.StringInSlice([]string{
ec2.VolumeTypeStandard,
ec2.VolumeTypeIo1,
ec2.VolumeTypeGp2,
ec2.VolumeTypeSc1,
ec2.VolumeTypeSt1,
}, false),
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
ValidateFunc: validation.StringInSlice(ec2.VolumeType_Values(), false),
},
},
},
Expand Down Expand Up @@ -204,17 +198,11 @@ func resourceAwsSpotFleetRequest() *schema.Resource {
ForceNew: true,
},
"volume_type": {
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
ValidateFunc: validation.StringInSlice([]string{
ec2.VolumeTypeStandard,
ec2.VolumeTypeIo1,
ec2.VolumeTypeGp2,
ec2.VolumeTypeSc1,
ec2.VolumeTypeSt1,
}, false),
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
ValidateFunc: validation.StringInSlice(ec2.VolumeType_Values(), false),
},
},
},
Expand Down
4 changes: 2 additions & 2 deletions website/docs/r/ami.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Nested `ebs_block_device` blocks have the following structure:
* `delete_on_termination` - (Optional) Boolean controlling whether the EBS volumes created to
support each created instance will be deleted once that instance is terminated.
* `encrypted` - (Optional) Boolean controlling whether the created EBS volumes will be encrypted. Can't be used with `snapshot_id`.
* `iops` - (Required only when `volume_type` is "io1") Number of I/O operations per second the
* `iops` - (Required only when `volume_type` is "io1/io2") Number of I/O operations per second the
created volumes will support.
* `snapshot_id` - (Optional) The id of an EBS snapshot that will be used to initialize the created
EBS volumes. If set, the `volume_size` attribute must be at least as large as the referenced
Expand All @@ -83,7 +83,7 @@ Nested `ebs_block_device` blocks have the following structure:
If `snapshot_id` is set and `volume_size` is omitted then the volume will have the same size
as the selected snapshot.
* `volume_type` - (Optional) The type of EBS volume to create. Can be one of "standard" (the
default), "io1" or "gp2".
default), "io1", "io2" or "gp2".
* `kms_key_id` - (Optional) The full ARN of the AWS Key Management Service (AWS KMS) CMK to use when encrypting the snapshots of
an image during a copy operation. This parameter is only required if you want to use a non-default CMK;
if this parameter is not specified, the default CMK for EBS is used
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/ebs_volume.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ 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. Only valid for `type` of `io1`.
* `iops` - (Optional) The amount of IOPS to provision for the disk. Only valid for `type` of `io1` or `io2`.
* `multi_attach_enabled` - (Optional) Specifies whether to enable Amazon EBS Multi-Attach. Multi-Attach is supported exclusively on `io1` volumes.
* `size` - (Optional) The size of the drive in GiBs.
* `snapshot_id` (Optional) A snapshot to base the EBS volume off of.
Expand Down
10 changes: 5 additions & 5 deletions website/docs/r/instance.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,11 @@ to understand the implications of using these attributes.

The `root_block_device` mapping supports the following:

* `volume_type` - (Optional) The type of volume. Can be `"standard"`, `"gp2"`, `"io1"`, `"sc1"`, or `"st1"`. (Default: `"gp2"`).
* `volume_type` - (Optional) The type of volume. Can be `"standard"`, `"gp2"`, `"io1"`, `"io2"`, `"sc1"`, or `"st1"`. (Default: `"gp2"`).
* `volume_size` - (Optional) The size of the volume in gibibytes (GiB).
* `iops` - (Optional) The amount of provisioned
[IOPS](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-io-characteristics.html).
This is only valid for `volume_type` of `"io1"`, and must be specified if
This is only valid for `volume_type` of `"io1/io2"`, and must be specified if
using that type
* `delete_on_termination` - (Optional) Whether the volume should be destroyed
on instance termination (Default: `true`).
Expand All @@ -144,12 +144,12 @@ Each `ebs_block_device` supports the following:

* `device_name` - (Required) The name of the device to mount.
* `snapshot_id` - (Optional) The Snapshot ID to mount.
* `volume_type` - (Optional) The type of volume. Can be `"standard"`, `"gp2"`,
or `"io1"`. (Default: `"gp2"`).
* `volume_type` - (Optional) The type of volume. Can be `"standard"`, `"gp2"`, `"io1"`
or `"io2"`. (Default: `"gp2"`).
* `volume_size` - (Optional) The size of the volume in gibibytes (GiB).
* `iops` - (Optional) The amount of provisioned
[IOPS](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-io-characteristics.html).
This must be set with a `volume_type` of `"io1"`.
This must be set with a `volume_type` of `"io1/io2"`.
* `delete_on_termination` - (Optional) Whether the volume should be destroyed
on instance termination (Default: `true`).
* `encrypted` - (Optional) Enables [EBS
Expand Down
4 changes: 2 additions & 2 deletions website/docs/r/launch_template.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,12 @@ The `ebs` block supports the following:
on the volume (Default: `false`). Cannot be used with `snapshot_id`.
* `iops` - The amount of provisioned
[IOPS](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-io-characteristics.html).
This must be set with a `volume_type` of `"io1"`.
This must be set with a `volume_type` of `"io1/io2"`.
* `kms_key_id` - The ARN of the AWS Key Management Service (AWS KMS) customer master key (CMK) to use when creating the encrypted volume.
`encrypted` must be set to `true` when this is set.
* `snapshot_id` - The Snapshot ID to mount.
* `volume_size` - The size of the volume in gigabytes.
* `volume_type` - The type of volume. Can be `"standard"`, `"gp2"`, or `"io1"`. (Default: `"standard"`).
* `volume_type` - The type of volume. Can be `"standard"`, `"gp2"`, `"io1"` or `"io2"`. (Default: `"standard"`).

### Capacity Reservation Specification

Expand Down

0 comments on commit d5ca146

Please # to comment.