Skip to content

Commit f9a1192

Browse files
authored
chore(ec2): replace latestAmazonLinux with latestAmazonLinux2 used inside BastionHostLinux (#26134)
Synthesizing `BastionHostLinux` generates the following warning: ``` [WARNING] aws-cdk-lib.aws_ec2.MachineImage#latestAmazonLinux is deprecated. use MachineImage.latestAmazonLinux2 instead This API will be removed in the next major release. ``` This PR replaces `latestAmazonLinux` used inside `BastionHostLinux` with `latestAmazonLinux2` to remove the warning. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent c8edc87 commit f9a1192

File tree

8 files changed

+112
-86
lines changed

8 files changed

+112
-86
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.bastion-host-arm-support.js.snapshot/TestStack.assets.json

Lines changed: 3 additions & 3 deletions
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-
"d9d2cb111f211504d3d3b1b90cf33d2a124047f2b2621f6b695851e1226d322a": {
4+
"a199e8eb329a5d9963b37d63e0ed1df710a2d45d2f208f121329f7325f8a4861": {
55
"source": {
66
"path": "TestStack.template.json",
77
"packaging": "file"
88
},
99
"destinations": {
1010
"current_account-current_region": {
1111
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
12-
"objectKey": "d9d2cb111f211504d3d3b1b90cf33d2a124047f2b2621f6b695851e1226d322a.json",
12+
"objectKey": "a199e8eb329a5d9963b37d63e0ed1df710a2d45d2f208f121329f7325f8a4861.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-ec2/test/integ.bastion-host-arm-support.js.snapshot/TestStack.template.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@
486486
"Ref": "BastionHostInstanceProfile770FCA07"
487487
},
488488
"ImageId": {
489-
"Ref": "SsmParameterValueawsserviceamiamazonlinuxlatestamzn2amihvmarm64gp2C96584B6F00A464EAD1953AFF4B05118Parameter"
489+
"Ref": "SsmParameterValueawsserviceamiamazonlinuxlatestamzn2amikernel510hvmarm64gp2C96584B6F00A464EAD1953AFF4B05118Parameter"
490490
},
491491
"InstanceType": "t4g.nano",
492492
"SecurityGroupIds": [
@@ -525,9 +525,9 @@
525525
}
526526
},
527527
"Parameters": {
528-
"SsmParameterValueawsserviceamiamazonlinuxlatestamzn2amihvmarm64gp2C96584B6F00A464EAD1953AFF4B05118Parameter": {
528+
"SsmParameterValueawsserviceamiamazonlinuxlatestamzn2amikernel510hvmarm64gp2C96584B6F00A464EAD1953AFF4B05118Parameter": {
529529
"Type": "AWS::SSM::Parameter::Value<AWS::EC2::Image::Id>",
530-
"Default": "/aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-arm64-gp2"
530+
"Default": "/aws/service/ami-amazon-linux-latest/amzn2-ami-kernel-5.10-hvm-arm64-gp2"
531531
},
532532
"BootstrapVersion": {
533533
"Type": "AWS::SSM::Parameter::Value<String>",
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"version":"20.0.0"}
1+
{"version":"32.0.0"}

packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.bastion-host-arm-support.js.snapshot/integ.json

Lines changed: 1 addition & 1 deletion
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
"integ.bastion-host-arm-support": {
55
"stacks": [

packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.bastion-host-arm-support.js.snapshot/manifest.json

Lines changed: 14 additions & 11 deletions
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
"TestStack.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}/d9d2cb111f211504d3d3b1b90cf33d2a124047f2b2621f6b695851e1226d322a.json",
20+
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/a199e8eb329a5d9963b37d63e0ed1df710a2d45d2f208f121329f7325f8a4861.json",
2721
"requiresBootstrapStackVersion": 6,
2822
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
2923
"additionalDependencies": [
@@ -204,7 +198,10 @@
204198
"/TestStack/BastionHost/Resource/Resource": [
205199
{
206200
"type": "aws:cdk:logicalId",
207-
"data": "BastionHost30F9ED05"
201+
"data": "BastionHost30F9ED05",
202+
"trace": [
203+
"!!DESTRUCTIVE_CHANGES: WILL_REPLACE"
204+
]
208205
}
209206
],
210207
"/TestStack/BastionHost/BastionHostId": [
@@ -213,10 +210,10 @@
213210
"data": "BastionHostBastionHostIdC743CBD6"
214211
}
215212
],
216-
"/TestStack/SsmParameterValue:--aws--service--ami-amazon-linux-latest--amzn2-ami-hvm-arm64-gp2:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": [
213+
"/TestStack/SsmParameterValue:--aws--service--ami-amazon-linux-latest--amzn2-ami-kernel-5.10-hvm-arm64-gp2:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": [
217214
{
218215
"type": "aws:cdk:logicalId",
219-
"data": "SsmParameterValueawsserviceamiamazonlinuxlatestamzn2amihvmarm64gp2C96584B6F00A464EAD1953AFF4B05118Parameter"
216+
"data": "SsmParameterValueawsserviceamiamazonlinuxlatestamzn2amikernel510hvmarm64gp2C96584B6F00A464EAD1953AFF4B05118Parameter"
220217
}
221218
],
222219
"/TestStack/BootstrapVersion": [
@@ -233,6 +230,12 @@
233230
]
234231
},
235232
"displayName": "TestStack"
233+
},
234+
"Tree": {
235+
"type": "cdk:tree",
236+
"properties": {
237+
"file": "tree.json"
238+
}
236239
}
237240
}
238241
}

0 commit comments

Comments
 (0)