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

Use IMDSv2 to get instance metadata #102

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rajeshfintech
Copy link

@rajeshfintech rajeshfintech commented Sep 17, 2022

Issue #95
Current version of script breaks when IMDSv2 is enforced on EC2 instances(
"InstanceMetadataOptions": {
"HttpTokens": "required",
} )

Description of changes:
To improve security, AWS recommend to use IMDSv2, the session-oriented communication to get instance metadata.https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-service.html. This change is backward compatible with IMDSv1.
Also updated the request to get the region using placement/region this feature was released by AWS on 2020-08-24 - https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-categories.html

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

To improve security, AWS recommend to use IMDSv2, the session-oriented communication to get instance metadata.https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-service.html. 
This change is backward compatible with IMDSv1.
Also updated the request to get the region using `placement/region` this feature was released by AWS on 2020-08-24 - https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-categories.html
rajeshfintech added a commit to rajeshfintech/aws-codedeploy-samples that referenced this pull request Sep 17, 2022
Issue #, if available:
This is similar to other PR on elbv2  aws-samples#102 
Current version of script breaks when IMDSv2 is enforced on EC2 instances(
"InstanceMetadataOptions": {
"HttpTokens": "required",
} )

Description of changes:
To improve security, AWS recommend to use IMDSv2, the session-oriented communication to get instance metadata.https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-service.html. This change is backward compatible with IMDSv1.
Also updated the request to get the region using placement/region this feature was released by AWS on 2020-08-24 - https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-categories.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant