Skip to content

Commit 46ac6fa

Browse files
authored
Merge pull request #1574 from buildkite/SUP-4693-cpu-credits-parameter
Configurable CpuCredits parameter for T-class instances
2 parents 4320575 + aad204d commit 46ac6fa

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

templates/aws-stack.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ Metadata:
8181
- ImageIdParameter
8282
- InstanceOperatingSystem
8383
- InstanceTypes
84+
- CpuCredits
8485
- EnableInstanceStorage
8586
- MountTmpfsAtTmp
8687
- AgentsPerInstance
@@ -541,6 +542,14 @@ Parameters:
541542
AllowedPattern: "^[\\w-\\.]+(,[\\w-\\.]*){0,24}$"
542543
ConstraintDescription: "must contain 1-25 instance types separated by commas. No space before/after the comma."
543544

545+
CpuCredits:
546+
Description: Credit option for CPU usage of burstable instances. Sets the CreditSpecification.CpuCredits property in the LaunchTemplate for T-class instance types (t2, t3, t3a, t4g).
547+
Type: String
548+
AllowedValues:
549+
- standard
550+
- unlimited
551+
Default: "unlimited"
552+
544553
MaxSize:
545554
Description: Maximum number of instances
546555
Type: Number
@@ -1163,6 +1172,13 @@ Conditions:
11631172
- !Equals [ !Select [ 0, !Split [ ".", !Ref InstanceTypes ] ], "t4g" ]
11641173
- !Equals [ !Select [ 0, !Split [ ".", !Ref InstanceTypes ] ], "x2gd" ]
11651174

1175+
UsingBurstableInstances:
1176+
!Or
1177+
- !Equals [ !Select [ 0, !Split [ ".", !Ref InstanceTypes ] ], "t2" ]
1178+
- !Equals [ !Select [ 0, !Split [ ".", !Ref InstanceTypes ] ], "t3" ]
1179+
- !Equals [ !Select [ 0, !Split [ ".", !Ref InstanceTypes ] ], "t3a" ]
1180+
- !Equals [ !Select [ 0, !Split [ ".", !Ref InstanceTypes ] ], "t4g" ]
1181+
11661182
UseStackNameForInstanceName:
11671183
!Equals [ !Ref InstanceName, "" ]
11681184

@@ -1699,6 +1715,10 @@ Resources:
16991715
Encrypted: !Ref RootVolumeEncrypted
17001716
Throughput: !If [ IsRootVolumeIsGp3, !Ref RootVolumeThroughput, !Ref "AWS::NoValue" ]
17011717
Iops: !If [ IsRootVolumeIsIo1OrIo2OrGp3, !Ref RootVolumeIops, !Ref "AWS::NoValue" ]
1718+
CreditSpecification: !If
1719+
- UsingBurstableInstances
1720+
- CpuCredits: !Ref CpuCredits
1721+
- !Ref "AWS::NoValue"
17021722
TagSpecifications:
17031723
- ResourceType: instance
17041724
Tags:

0 commit comments

Comments
 (0)