Commit 9a40f16
authored
Use IMDSv2 to get instance metadata -ELB
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.html1 parent 7b2c0d6 commit 9a40f16
1 file changed
+4
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
101 | | - | |
102 | | - | |
| 100 | + | |
| 101 | + | |
103 | 102 | | |
104 | 103 | | |
105 | 104 | | |
| |||
706 | 705 | | |
707 | 706 | | |
708 | 707 | | |
709 | | - | |
| 708 | + | |
| 709 | + | |
710 | 710 | | |
711 | 711 | | |
0 commit comments