Skip to content

Commit

Permalink
Fix curl options passed (#7)
Browse files Browse the repository at this point in the history
Signed-off-by: Brian Menges <@mengesb>
  • Loading branch information
mengesb authored Mar 19, 2021
1 parent d3536e6 commit c07241a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions aws/aws-credentials.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ METADATA="${EC2_METADATA_MOCK:-http://169.254.169.254/2020-10-27/meta-data}"
# arn:aws:iam::896453262835:instance-profile/baskinc-role
function aws_instance_profile_arn() {
if command -v jq >/dev/null; then
curl -s --no-progress-meter "${METADATA}/iam/info" | jq -r .InstanceProfileArn
curl -s "${METADATA}/iam/info" | jq -r .InstanceProfileArn
else
curl -s --no-progress-meter "${METADATA}/iam/info" | sed -n -Ee 's/^[[:space:]]*"InstanceProfileArn": "(arn:aws:iam::[0-9]+:.*)",/\1/p'
curl -s "${METADATA}/iam/info" | sed -n -Ee 's/^[[:space:]]*"InstanceProfileArn": "(arn:aws:iam::[0-9]+:.*)",/\1/p'
fi
}

Expand Down Expand Up @@ -59,7 +59,7 @@ function aws_instance_profile_name() {
# "Expiration": "2020-04-02T00:49:51Z"
# }
function aws_credentials() {
curl -s --no-progress-meter "${METADATA}/iam/security-credentials/$(aws_instance_profile_name)"
curl -s "${METADATA}/iam/security-credentials/$(aws_instance_profile_name)"
}

# @description
Expand Down

0 comments on commit c07241a

Please sign in to comment.