Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ec2): replace latestAmazonLinux with latestAmazonLinux2 used inside BastionHostLinux #26134

Merged
merged 3 commits into from
Jul 10, 2023

Conversation

clueleaf
Copy link
Contributor

@clueleaf clueleaf commented Jun 27, 2023

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

@gitpod-io
Copy link

gitpod-io bot commented Jun 27, 2023

@github-actions github-actions bot added p2 valued-contributor [Pilot] contributed between 6-12 PRs to the CDK labels Jun 27, 2023
@aws-cdk-automation aws-cdk-automation requested a review from a team June 27, 2023 09:32
@clueleaf clueleaf changed the title chore(ec2): chore(ec2): replace latestAmazonLinux with latestAmazonLinux2 used inside BastionHostLinux Jun 27, 2023
@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Jun 27, 2023
Copy link
Contributor

@corymhall corymhall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@clueleaf thanks for creating this PR! It looks like changing the machine image results in a breaking change (the instance will be replaced) so this will have to be behind a feature flag.

If you are up for that then we should also make machineImage a required property and not default it for the user. Since we can't make it required from a type perspective we'll have to do it with a check inside the construct.

@corymhall corymhall removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Jun 29, 2023
@clueleaf
Copy link
Contributor Author

clueleaf commented Jun 29, 2023

@corymhall
Thanks for your review.
I'm not sure if we should call this a breaking change, because the document is already clarifying that the instance may be replaced on every deployment when we do not specify a machineImage.

* @default - An Amazon Linux 2 image which is kept up-to-date automatically (the instance
* may be replaced on every deployment) and already has SSM Agent installed.

corymhall
corymhall previously approved these changes Jun 30, 2023
Copy link
Contributor

@corymhall corymhall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if we should call this a breaking change, because the document is already clarifying that the instance may be replaced on every deployment when we do not specify a machineImage.

Good point!

@mergify
Copy link
Contributor

mergify bot commented Jun 30, 2023

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@clueleaf
Copy link
Contributor Author

@corymhall hi, will this PR get merged?

@mergify mergify bot dismissed corymhall’s stale review July 10, 2023 09:45

Pull request has been modified.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: dfcbf37
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify
Copy link
Contributor

mergify bot commented Jul 10, 2023

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit f9a1192 into aws:main Jul 10, 2023
@clueleaf clueleaf deleted the chore/bastion branch July 12, 2023 11:53
bmoffatt pushed a commit to bmoffatt/aws-cdk that referenced this pull request Jul 29, 2023
…side BastionHostLinux (aws#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*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p2 valued-contributor [Pilot] contributed between 6-12 PRs to the CDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants