Comments (9)
Maybe instead of using -statefile=
use https://www.terraform.io/docs/language/files/override.html
from tfmigrate.
Hi, thank you for opening this!
Because I'm not terragrunt user, so I'm not sure why is it not enough to run the custom command before the tfmigrate command?
from tfmigrate.
Terragrunt generates files that may not exist in the folder. Having the ability to make tfmigrate run an alternate re-init command is important for users of terragrunt. Literally just running terragrunt init
instead of terraform init.
This can be down to the fact that things like remote state config commands are just not in standard tf files in a lot of terragrunt based configs
from tfmigrate.
You can replace terraform
command to terragrunt
with exporting an environment variable TFMIGRATE_EXEC_PATH=terragrunt
. I guess it's what you request.
from tfmigrate.
from tfmigrate.
Again I'm not terragrunt user, at least please provide executable examples to help us understand what you are trying. There are some issues claimed that the tfmigrate doesn't work with terragrunt, but no one provide executable examples to me.
In addition, if you have any idea to resolve the conflict by adding new pre-plan / pre-apply
hooks, could you clarify how to use and how it works. The word pre-
is very ambiguous when the hook is invoked.
from tfmigrate.
Hey I think I can provide more context here. Terragrunt has a feature to auto generate remote_state
config using a block like below. Before any terragrunt command runs backend.tf is auto-generated. This means you there is no effect when you run terragrunt plan --state=/tmp/hello.plan
it will still look for the state file mentioned in the backend.tf
which is auto generated.
remote_state = {
backend = "s3"
generate = {
path = "${get_terragrunt_dir()}/backend.tf"
if_exists = "overwrite"
}
config = {
encrypt = true
bucket = local.env_vars.bucket
key = "${local.env_vars.remote_state_path_prefix}/${replace(path_relative_to_include(), "../", "")}/terraform.tfstate"
region = local.env_vars.region
profile = local.env_vars.account
}
}
Unfortunately I don't have an open-source example, but I am happy to make one and update the comment later in the day.
from tfmigrate.
It would be less complicated if temporarily you update the remote state when running plan and rollback. I know this changes behaviour and might not be desirable to everyone but maybe have a flag to support this.
from tfmigrate.
I have no plans to implement this feature as is at this time, but there have been a few reports of the tfmigrate does not work with the terragrunt, so if you have problems with the terragrunt, please feel free to open a new issue with minimal reproductive examples so that someone can help debugging with you. Thanks!
from tfmigrate.
Related Issues (20)
- Migrating states from codebases with different terraform version HOT 3
- tfmigrate reports success despite backend not properly configured HOT 1
- Cannot use `*` with tfmigrate actions HOT 4
- Feature request: Display of state plan for to_dir in multi-state HOT 3
- tfmigrate reports migration plan success when Terraform plan command returns an error HOT 2
- Feature request: add an option to skip `terraform plan`-ing HOT 4
- Feature request: support replace-provider HOT 5
- Change tfmigrate-storage license from MPL2 to MIT HOT 3
- Feature request: support skip_plan in state migration HOT 2
- Feature request: support actions spanning multiple HCL files targeting the same projects HOT 4
- multi_state xmv attempts to migrate data sources? HOT 4
- Possible to optimise multi_state_mv execution time?
- Possible to optimise multi_state_mv execution time? HOT 1
- OpenTofu support HOT 3
- Add terraform >=1.1 moved resource documentation? HOT 1
- [bug] Does not work when working with terragrunt & dynamic backend config
- Error executing ftmigrate on MacOS 14.0 (ARM) HOT 1
- split resources with dependencies. HOT 1
- Bug when you have module that have the same resource names
- High vulnerability in golang library HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tfmigrate.