Skip to content

Commit

Permalink
[#97] Introduce migration strategy for Terraform resource renaming
Browse files Browse the repository at this point in the history
This commit introduces a strategic approach to renaming Terraform
resources within our AWS infrastructure, moving from the legacy codename
"VVA" to the new project identifier "GovTool". The migration is
orchestrated through the addition of two new Terraform files:
`vva_to_govtool_migration_20240212.tf` in both the main Terraform
directory and within the `govtool-ec2` module. These files serve as a
temporary mechanism to facilitate a seamless transition of resource and
module names across the infrastructure.

Key Highlights:
- The migration files outline a series of `moved` directives, explicitly
  mapping old resource and module identifiers to their new names. This
  approach ensures Terraform can manage the renaming process efficiently,
  minimizing the risk of resource duplication or loss.
- The migration is carefully planned to ensure no disruption to the
  ongoing operations, preserving the state of resources and their
  configurations throughout the process.
- A note within each migration file indicates their temporary nature,
  with instructions to remove these files once all stakeholders have
  successfully applied the migration. This step is crucial to prevent
  clutter in the Terraform codebase and maintain the integrity of the
  infrastructure as code practices. The migration files should be
  removed before project goes open source.

This renaming initiative is a critical component of our broader
rebranding efforts, reflecting the project's evolution and aligning our
infrastructure with the new brand identity.
  • Loading branch information
placek authored and MSzalowski committed Feb 23, 2024
1 parent ef26bc4 commit cb4bace
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# FIXME This Terraform file in question is designed to migrate resource and
# module names, serving as a transitional tool to ensure consistent naming
# conventions across the infrastructure. Once it is confirmed that all users
# have applied this migration, the file can be safely removed in the future to
# maintain clarity and efficiency in the codebase.

moved {
from = aws_instance.vva
to = aws_instance.govtool
}

moved {
from = aws_eip.vva
to = aws_eip.govtool
}
35 changes: 35 additions & 0 deletions infra/terraform/vva_to_govtool_migration_20240212.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# FIXME This Terraform file in question is designed to migrate resource and
# module names, serving as a transitional tool to ensure consistent naming
# conventions across the infrastructure. Once it is confirmed that all users
# have applied this migration, the file can be safely removed in the future to
# maintain clarity and efficiency in the codebase.

moved {
from = module.vva-ecr-be
to = module.govtool-ecr-backend
}

moved {
from = module.vva-ecr-fe
to = module.govtool-ecr-frontend
}

moved {
from = module.vva-dev-sanchonet
to = module.govtool-dev-sanchonet
}

moved {
from = module.vva-test-sanchonet
to = module.govtool-test-sanchonet
}

moved {
from = module.vva-staging-sanchonet
to = module.govtool-staging-sanchonet
}

moved {
from = module.vva-beta-sanchonet
to = module.govtool-beta-sanchonet
}

0 comments on commit cb4bace

Please sign in to comment.