File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
static/files/dynamodb-opensearch-zetl/OpenSearchPipeline Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change 1
1
TOKEN=$( curl -s -X PUT " http://169.254.169.254/latest/api/token" -H " X-aws-ec2-metadata-token-ttl-seconds: 21600" )
2
- INSTANCE_ROLE=$( curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/)
2
+ INSTANCE_ROLE=$( curl -s -H " X-aws-ec2-metadata-token: $TOKEN " http://169.254.169.254/latest/meta-data/iam/security-credentials/)
3
3
RESULTS=$( curl -s -H " X-aws-ec2-metadata-token: $TOKEN " http://169.254.169.254/latest/meta-data/iam/security-credentials/${INSTANCE_ROLE} )
4
4
5
5
AccessKeyId=$( echo $RESULTS | jq -r ' .AccessKeyId' )
6
6
SecretAccessKey=$( echo $RESULTS | jq -r ' .SecretAccessKey' )
7
- Region=$( curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone | sed ' s/\(.*\)[a-z]/\1/' )
7
+ Region=$( curl -s -H " X-aws-ec2-metadata-token: $TOKEN " http://169.254.169.254/latest/meta-data/placement/availability-zone | sed ' s/\(.*\)[a-z]/\1/' )
8
8
Token=$( echo $RESULTS | jq -r ' .Token' )
9
9
Role=$( aws sts get-caller-identity | jq -r ' .Arn | sub("sts";"iam") | sub("assumed-role";"role") | sub("/i-[a-zA-Z0-9]+$";"")' )
10
10
You can’t perform that action at this time.
0 commit comments