Skip to content

Commit ff21c69

Browse files
authored
feat(autoscaling): deprecate launch configurations (under feature flag) (#25910)
This PR focuses on supporting the deprecation of launch configurations when creating an auto scaling group. All new accounts created after December 31, 2023 will no longer be able to create launch configurations. An equivalent launch template will now be created by the AutoScalingGroup construct instead of a launch configuration. Closes #23165 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 212b81b commit ff21c69

File tree

294 files changed

+21560
-9176
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

294 files changed

+21560
-9176
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling-hooktargets/test/integ.queue-hook.js.snapshot/asset.36618132bd37b6b15f9987b57ad1fbf613f1ad937aec72381232b163ed9c44c4.bundle/index.js

+1,296
Large diffs are not rendered by default.

packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling-hooktargets/test/integ.queue-hook.js.snapshot/asset.b54b99043c35bd080b9d9d1afce31e3541cf15b679799ba980ed40c837dcb03b.bundle/index.js

-768
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"version":"21.0.0"}
1+
{"version":"32.0.0"}

packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling-hooktargets/test/integ.queue-hook.js.snapshot/integ-autoscalinghook-queue.assets.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
2-
"version": "21.0.0",
2+
"version": "32.0.0",
33
"files": {
4-
"8a3db2dee171afc18cb3c206a03f7f70b4bda8fd9614c0da580b2f78810392fa": {
4+
"2841832c06c010f8f491de8a2e5357d55f766b91e8f708a0be48f2aec8a8cc59": {
55
"source": {
66
"path": "integ-autoscalinghook-queue.template.json",
77
"packaging": "file"
88
},
99
"destinations": {
1010
"current_account-current_region": {
1111
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
12-
"objectKey": "8a3db2dee171afc18cb3c206a03f7f70b4bda8fd9614c0da580b2f78810392fa.json",
12+
"objectKey": "2841832c06c010f8f491de8a2e5357d55f766b91e8f708a0be48f2aec8a8cc59.json",
1313
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
1414
}
1515
}

packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling-hooktargets/test/integ.queue-hook.js.snapshot/integ-autoscalinghook-queue.template.json

+69-20
Original file line numberDiff line numberDiff line change
@@ -451,27 +451,68 @@
451451
]
452452
}
453453
},
454-
"GroupLaunchConfigEA6271FF": {
455-
"Type": "AWS::AutoScaling::LaunchConfiguration",
454+
"GroupLaunchTemplate9C55CCE4": {
455+
"Type": "AWS::EC2::LaunchTemplate",
456456
"Properties": {
457-
"ImageId": {
458-
"Ref": "al2022AMIParameter"
459-
},
460-
"InstanceType": "t3.small",
461-
"IamInstanceProfile": {
462-
"Ref": "GroupInstanceProfileA2F3B693"
457+
"LaunchTemplateData": {
458+
"IamInstanceProfile": {
459+
"Arn": {
460+
"Fn::GetAtt": [
461+
"GroupInstanceProfileA2F3B693",
462+
"Arn"
463+
]
464+
}
465+
},
466+
"ImageId": {
467+
"Ref": "al2023AMIParameter"
468+
},
469+
"InstanceType": "t3.small",
470+
"Monitoring": {
471+
"Enabled": false
472+
},
473+
"SecurityGroupIds": [
474+
{
475+
"Fn::GetAtt": [
476+
"GroupInstanceSecurityGroupBAF83E2C",
477+
"GroupId"
478+
]
479+
}
480+
],
481+
"TagSpecifications": [
482+
{
483+
"ResourceType": "instance",
484+
"Tags": [
485+
{
486+
"Key": "Name",
487+
"Value": "integ-autoscalinghook-queue/Group/LaunchTemplate"
488+
}
489+
]
490+
},
491+
{
492+
"ResourceType": "volume",
493+
"Tags": [
494+
{
495+
"Key": "Name",
496+
"Value": "integ-autoscalinghook-queue/Group/LaunchTemplate"
497+
}
498+
]
499+
}
500+
],
501+
"UserData": {
502+
"Fn::Base64": "#!/bin/bash"
503+
}
463504
},
464-
"SecurityGroups": [
505+
"TagSpecifications": [
465506
{
466-
"Fn::GetAtt": [
467-
"GroupInstanceSecurityGroupBAF83E2C",
468-
"GroupId"
507+
"ResourceType": "launch-template",
508+
"Tags": [
509+
{
510+
"Key": "Name",
511+
"Value": "integ-autoscalinghook-queue/Group/LaunchTemplate"
512+
}
469513
]
470514
}
471-
],
472-
"UserData": {
473-
"Fn::Base64": "#!/bin/bash"
474-
}
515+
]
475516
},
476517
"DependsOn": [
477518
"GroupInstanceRole918A2AF7"
@@ -482,8 +523,16 @@
482523
"Properties": {
483524
"MaxSize": "1",
484525
"MinSize": "0",
485-
"LaunchConfigurationName": {
486-
"Ref": "GroupLaunchConfigEA6271FF"
526+
"LaunchTemplate": {
527+
"LaunchTemplateId": {
528+
"Ref": "GroupLaunchTemplate9C55CCE4"
529+
},
530+
"Version": {
531+
"Fn::GetAtt": [
532+
"GroupLaunchTemplate9C55CCE4",
533+
"LatestVersionNumber"
534+
]
535+
}
487536
},
488537
"Tags": [
489538
{
@@ -587,9 +636,9 @@
587636
}
588637
},
589638
"Parameters": {
590-
"al2022AMIParameter": {
639+
"al2023AMIParameter": {
591640
"Type": "AWS::SSM::Parameter::Value<String>",
592-
"Default": "/aws/service/ami-amazon-linux-latest/al2022-ami-kernel-default-x86_64"
641+
"Default": "/aws/service/ami-amazon-linux-latest/al2023-ami-kernel-6.1-x86_64"
593642
},
594643
"BootstrapVersion": {
595644
"Type": "AWS::SSM::Parameter::Value<String>",

packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling-hooktargets/test/integ.queue-hook.js.snapshot/integ.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "21.0.0",
2+
"version": "32.0.0",
33
"testCases": {
44
"queue-hook-test/DefaultTest": {
55
"stacks": [

packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling-hooktargets/test/integ.queue-hook.js.snapshot/manifest.json

+38-29
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
{
2-
"version": "21.0.0",
2+
"version": "32.0.0",
33
"artifacts": {
4-
"Tree": {
5-
"type": "cdk:tree",
6-
"properties": {
7-
"file": "tree.json"
8-
}
9-
},
104
"integ-autoscalinghook-queue.assets": {
115
"type": "cdk:asset-manifest",
126
"properties": {
@@ -23,7 +17,7 @@
2317
"validateOnSynth": false,
2418
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
2519
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
26-
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/8a3db2dee171afc18cb3c206a03f7f70b4bda8fd9614c0da580b2f78810392fa.json",
20+
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/2841832c06c010f8f491de8a2e5357d55f766b91e8f708a0be48f2aec8a8cc59.json",
2721
"requiresBootstrapStackVersion": 6,
2822
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
2923
"additionalDependencies": [
@@ -201,10 +195,10 @@
201195
"data": "GroupInstanceProfileA2F3B693"
202196
}
203197
],
204-
"/integ-autoscalinghook-queue/Group/LaunchConfig": [
198+
"/integ-autoscalinghook-queue/Group/LaunchTemplate/Resource": [
205199
{
206200
"type": "aws:cdk:logicalId",
207-
"data": "GroupLaunchConfigEA6271FF"
201+
"data": "GroupLaunchTemplate9C55CCE4"
208202
}
209203
],
210204
"/integ-autoscalinghook-queue/Group/ASG": [
@@ -231,10 +225,10 @@
231225
"data": "GroupLifecycleHookscaleoutB603BFDE"
232226
}
233227
],
234-
"/integ-autoscalinghook-queue/al2022AMI.Parameter": [
228+
"/integ-autoscalinghook-queue/al2023AMI.Parameter": [
235229
{
236230
"type": "aws:cdk:logicalId",
237-
"data": "al2022AMIParameter"
231+
"data": "al2023AMIParameter"
238232
}
239233
],
240234
"/integ-autoscalinghook-queue/Exports/Output{\"Ref\":\"GroupASG3C6DFE3B\"}": [
@@ -266,6 +260,15 @@
266260
"type": "aws:cdk:logicalId",
267261
"data": "CheckBootstrapVersion"
268262
}
263+
],
264+
"GroupLaunchConfigEA6271FF": [
265+
{
266+
"type": "aws:cdk:logicalId",
267+
"data": "GroupLaunchConfigEA6271FF",
268+
"trace": [
269+
"!!DESTRUCTIVE_CHANGES: WILL_DESTROY"
270+
]
271+
}
269272
]
270273
},
271274
"displayName": "integ-autoscalinghook-queue"
@@ -286,7 +289,7 @@
286289
"validateOnSynth": false,
287290
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
288291
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
289-
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/bdae540cd4baafd04bde1c5823b5c218b9a79b8d856a8e9a26151bedc547eacd.json",
292+
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/940d95f17af77e9d69bcd9a1d814bb63fb2753cb03fd1511bc6ea493b5f88f4c.json",
290293
"requiresBootstrapStackVersion": 6,
291294
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
292295
"additionalDependencies": [
@@ -303,10 +306,10 @@
303306
"queuehooktestDefaultTestDeployAssertCF5493DF.assets"
304307
],
305308
"metadata": {
306-
"/queue-hook-test/DefaultTest/DeployAssert/AwsApiCallAutoScalingsetDesiredCapacity/Default/Default": [
309+
"/queue-hook-test/DefaultTest/DeployAssert/AwsApiCallAutoScalingsetDesiredCapacity8d10985ccf5843cdfedb03afd84a535c/Default/Default": [
307310
{
308311
"type": "aws:cdk:logicalId",
309-
"data": "AwsApiCallAutoScalingsetDesiredCapacity"
312+
"data": "AwsApiCallAutoScalingsetDesiredCapacity8d10985ccf5843cdfedb03afd84a535c"
310313
}
311314
],
312315
"/queue-hook-test/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Role": [
@@ -321,40 +324,40 @@
321324
"data": "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F"
322325
}
323326
],
324-
"/queue-hook-test/DefaultTest/DeployAssert/AwsApiCallSQSreceiveMessage/Default/Default": [
327+
"/queue-hook-test/DefaultTest/DeployAssert/AwsApiCallSQSreceiveMessage1a19058edc984d85e0beb02f98d0d6ff/Default/Default": [
325328
{
326329
"type": "aws:cdk:logicalId",
327-
"data": "AwsApiCallSQSreceiveMessage"
330+
"data": "AwsApiCallSQSreceiveMessage1a19058edc984d85e0beb02f98d0d6ff"
328331
}
329332
],
330-
"/queue-hook-test/DefaultTest/DeployAssert/AwsApiCallSQSreceiveMessage/WaitFor/IsCompleteProvider/Invoke": [
333+
"/queue-hook-test/DefaultTest/DeployAssert/AwsApiCallSQSreceiveMessage1a19058edc984d85e0beb02f98d0d6ff/WaitFor/IsCompleteProvider/Invoke": [
331334
{
332335
"type": "aws:cdk:logicalId",
333-
"data": "AwsApiCallSQSreceiveMessageWaitForIsCompleteProviderInvoke92C9A498"
336+
"data": "AwsApiCallSQSreceiveMessage1a19058edc984d85e0beb02f98d0d6ffWaitForIsCompleteProviderInvokeCE4391E6"
334337
}
335338
],
336-
"/queue-hook-test/DefaultTest/DeployAssert/AwsApiCallSQSreceiveMessage/WaitFor/TimeoutProvider/Invoke": [
339+
"/queue-hook-test/DefaultTest/DeployAssert/AwsApiCallSQSreceiveMessage1a19058edc984d85e0beb02f98d0d6ff/WaitFor/TimeoutProvider/Invoke": [
337340
{
338341
"type": "aws:cdk:logicalId",
339-
"data": "AwsApiCallSQSreceiveMessageWaitForTimeoutProviderInvoke88C69E59"
342+
"data": "AwsApiCallSQSreceiveMessage1a19058edc984d85e0beb02f98d0d6ffWaitForTimeoutProviderInvokeCC645D0F"
340343
}
341344
],
342-
"/queue-hook-test/DefaultTest/DeployAssert/AwsApiCallSQSreceiveMessage/WaitFor/Role": [
345+
"/queue-hook-test/DefaultTest/DeployAssert/AwsApiCallSQSreceiveMessage1a19058edc984d85e0beb02f98d0d6ff/WaitFor/Role": [
343346
{
344347
"type": "aws:cdk:logicalId",
345-
"data": "AwsApiCallSQSreceiveMessageWaitForRole90A5ABAA"
348+
"data": "AwsApiCallSQSreceiveMessage1a19058edc984d85e0beb02f98d0d6ffWaitForRole6C943659"
346349
}
347350
],
348-
"/queue-hook-test/DefaultTest/DeployAssert/AwsApiCallSQSreceiveMessage/WaitFor/Resource": [
351+
"/queue-hook-test/DefaultTest/DeployAssert/AwsApiCallSQSreceiveMessage1a19058edc984d85e0beb02f98d0d6ff/WaitFor/Resource": [
349352
{
350353
"type": "aws:cdk:logicalId",
351-
"data": "AwsApiCallSQSreceiveMessageWaitFor10141935"
354+
"data": "AwsApiCallSQSreceiveMessage1a19058edc984d85e0beb02f98d0d6ffWaitForE9B0A8F0"
352355
}
353356
],
354-
"/queue-hook-test/DefaultTest/DeployAssert/AwsApiCallSQSreceiveMessage/AssertionResults": [
357+
"/queue-hook-test/DefaultTest/DeployAssert/AwsApiCallSQSreceiveMessage1a19058edc984d85e0beb02f98d0d6ff/AssertionResults": [
355358
{
356359
"type": "aws:cdk:logicalId",
357-
"data": "AssertionResultsAwsApiCallSQSreceiveMessage"
360+
"data": "AssertionResultsAwsApiCallSQSreceiveMessage1a19058edc984d85e0beb02f98d0d6ff"
358361
}
359362
],
360363
"/queue-hook-test/DefaultTest/DeployAssert/SingletonFunction76b3e830a873425f8453eddd85c86925/Role": [
@@ -381,10 +384,10 @@
381384
"data": "SingletonFunction5c1898e096fb4e3e95d5f6c67f3ce41aHandlerADF3E6EA"
382385
}
383386
],
384-
"/queue-hook-test/DefaultTest/DeployAssert/AwsApiCallAutoScalingcompleteLifecycleAction/Default/Default": [
387+
"/queue-hook-test/DefaultTest/DeployAssert/AwsApiCallAutoScalingcompleteLifecycleAction3b6f4a6668cc6de418d82d437885ddfb/Default/Default": [
385388
{
386389
"type": "aws:cdk:logicalId",
387-
"data": "AwsApiCallAutoScalingcompleteLifecycleAction"
390+
"data": "AwsApiCallAutoScalingcompleteLifecycleAction3b6f4a6668cc6de418d82d437885ddfb"
388391
}
389392
],
390393
"/queue-hook-test/DefaultTest/DeployAssert/BootstrapVersion": [
@@ -401,6 +404,12 @@
401404
]
402405
},
403406
"displayName": "queue-hook-test/DefaultTest/DeployAssert"
407+
},
408+
"Tree": {
409+
"type": "cdk:tree",
410+
"properties": {
411+
"file": "tree.json"
412+
}
404413
}
405414
}
406415
}

packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling-hooktargets/test/integ.queue-hook.js.snapshot/queuehooktestDefaultTestDeployAssertCF5493DF.assets.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
{
2-
"version": "21.0.0",
2+
"version": "32.0.0",
33
"files": {
4-
"b54b99043c35bd080b9d9d1afce31e3541cf15b679799ba980ed40c837dcb03b": {
4+
"36618132bd37b6b15f9987b57ad1fbf613f1ad937aec72381232b163ed9c44c4": {
55
"source": {
6-
"path": "asset.b54b99043c35bd080b9d9d1afce31e3541cf15b679799ba980ed40c837dcb03b.bundle",
6+
"path": "asset.36618132bd37b6b15f9987b57ad1fbf613f1ad937aec72381232b163ed9c44c4.bundle",
77
"packaging": "zip"
88
},
99
"destinations": {
1010
"current_account-current_region": {
1111
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
12-
"objectKey": "b54b99043c35bd080b9d9d1afce31e3541cf15b679799ba980ed40c837dcb03b.zip",
12+
"objectKey": "36618132bd37b6b15f9987b57ad1fbf613f1ad937aec72381232b163ed9c44c4.zip",
1313
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
1414
}
1515
}
1616
},
17-
"bdae540cd4baafd04bde1c5823b5c218b9a79b8d856a8e9a26151bedc547eacd": {
17+
"940d95f17af77e9d69bcd9a1d814bb63fb2753cb03fd1511bc6ea493b5f88f4c": {
1818
"source": {
1919
"path": "queuehooktestDefaultTestDeployAssertCF5493DF.template.json",
2020
"packaging": "file"
2121
},
2222
"destinations": {
2323
"current_account-current_region": {
2424
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
25-
"objectKey": "bdae540cd4baafd04bde1c5823b5c218b9a79b8d856a8e9a26151bedc547eacd.json",
25+
"objectKey": "940d95f17af77e9d69bcd9a1d814bb63fb2753cb03fd1511bc6ea493b5f88f4c.json",
2626
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
2727
}
2828
}

0 commit comments

Comments
 (0)