-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrating resources from 1 state to another. #25
Comments
@sidewinder12s It's not intentional. The force flag should not be required. |
I first applied Old state, then no diff. New state was entirely new, so tfmigrate was the first thing to initialize the new state locally and remotely. My actual goal outside of this test case is to move a few modules out of a large monolithic state into a dedicated, new, empty state. Old State: data "aws_caller_identity" "current" {}
resource "aws_security_group" "foo" {
name = "foo"
}
resource "aws_security_group" "bar" {
name = "bar"
}
module "s3-bucket-test" {
source = "../../../../modules/s3"
bucket_name = "gweb-testing-2020-02-12-1304"
temporary_bucket = true
} New State: data "aws_caller_identity" "current" {}
resource "aws_security_group" "foo" {
name = "foo"
}
resource "aws_security_group" "bar" {
name = "bar"
}
module "s3-bucket-test" {
source = "../../../../modules/s3"
bucket_name = "gweb-testing-2020-02-12-1304"
temporary_bucket = true
} Actual output:
|
@sidewinder12s Looking at the log, the diff detected in the from_dir( |
Ah that is it. Was not clear I needed to do that. Commented out the old state and it planned successfully.
Thank you for the help! |
I've got a few resources and modules I am trying to move from a monolithic state into smaller broken up states.
New state is entirely new, has just the resources and modules I want to move from the old state. I am using this tfmigrate config to test:
When I test planned this, it always showed the new_state state had unexpected diffs, with it creating all the resources new and which failed the tfmigrate plan. I tried adding the force flag, which still showed the diff, but went ahead and applied it since this is a small test.
This seemed to properly migrate the 3 resources from the old state into the new state, with the new state showing no changes on plan.
Is this the intended workflow when doing a multi_state migration? Is the force flag required?
The text was updated successfully, but these errors were encountered: