AWS ECR error when pushing image

I’m using the aws-ecr orb version 8.1.2 and running build-and-push-image
When the image is supposed to be pushed I get an error:

ERROR: unexpected status: 403 Forbidden

I made sure that the AWS account used has the required permissions, and I’m able to tag and push to ECR locally using the same credentials

There is likely something wrong with your permissions or credentials, the best way to debug this is to rebuild via SSH and poke around in the shell.

That is the weird thing. If I rebuild with SSH and manually call

docker push

It all works fine