aws-toolkit-azure-devops icon indicating copy to clipboard operation
aws-toolkit-azure-devops copied to clipboard

ECRPushImage and ECRPullImage Task is Not Able to Push Image in me-south-1 (Bahrain) region

Open amantcs opened this issue 2 years ago • 4 comments

Hi Team,

I am building an Azure DevOps pipeline to push a docker image to the ECR repository in the Bahrain region, however, I am able to push images to other regions but when I select Bahrain, it fails with the below error:

##[error]Error: Failed to obtain authorization token to log in to ECR, error: UnrecognizedClientException: The security token included in the request is invalid

This error we are getting only when we are selecting the Bahrain region in the task drop-down.

When manually trying to push the image it works fine from aws cli

Edit: I just tried PullImage task with Bahrain region, but got the same error. But when I used other regions, image pulled without any error. Not sure what is blocking this AWS Toolkit tasks to use Bahrain region.

amantcs avatar Dec 16 '22 14:12 amantcs

related: https://github.com/aws/aws-toolkit-azure-devops/issues/483

justinmk3 avatar Dec 16 '22 18:12 justinmk3

Hi @justinmk3 this issue is not related to #483 . In my case, permissions are working fine, but toolkit tasks are not working for Bahrain region only. I further checked that it is giving an error that the authorization token is not valid. I suspect that because the Bahrain region uses regional sts endpoint to generate the token, this extension is marking them invalid. It is only supporting the token generated from global endpoints. I may be wrong but please check this once. We have a compliance requirement to use the Bahrain region only. Thanks.

amantcs avatar Dec 19 '22 06:12 amantcs

we are also facing a similar issue for ap-south-1 (Mumbai) region.

jainanuj94 avatar Jan 31 '23 17:01 jainanuj94

I have a solution that worked for me here: https://github.com/aws/aws-toolkit-azure-devops/issues/547#issuecomment-2002664946

rowanfreeman-acutro avatar Mar 17 '24 23:03 rowanfreeman-acutro