We deploy our app that consists of a few microservices, and our docker images are stored in AWS ECR.
If I want to add a new service, I update my terraform so the service gets built, pushed to ECR and deploys to Fargate etc.
When I deploy to a different environment (DEV, TEST or PROD), the terraform deployment fails because the ECR doesn’t exist (it tries to pull the image for the new service from ECR).
So it is kind of a chicken-and-egg problem, I can’t deploy b/c the ECR doesn’t exist, and the ECR has to exist to publish the image to ECR for the new service.
What options are there to handle this type of situation?