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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.