Skip to content

Commit 527c9da

Browse files
committed
Configurable CpuCredits parameter for T-class instances
1 parent bd07f94 commit 527c9da

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
@@ -496,6 +497,14 @@ Parameters:
496497
AllowedPattern: "^[\\w-\\.]+(,[\\w-\\.]*){0,24}$"
497498
ConstraintDescription: "must contain 1-25 instance types separated by commas. No space before/after the comma."
498499

500+
CpuCredits:
501+
Description: Credit option for CPU usage of the instance.
502+
Type: String
503+
AllowedValues:
504+
- standard
505+
- unlimited
506+
Default: "unlimited"
507+
499508
MaxSize:
500509
Description: Maximum number of instances
501510
Type: Number
@@ -1118,6 +1127,13 @@ Conditions:
11181127
- !Equals [ !Select [ 0, !Split [ ".", !Ref InstanceTypes ] ], "t4g" ]
11191128
- !Equals [ !Select [ 0, !Split [ ".", !Ref InstanceTypes ] ], "x2gd" ]
11201129

1130+
UsingBurstableInstances:
1131+
!Or
1132+
- !Equals [ !Select [ 0, !Split [ ".", !Ref InstanceTypes ] ], "t2" ]
1133+
- !Equals [ !Select [ 0, !Split [ ".", !Ref InstanceTypes ] ], "t3" ]
1134+
- !Equals [ !Select [ 0, !Split [ ".", !Ref InstanceTypes ] ], "t3a" ]
1135+
- !Equals [ !Select [ 0, !Split [ ".", !Ref InstanceTypes ] ], "t4g" ]
1136+
11211137
UseStackNameForInstanceName:
11221138
!Equals [ !Ref InstanceName, "" ]
11231139

@@ -1651,6 +1667,10 @@ Resources:
16511667
Encrypted: !Ref RootVolumeEncrypted
16521668
Throughput: !If [ IsRootVolumeIsGp3, !Ref RootVolumeThroughput, !Ref "AWS::NoValue" ]
16531669
Iops: !If [ IsRootVolumeIsIo1OrIo2OrGp3, !Ref RootVolumeIops, !Ref "AWS::NoValue" ]
1670+
CreditSpecification: !If
1671+
- UsingBurstableInstances
1672+
- CpuCredits: !Ref CpuCredits
1673+
- !Ref "AWS::NoValue"
16541674
TagSpecifications:
16551675
- ResourceType: instance
16561676
Tags:

0 commit comments

Comments
 (0)