I want to assume role then save its output in a variable and then use that variable to extract some credentials from it. But terraform is throwing an error.
#!/bin/sh
ASSUME_ROLE=$(aws sts assume-role --output json --role-arn arn:aws:iam::123123123123:role/SomeRole --role-session-name test --profile myprofile)
export AWS_ACCESS_KEY_ID=$(echo ${ASSUME_ROLE} | awk -F'"' '/AccessKeyId/{print $4}')
export AWS_SECRET_ACCESS_KEY=$(echo ${ASSUME_ROLE} | awk -F'"' '/SecretAccessKey/{print $4}')
export AWS_SESSION_TOKEN=$(echo ${ASSUME_ROLE} | awk -F'"' '/SessionToken/{print $4}')
aws --profile myprofile route53 create-vpc-association-authorization --hosted-zone-id abcd3245 --vpc VPCRegion=us-east-1,VPCId=vpc-123e123
aws route53 associate-vpc-with-hosted-zone --hosted-zone-id abcd3245 --vpc VPCRegion=us-east-1,VPCId=vpc-123e123
Here is the output
There is no variable named "ASSUME_ROLE"., and 2 other diagnostic(s)