Commit 872f550 1 parent e992010 commit 872f550 Copy full SHA for 872f550
File tree 2 files changed +18
-0
lines changed
2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -129,3 +129,12 @@ aws ssm get-command-invocation \
129
129
```
130
130
131
131
4 . Once the above command is executed successfully, the logs should be present in the S3 bucket specified in the previous step.
132
+
133
+ ### Collect User Data
134
+
135
+ If collecting user data is required as apart of troubleshooting please use the commands below to retrieve data via IMDSv2:
136
+
137
+ ```
138
+ TOKEN=`curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600"` \
139
+ && curl -H "X-aws-ec2-metadata-token: $TOKEN" -v http://169.254.169.254/latest/user-data
140
+ ```
Original file line number Diff line number Diff line change @@ -121,3 +121,12 @@ aws ssm get-command-invocation \
121
121
```
122
122
123
123
4 . Once the above command is executed successfully, the logs should be present in the S3 bucket specified in the previous step.
124
+
125
+ ### Collect User Data
126
+
127
+ If collecting use rdata is required as apart of troubleshooting please use the commands below to retrieve data via IMDSv2:
128
+
129
+ ```
130
+ [string]$token = Invoke-RestMethod -Headers @{"X-aws-ec2-metadata-token-ttl-seconds" = "21600"} -Method PUT -Uri http://169.254.169.254/latest/api/token
131
+ Invoke-RestMethod -Headers @{"X-aws-ec2-metadata-token" = $token} -Method GET -Uri http://169.254.169.254/latest/user-data
132
+ ```
You can’t perform that action at this time.
0 commit comments