Skip to content

Commit

Permalink
chore(ec2): replace latestAmazonLinux with latestAmazonLinux2 used in…
Browse files Browse the repository at this point in the history
…side 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*
  • Loading branch information
clueleaf authored Jul 10, 2023
1 parent c8edc87 commit f9a1192
Show file tree
Hide file tree
Showing 8 changed files with 112 additions and 86 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"version": "21.0.0",
"version": "32.0.0",
"files": {
"d9d2cb111f211504d3d3b1b90cf33d2a124047f2b2621f6b695851e1226d322a": {
"a199e8eb329a5d9963b37d63e0ed1df710a2d45d2f208f121329f7325f8a4861": {
"source": {
"path": "TestStack.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "d9d2cb111f211504d3d3b1b90cf33d2a124047f2b2621f6b695851e1226d322a.json",
"objectKey": "a199e8eb329a5d9963b37d63e0ed1df710a2d45d2f208f121329f7325f8a4861.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@
"Ref": "BastionHostInstanceProfile770FCA07"
},
"ImageId": {
"Ref": "SsmParameterValueawsserviceamiamazonlinuxlatestamzn2amihvmarm64gp2C96584B6F00A464EAD1953AFF4B05118Parameter"
"Ref": "SsmParameterValueawsserviceamiamazonlinuxlatestamzn2amikernel510hvmarm64gp2C96584B6F00A464EAD1953AFF4B05118Parameter"
},
"InstanceType": "t4g.nano",
"SecurityGroupIds": [
Expand Down Expand Up @@ -525,9 +525,9 @@
}
},
"Parameters": {
"SsmParameterValueawsserviceamiamazonlinuxlatestamzn2amihvmarm64gp2C96584B6F00A464EAD1953AFF4B05118Parameter": {
"SsmParameterValueawsserviceamiamazonlinuxlatestamzn2amikernel510hvmarm64gp2C96584B6F00A464EAD1953AFF4B05118Parameter": {
"Type": "AWS::SSM::Parameter::Value<AWS::EC2::Image::Id>",
"Default": "/aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-arm64-gp2"
"Default": "/aws/service/ami-amazon-linux-latest/amzn2-ami-kernel-5.10-hvm-arm64-gp2"
},
"BootstrapVersion": {
"Type": "AWS::SSM::Parameter::Value<String>",
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"20.0.0"}
{"version":"32.0.0"}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "21.0.0",
"version": "32.0.0",
"testCases": {
"integ.bastion-host-arm-support": {
"stacks": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
{
"version": "21.0.0",
"version": "32.0.0",
"artifacts": {
"Tree": {
"type": "cdk:tree",
"properties": {
"file": "tree.json"
}
},
"TestStack.assets": {
"type": "cdk:asset-manifest",
"properties": {
Expand All @@ -23,7 +17,7 @@
"validateOnSynth": false,
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/d9d2cb111f211504d3d3b1b90cf33d2a124047f2b2621f6b695851e1226d322a.json",
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/a199e8eb329a5d9963b37d63e0ed1df710a2d45d2f208f121329f7325f8a4861.json",
"requiresBootstrapStackVersion": 6,
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
"additionalDependencies": [
Expand Down Expand Up @@ -204,7 +198,10 @@
"/TestStack/BastionHost/Resource/Resource": [
{
"type": "aws:cdk:logicalId",
"data": "BastionHost30F9ED05"
"data": "BastionHost30F9ED05",
"trace": [
"!!DESTRUCTIVE_CHANGES: WILL_REPLACE"
]
}
],
"/TestStack/BastionHost/BastionHostId": [
Expand All @@ -213,10 +210,10 @@
"data": "BastionHostBastionHostIdC743CBD6"
}
],
"/TestStack/SsmParameterValue:--aws--service--ami-amazon-linux-latest--amzn2-ami-hvm-arm64-gp2:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": [
"/TestStack/SsmParameterValue:--aws--service--ami-amazon-linux-latest--amzn2-ami-kernel-5.10-hvm-arm64-gp2:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": [
{
"type": "aws:cdk:logicalId",
"data": "SsmParameterValueawsserviceamiamazonlinuxlatestamzn2amihvmarm64gp2C96584B6F00A464EAD1953AFF4B05118Parameter"
"data": "SsmParameterValueawsserviceamiamazonlinuxlatestamzn2amikernel510hvmarm64gp2C96584B6F00A464EAD1953AFF4B05118Parameter"
}
],
"/TestStack/BootstrapVersion": [
Expand All @@ -233,6 +230,12 @@
]
},
"displayName": "TestStack"
},
"Tree": {
"type": "cdk:tree",
"properties": {
"file": "tree.json"
}
}
}
}
Loading

0 comments on commit f9a1192

Please sign in to comment.