2 Respostas
- Mais recentes
- Mais votos
- Mais comentários
0
Hello,
The problem is the jq
config, you need to add --raw-output
flag like this:
export AWS_ACCESS_KEY_ID="$(cat secrets | jq '.Credentials.AccessKeyId' --raw-output)"
export AWS_SECRET_ACCESS_KEY="$(cat secrets | jq '.Credentials.SecretAccessKey' --raw-output)"
export AWS_SESSION_TOKEN="$(cat secrets | jq '.Credentials.SessionToken' --raw-output)"
Otherwise, the environment variables get wrapped in ""
which does not work.
Hope it helps!
//Carl
respondido há 2 anos
0
Hello,
Errors like these could be due to issues with things like environment variables or ~/.aws/credentials conflicting in weird ways with IAM instance profiles. The cleanest test would be to unset the relevant environment variables first:
$ for var in AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN AWS_SECURITY_TOKEN ; do eval unset $var ; done
and also ensure that you have nothing in ~/.aws/config or ~/.aws/credentials, then rerun the test.
Let me know if this helps and what was the result by clicking Accept answer.
Conteúdo relevante
- Como uso a AWS CLI para chamar a operação AssumeRole e armazenar credenciais temporárias de usuário?AWS OFICIALAtualizada há um ano
- AWS OFICIALAtualizada há 2 meses
- AWS OFICIALAtualizada há 2 anos
Sorry I should clarify. This is running in a CI build so it always starts from a clean slate. I've tried using both the environment variables, and using
aws configure set key value
to set them, and both give the same results.