-
-
Notifications
You must be signed in to change notification settings - Fork 381
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
Replace null_resource with terraform_data #1548
base: master
Are you sure you want to change the base?
Replace null_resource with terraform_data #1548
Conversation
terraform_data suggested instead of null_resource as from Terraform 1.4. See https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource.
@@ -1,5 +1,5 @@ | |||
terraform { | |||
required_version = ">= 1.5.0" | |||
required_version = ">= 1.9.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this affect OpenTofu users? Have you tested?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. I forgot about opentofu.
OpenTofu is not on 1.9 yet, so the migration with the moved
statement won't be possible. So this has to wait until opentofu catches up with v1.9.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then I suggest waiting until this is compatible with OpenTofu as well, since I've switched to it over Terraform due to license changing and I expect more people using this project may have done so as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I agree.
I changed the status of this PR to "draft" and I subscribed to the releases of opentofu https://github.com/opentofu/opentofu/releases so I get notified when v1.9 comes out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
v1.9.0_beta2 doesn't contain this feature yet. I filed an issue: opentofu/opentofu#2272
As from Terraform 1.4, the doc suggests to use
terraform_data
instead ofnull_resource
. See https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource.To avoid destroy and recreation of these resources, terraform>=1.9 allows the
moved
statement to do exactly this refactoring. Works like a charm :-)For details, see https://registry.terraform.io/providers/hashicorp/null/latest/docs/guides/terraform-migration#migrating-existing-configurations.