Migrating Terraform state paths to Terragrunt #753
Unanswered
JCapriotti
asked this question in
How do I
Replies: 1 comment 1 reply
-
Hi @JCapriotti please see: https://github.com/orgs/gruntwork-io/discussions/229 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I am investigating Terragrunt by way of converting an existing Terraform structure. Everything is pretty straightforward, except for how to handle a change in the resource names in our remote state file.
For example, each of our existing environment TF folders references a module like this:
So in the existing TF state, all the resource names are prefixed with
module.api
, e.g.module.api.aws_lb_listener_rule.services
.When running
terragrunt plan
everything is showing up as a destroy + create because of the module above. What wasmodule.api.aws_lb_listener_rule.services
in the old Terraform is nowaws_lb_listener_rule.services
in Terragrunt.I wasn't able to find a quick way or any guidance for how to handle this. To get past it, I put together a bunch of
state mv
commands like:Is there a better way to do this that I missed?
Thanks,
Jason
Tracked in ticket #110340
Beta Was this translation helpful? Give feedback.
All reactions