diff --git a/pkg/actuators/machine/instances.go b/pkg/actuators/machine/instances.go index a49229559..035c32f4d 100644 --- a/pkg/actuators/machine/instances.go +++ b/pkg/actuators/machine/instances.go @@ -316,6 +316,7 @@ func getBlockDeviceMappings(machine runtimeclient.ObjectKey, blockDeviceMappingS } // IOPS settings are only valid on IO1, IO2 and GP3 block devices + // Throughput settings are only valid on GP3 block devices // https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/create-volume.html switch aws.StringValue(volumeType) { case ec2.VolumeTypeIo1, ec2.VolumeTypeIo2, ec2.VolumeTypeGp3: @@ -325,6 +326,9 @@ func getBlockDeviceMappings(machine runtimeclient.ObjectKey, blockDeviceMappingS if blockDeviceMappingSpec.EBS.Iops != nil && *blockDeviceMappingSpec.EBS.Iops > 0 { blockDeviceMapping.Ebs.Iops = blockDeviceMappingSpec.EBS.Iops } + if volumeType == ec2.VolumeTypeGp3 && blockDeviceMappingSpec.EBS.ThroughputMib != nil && *blockDeviceMappingSpec.EBS.ThroughputMib > 0 { + blockDeviceMapping.Ebs.Throughput = blockDeviceMappingSpec.EBS.ThroughputMib + } } if aws.StringValue(blockDeviceMappingSpec.EBS.KMSKey.ID) != "" {