Skip to content

Commit f1572f5

Browse files
authored
Merge pull request #1269 from buildkite/pdp-1983-add-parameters-for-io2-storage
Add RootVolumeIops parameter to allow io1 and io2 RootVolumeTypes
2 parents 7a19149 + 999c5b3 commit f1572f5

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

templates/aws-stack.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,11 @@ Parameters:
373373
Type: String
374374
Default: "gp3"
375375

376+
RootVolumeIops:
377+
Description: If the `RootVolumeType` is io1 or io2, the number of IOPS to provision for the root volume
378+
Type: Number
379+
Default: 1000
380+
376381
RootVolumeEncrypted:
377382
Description: Indicates whether the EBS volume is encrypted
378383
Type: String
@@ -709,6 +714,11 @@ Conditions:
709714
UseStackNameForInstanceName:
710715
!Equals [ !Ref InstanceName, "" ]
711716

717+
IsRootVolumeIsIo1OrIo2:
718+
!Or
719+
- !Equals [ !Ref RootVolumeType, "io1" ]
720+
- !Equals [ !Ref RootVolumeType, "io2" ]
721+
712722
Mappings:
713723
ECRManagedPolicy:
714724
none : { Policy: '' }
@@ -1133,7 +1143,11 @@ Resources:
11331143
- 'linuxamd64'
11341144
BlockDeviceMappings:
11351145
- DeviceName: !If [ UseDefaultRootVolumeName, !If [ UseWindowsAgents, /dev/sda1, /dev/xvda ], !Ref RootVolumeName ]
1136-
Ebs: { VolumeSize: !Ref RootVolumeSize, VolumeType: !Ref RootVolumeType, Encrypted: !Ref RootVolumeEncrypted }
1146+
Ebs:
1147+
VolumeSize: !Ref RootVolumeSize
1148+
VolumeType: !Ref RootVolumeType
1149+
Encrypted: !Ref RootVolumeEncrypted
1150+
Iops: !If [ IsRootVolumeIsIo1OrIo2, !Ref RootVolumeIops, !Ref "AWS::NoValue" ]
11371151
TagSpecifications:
11381152
- ResourceType: instance
11391153
Tags:

0 commit comments

Comments
 (0)