Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
what
I create a new variable called deploy_stage_enabled, and then make dynamic the deploy stage of aws_codepipeline bitbucket and aws_codepipeline default
why
It allows you to create images without deploying them, which could be useful for creating dummy images. However, there's a catch-22 situation: when you create a service, you need an initial image that at least responds to the health path. But first, you need to run a pipeline, and the pipeline is not created before the service. Moreover, ECS (specially if you are using EC2) tends to cache images/references to those images, and if you always use the image with the 'latest' tag, you risk using an old image. To avoid this, it's good practice to tag your image twice (with 'latest' and a random tag). The idea behind this was to create a dummy image, pull it from my service module, and then push it with the correct tags to the ECR of the service (thereby making it the base image of the service). Then I would define my container as follows: