Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

AWS ECS Deploy pipe failing due to security token

R_D March 31, 2023

Upon attempting to deploy to ECS using the most up to date pipe(1.7.0), my pipeline fails due to this error

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

I've made sure to validate that the credentials are the correct ones. I am not running through OIDC

1 answer

1 vote
Riley Venable
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 3, 2023

The error "UnrecognizedClientException" when calling the RegisterTaskDefinition operation usually occurs due to invalid AWS access or secret key. Here are the steps you can follow to resolve the issue:

1. Check if the correct AWS access and secret keys are used in your Bitbucket Pipelines settings. Ensure there are no typos or extra spaces in the values.

2. If you are using an IAM user, ensure that it has programmatic access and the necessary permissions to execute the RegisterTaskDefinition action.

3. Check if the region specified in the AWS_DEFAULT_REGION variable is the same where your ECS cluster is located. If not, update the region to match your ECS cluster.

4. Try to regenerate your AWS access and secret keys and update them in the Bitbucket Pipelines settings.

5. Verify that there are no other AWS authentication methods in place, such as IAM roles or instance profiles, which may be interfering with your access keys.

6. If you are still facing the issue, try running the deployment script manually on your local machine using the same credentials and see if you get the same error. This will help isolate if the issue is with your credentials or the Bitbucket Pipelines environment. It is also worth noting that if you are not running through OIDC, you may need to use the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables instead of assuming an IAM role.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events