Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pkg/actuators/machine/instances.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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) != "" {
Expand Down