Following the guide here[1] the build get's stuck in the PRE_BUILD step, while running the following command: $(aws ecr get-login --region $AWS_DEFAULT_REGION --no-include-email)

The error being:

An error occurred (AccessDeniedException) when calling the GetAuthorizationToken operation: User: arn:aws:sts::651718025298:assumed-role/code-build-enroller-app-service-role/AWSCodeBuild-4134f4d2-c555-41b2-9493-e5ad2b3307f4 is not authorized to perform: ecr:GetAuthorizationToken on resource: *

Just need to attach the AmazonEC2ContainerRegistryFullAccess policy to the role created

[1]https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-cd-pipeline.html