@@ -991,11 +991,13 @@ Resources:
991
991
$Env:ECR_PLUGIN_ENABLED="${EnableECRPlugin}"
992
992
$Env:DOCKER_LOGIN_PLUGIN_ENABLED="${EnableDockerLoginPlugin}"
993
993
$Env:AWS_REGION="${AWS::Region}"
994
+ $Env:BUILDKITE_WARM_POOL="${WarmPool}"
994
995
powershell -file C:\buildkite-agent\bin\bk-install-elastic-stack.ps1 >> C:\buildkite-agent\elastic-stack.log
995
996
</powershell>
996
997
- {
997
998
LocalSecretsBucket : !If [ CreateSecretsBucket, !Ref ManagedSecretsBucket, !Ref SecretsBucket ],
998
999
AgentTokenPath : !If [ UseCustomerManagedParameterPath, !Ref BuildkiteAgentTokenParameterStorePath, !Ref BuildkiteAgentTokenParameter ],
1000
+ WarmPool : !If [ UseWarmPool, "true", "false" ],
999
1001
}
1000
1002
- !Sub
1001
1003
- |
@@ -1038,11 +1040,13 @@ Resources:
1038
1040
DOCKER_LOGIN_PLUGIN_ENABLED="${EnableDockerLoginPlugin}" \
1039
1041
DOCKER_EXPERIMENTAL="${EnableDockerExperimental}" \
1040
1042
AWS_REGION="${AWS::Region}" \
1043
+ BUILDKITE_WARM_POOL="${WarmPool}" \
1041
1044
/usr/local/bin/bk-install-elastic-stack.sh
1042
1045
--==BOUNDARY==--
1043
1046
- {
1044
1047
LocalSecretsBucket : !If [ CreateSecretsBucket, !Ref ManagedSecretsBucket, !Ref SecretsBucket ],
1045
1048
AgentTokenPath : !If [ UseCustomerManagedParameterPath, !Ref BuildkiteAgentTokenParameterStorePath, !Ref BuildkiteAgentTokenParameter ],
1049
+ WarmPool : !If [ UseWarmPool, "true", "false" ],
1046
1050
}
1047
1051
1048
1052
AgentAutoScaleGroup :
@@ -1099,7 +1103,7 @@ Resources:
1099
1103
AutoScalingReplacingUpdate :
1100
1104
WillReplace : true
1101
1105
1102
- AsgWarmPool :
1106
+ WarmPool :
1103
1107
Type : AWS::AutoScaling::WarmPool
1104
1108
Condition : UseWarmPool
1105
1109
Properties :
@@ -1163,7 +1167,7 @@ Resources:
1163
1167
- Effect : Allow
1164
1168
Action : ssm:StartAutomationExecution
1165
1169
Resource :
1166
- - !Sub arn:${AWS::Partition}:ssm:${AWS::Region}:${AWS::AccountId}:automation-definition/${BootHookAutomation}:$DEFAULT
1170
+ - !If [ UseWarmPool, ! Sub arn:${AWS::Partition}:ssm:${AWS::Region}:${AWS::AccountId}:automation-definition/${BootHookAutomation}:$DEFAULT, !Ref "AWS::NoValue" ]
1167
1171
- !Sub arn:${AWS::Partition}:ssm:${AWS::Region}:${AWS::AccountId}:automation-definition/${ShutdownHookAutomation}:$DEFAULT
1168
1172
- !Sub arn:${AWS::Partition}:ssm:${AWS::Region}:${AWS::AccountId}:automation-definition/${SpotInteruptionAutomation}:$DEFAULT
1169
1173
- Effect : Allow
@@ -1210,6 +1214,7 @@ Resources:
1210
1214
1211
1215
BootHook :
1212
1216
Type : AWS::AutoScaling::LifecycleHook
1217
+ Condition : UseWarmPool
1213
1218
Properties :
1214
1219
AutoScalingGroupName : !Ref AgentAutoScaleGroup
1215
1220
LifecycleHookName : BootHook
@@ -1220,6 +1225,7 @@ Resources:
1220
1225
1221
1226
BootHookRule :
1222
1227
Type : AWS::Events::Rule
1228
+ Condition : UseWarmPool
1223
1229
Properties :
1224
1230
Description : !Sub Run the boot time AWS SSM Automation for ${BootHook}
1225
1231
EventPattern :
@@ -1241,6 +1247,7 @@ Resources:
1241
1247
1242
1248
BootHookAutomation :
1243
1249
Type : AWS::SSM::Document
1250
+ Condition : UseWarmPool
1244
1251
Properties :
1245
1252
DocumentType : Automation
1246
1253
Content :
0 commit comments