Skip to content

Commit 19f0e39

Browse files
justinmirMisterMX
andcommitted
feat(ec2): Add Throughput to EBSBlockDevice
Newer generation EBS block devices allow passing in a throughput parameter similar to IOPs. This adds that field to EBSBlockDevice and pipes it through to the AWS API request similar to IOPs. Signed-off-by: justin.miron <justin.miron@reddit.com> Signed-off-by: Maximilian Blatt (external expert on behalf of DB Netz) <maximilian.blatt-extern@deutschebahn.com> Co-authored-by: Maximilian Blatt (external expert on behalf of DB Netz) <maximilian.blatt-extern@deutschebahn.com> (rebase and change to "Throughput")
1 parent 2e94dd2 commit 19f0e39

5 files changed

Lines changed: 25 additions & 0 deletions

File tree

apis/ec2/manualv1alpha1/common.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,14 @@ type EBSBlockDevice struct {
172172
// it is not used in requests to create gp2, st1, sc1, or standard volumes.
173173
IOps *int32 `json:"iops,omitempty"`
174174

175+
// The throughput that the volume supports, in MiB/s.
176+
//
177+
// Constraints: Up to 1,000MiB/s for gp3 volumes.
178+
//
179+
// Condition: This parameter is optional and only used to create gp3 volumes;
180+
// it is not used in requests to create gp2, st1, sc1, io1, or standard volumes.
181+
Throughput *int32 `json:"throughput,omitempty"`
182+
175183
// Identifier (key ID, key alias, ID ARN, or alias ARN) for a customer managed
176184
// CMK under which the EBS volume is encrypted.
177185
//

apis/ec2/manualv1alpha1/zz_generated.deepcopy.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package/crds/ec2.aws.crossplane.io_instances.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,15 @@ spec:
239239
snapshotId:
240240
description: The ID of the snapshot.
241241
type: string
242+
throughput:
243+
description: "The throughput that the volume supports,
244+
in MiB/s. \n Constraints: Up to 1,000MiB/s for gp3
245+
volumes. \n Condition: This parameter is optional
246+
and only used to create gp3 volumes; it is not used
247+
in requests to create gp2, st1, sc1, io1, or standard
248+
volumes."
249+
format: int32
250+
type: integer
242251
volumeSize:
243252
description: "The size of the volume, in GiB. \n Default:
244253
If you're creating the volume from a snapshot and

pkg/clients/ec2/instance.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ func GenerateEC2BlockDeviceMappings(mappings []manualv1alpha1.BlockDeviceMapping
225225
DeleteOnTermination: bm.EBS.DeleteOnTermination,
226226
Encrypted: bm.EBS.Encrypted,
227227
Iops: bm.EBS.IOps,
228+
Throughput: bm.EBS.Throughput,
228229
KmsKeyId: bm.EBS.KmsKeyID,
229230
SnapshotId: bm.EBS.SnapshotID,
230231
VolumeSize: bm.EBS.VolumeSize,

pkg/clients/ec2/instance_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,7 @@ func TestGenerateEC2RunInstancesInput(t *testing.T) {
574574
DeleteOnTermination: aws.Bool(false),
575575
Encrypted: aws.Bool(false),
576576
IOps: aws.Int32(1),
577+
Throughput: aws.Int32(100),
577578
KmsKeyID: aws.String(keyName),
578579
SnapshotID: aws.String(snapshotID),
579580
VolumeSize: aws.Int32(1),
@@ -723,6 +724,7 @@ func TestGenerateEC2RunInstancesInput(t *testing.T) {
723724
DeleteOnTermination: aws.Bool(false),
724725
Encrypted: aws.Bool(false),
725726
Iops: aws.Int32(1),
727+
Throughput: aws.Int32(100),
726728
KmsKeyId: aws.String(keyName),
727729
SnapshotId: aws.String(snapshotID),
728730
VolumeSize: aws.Int32(1),

0 commit comments

Comments
 (0)