Skip to content

Commit 4897e16

Browse files
committed
Ensure Throughput setting is honoured on gp3 volumes
1 parent c0db2c5 commit 4897e16

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/actuators/machine/instances.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@ func getBlockDeviceMappings(machine runtimeclient.ObjectKey, blockDeviceMappingS
316316
}
317317

318318
// IOPS settings are only valid on IO1, IO2 and GP3 block devices
319+
// Throughput settings are only valid on GP3 block devices
319320
// https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/create-volume.html
320321
switch aws.StringValue(volumeType) {
321322
case ec2.VolumeTypeIo1, ec2.VolumeTypeIo2, ec2.VolumeTypeGp3:
@@ -325,6 +326,9 @@ func getBlockDeviceMappings(machine runtimeclient.ObjectKey, blockDeviceMappingS
325326
if blockDeviceMappingSpec.EBS.Iops != nil && *blockDeviceMappingSpec.EBS.Iops > 0 {
326327
blockDeviceMapping.Ebs.Iops = blockDeviceMappingSpec.EBS.Iops
327328
}
329+
if volumeType == ec2.VolumeTypeGp3 && blockDeviceMappingSpec.EBS.ThroughputMib != nil && *blockDeviceMappingSpec.EBS.ThroughputMib > 0 {
330+
blockDeviceMapping.Ebs.Throughput = blockDeviceMappingSpec.EBS.ThroughputMib
331+
}
328332
}
329333

330334
if aws.StringValue(blockDeviceMappingSpec.EBS.KMSKey.ID) != "" {

0 commit comments

Comments
 (0)