Skip to content

Change ECR to use TF official module#151

Merged
ronkq merged 1 commit into
tf-opt-official-iam-modulefrom
tf-opt-official-ecr-module
Jul 13, 2026
Merged

Change ECR to use TF official module#151
ronkq merged 1 commit into
tf-opt-official-iam-modulefrom
tf-opt-official-ecr-module

Conversation

@ronkq

@ronkq ronkq commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Change ECR provisioning to use TF official module.
When moving to use official modules we can't customize them, so some resources could be removed.
In terms of terraform state, terragrunt will consider it as a new module, where we will import the cloud resources to, and make sure the plan is without any changes, to keep our code aligned to the existing cloud resources. At this point we'll have 2 different terragrunt modules "owning" the same cloud resources, after which we will remove the old module references from the state.

@PaulLaux PaulLaux left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. In testnet-single-node-deploy/infra/terragrunt-aws-environments/dev/eu-central-1/zsa/ecs-swaps/terragrunt.hcl we have image = "${dependency.ecr.outputs.ecr-url}:latest" but we no longer have outputs.ecr-url. You deleted it in this PR. Same for infra/terragrunt-aws-environments/dev/eu-central-1/zsa/ecs/terragrunt.hcl and infra/terragrunt-aws-environments/dev/eu-central-1/zsa/lambda/lambda/terragrunt.hcl

  2. changing to

terraform {
  source = "git::https://github.com/terraform-aws-modules/terraform-aws-ecr.git?ref=v2.4.0"
}

together with force_delete = true will remove the old module (the id has changes) together with all previous images. Is that what we want?

  1. This PR should be applied after #150 (dependant on cicd-user changes). A better way is to point this PR on top 150 to force order.

@ronkq
ronkq changed the base branch from zsa1 to tf-opt-official-iam-module July 9, 2026 08:43
@ronkq

ronkq commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author
  1. In testnet-single-node-deploy/infra/terragrunt-aws-environments/dev/eu-central-1/zsa/ecs-swaps/terragrunt.hcl we have image = "${dependency.ecr.outputs.ecr-url}:latest" but we no longer have outputs.ecr-url. You deleted it in this PR. Same for infra/terragrunt-aws-environments/dev/eu-central-1/zsa/ecs/terragrunt.hcl and infra/terragrunt-aws-environments/dev/eu-central-1/zsa/lambda/lambda/terragrunt.hcl
  2. changing to
terraform {
  source = "git::https://github.com/terraform-aws-modules/terraform-aws-ecr.git?ref=v2.4.0"
}

together with force_delete = true will remove the old module (the id has changes) together with all previous images. Is that what we want?

  1. This PR should be applied after Change CICD GH IAM user to use TF official module #150 (dependant on cicd-user changes). A better way is to point this PR on top 150 to force order.
  1. There will be also adjustments to ECS
  2. We will not destroy or apply the modules before doing state import, and seeing that there are no changes.
  3. Changed

@ronkq
ronkq merged commit eeb826b into tf-opt-official-iam-module Jul 13, 2026
4 checks passed
@ronkq
ronkq deleted the tf-opt-official-ecr-module branch July 13, 2026 19:15
ronkq added a commit that referenced this pull request Jul 14, 2026
* Change CICD GH IAM user to use TF official module

* Change ECR to use TF official module (#151)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants