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

feat(ec2): add aspect to require imdsv2 #16051

Merged
merged 4 commits into from Oct 20, 2021

Conversation

jericht
Copy link
Contributor

@jericht jericht commented Aug 13, 2021

Partially fixes: #5137
Related PR: #16052

Note: This PR and the above related PR have common code that has been duplicated across these two PRs because I decided it made more sense for these Aspects to be in the same package with the constructs they work with. However, it means I had to duplicate some of the base class code across the two PRs. Looking for an opinion on what's better here:

  • Should we keep it as is (2 PRs) so these Aspects are cleanly separated? or,
  • Does it make sense to either combine them in some way (e.g. a new package @aws-cdk/aspects) or have one reference the other (maybe the AutoScalingGroup aspect can reference the code in this PR since it already depends on this package).

Changes

Adds an aspect that can enable/disable IMDSv1 on Instances and Launch Templates.

Testing

Added unit tests


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 Aug 13, 2021

@jericht jericht force-pushed the jericht/ec2_imdsv1_aspect branch 2 times, most recently from 4e39bd4 to d95bbae Compare August 13, 2021 23:23
@peterwoodworth peterwoodworth added effort/small Small work item – less than a day of effort @aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud p2 labels Aug 19, 2021
@jericht
Copy link
Contributor Author

jericht commented Sep 9, 2021

@njlynch I've rebased these changes and they are ready for review. Would you be able to take a look?

Copy link
Contributor

@rix0rrr rix0rrr left a comment

Choose a reason for hiding this comment

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

I don't mind the code duplication, but I would appreciate naming consistency. Let's name it requireImdsv2 here as well.

mergify bot pushed a commit that referenced this pull request Oct 19, 2021
Partially fixes: #5137
Related PR: #16051

**Note:** I have some concerns about duplicated code between this and the above linked PR. Please see that PR for more details.

### Changes
Adds an aspect that can enable/disable IMDSv1 on AutoScalingGroups

### Testing
Added unit tests

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@mergify mergify bot dismissed rix0rrr’s stale review October 20, 2021 00:24

Pull request has been modified.

@jericht jericht requested a review from rix0rrr October 20, 2021 02:27
@rix0rrr rix0rrr changed the title feat(aws-ec2): add aspect to enable/disable imdsv1 feat(ec2): add aspect to require imdsv2 Oct 20, 2021
@mergify
Copy link
Contributor

mergify bot commented Oct 20, 2021

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

@njlynch njlynch assigned rix0rrr and unassigned njlynch Oct 20, 2021
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject89A8053A-LhjRyN9kxr8o
  • Commit ID: 8baca4f
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@mergify mergify bot merged commit 0947b21 into aws:master Oct 20, 2021
@mergify
Copy link
Contributor

mergify bot commented Oct 20, 2021

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

TikiTDO pushed a commit to TikiTDO/aws-cdk that referenced this pull request Feb 21, 2022
Partially fixes: aws#5137
Related PR: aws#16051

**Note:** I have some concerns about duplicated code between this and the above linked PR. Please see that PR for more details.

### Changes
Adds an aspect that can enable/disable IMDSv1 on AutoScalingGroups

### Testing
Added unit tests

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
TikiTDO pushed a commit to TikiTDO/aws-cdk that referenced this pull request Feb 21, 2022
Partially fixes: aws#5137
Related PR: aws#16052

**Note:** This PR and the above related PR have common code that has been duplicated across these two PRs because I decided it made more sense for these Aspects to be in the same package with the constructs they work with. However, it means I had to duplicate some of the base class code across the two PRs. Looking for an opinion on what's better here:
- Should we keep it as is (2 PRs) so these Aspects are cleanly separated? or,
- Does it make sense to either combine them in some way (e.g. a new package `@aws-cdk/aspects`) or have one reference the other (maybe the AutoScalingGroup aspect can reference the code in this PR since it already depends on this package).

### Changes
Adds an aspect that can enable/disable IMDSv1 on Instances and Launch Templates.

### Testing
Added unit tests

----

*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
@aws-cdk/aws-ec2 Related to Amazon Elastic Compute Cloud effort/small Small work item – less than a day of effort p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support setting EC2 instance metadata to require token (IMDSv2)
5 participants