Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

aws cli: invalid security token

I'm trying to create a reusable delegation set to use as whitelisted nameservers for my domains, using aws cli on Mac OS X. My AWS credentials (those of an IAM profile I created for that purpose with full administrator privileges, an location set to us-east-1) were correctly entered during setup and accepted by the system.

When entering the command

$ aws route53 create-reusable-delegation-set --caller-reference [CALLER-REFERENCE] --hosted-zone-id [HOSTED_ZONE] --generate-cli-skeleton

the request is successful and I get the response:

{
    "CallerReference": "", 
    "HostedZoneId": ""
}

But when I remove --generate-cli-skeleton and enter

aws route53 create-reusable-delegation-set --caller-reference [CALLER-REFERENCE] --hosted-zone-id [HOSTED_ZONE]

I get this:

An error occurred (InvalidClientTokenId) when calling the CreateReusableDelegationSet operation: The security token included in the request is invalid.

I reality, my IAM credentials, despite being valid, and despite the profile I am using (donaldjenkins) having full administrator privileges, are refused systematically in all aws services and for all commands, not just Route53.

I've been unable to pinpoint the cause of this despite extensive research. Any suggestions gratefully receieved.

like image 929
Donald Jenkins Avatar asked Sep 18 '26 11:09

Donald Jenkins


1 Answers

Deleting my credentials file (Linux, macOS, or Unix: ~/.aws Windows: %UserProfile%\.aws) then running aws configure again worked for me

like image 129
Inammathe Avatar answered Sep 20 '26 01:09

Inammathe