aws / aws-toolkit-azure-devops

AWS Toolkit for Azure DevOps
Other
245 stars 104 forks source link

Error when execute CLI actions using eu-south-2 region #510

Open xente opened 1 year ago

xente commented 1 year ago

Describe the bug

I am trying to migrate our infrastructure from France to Spain but when I run the scripts next error appears

An error occurred (AuthFailure) when calling the DescribeRegions operation: AWS was not able to validate the provided access credentials

[error]Error: The process '/usr/local/bin/aws' failed with exit code 254

Using the same code but with the France region is working fine

To reproduce

Test1

  1. Go to the pipeline
  2. Create AWS CLI tasks
  3. Configure task AWS credentials: My credentials (The region eu-south-2 is enabled in this account) AWS Region selector: eu-south-2 did not appear then we did not populate it Command: ec2 Subcommand: describe-regions Options and parameters: --region eu-south-2

Test2

  1. Go to the pipeline
  2. Create AWS CLI tasks
  3. Configure task AWS credentials: My credentials (The region eu-south-2 is enabled in this account) AWS Region selector: eu-south-2 did not appear then we did not populate it Command: ec2 Subcommand: describe-regions Environment Variables: AWS_REGION=eu-south-2

Expected behavior

Connect to my account and list the describe-regions

Your Environment

Additional context

I have executed this command from my laptop with the same credentials using my CLI and it is working fine.

cesirx commented 1 month ago

@xente , make sure you make the sts assume-role call using a regional sts endpoint (or else it will use the default/global one and you will get a version 1 token, which is not valid for new regions).

It is all well described here: https://repost.aws/knowledge-center/iam-validate-access-credentials