-
Notifications
You must be signed in to change notification settings - Fork 77
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
[Bug]: hcloud_load_balancer_target
import failed if the target is ip
#961
Comments
The fields `ip` and `use_private_ip` are marked as conflicting because `use_private_ip` only takes effect with label selector and server id targets. So far we have always set `use_private_ip` to whatever the API returned. But this causes issues with the command `terraform plan -generate-config-out=` as it writes all attributes we set in the state to a TF file. For an LB Target IP this now causes a conflict because both fields are set. This is fixed by only setting the field when the target type is not IP. Closes #961.
Hey @ioah86, it looks like this comes from the loose way we interpret the Terraform provider contract. This was not an issue before, because Terraform hid those issues from users, but newer features tend to cause issues with this. We have a full refactoring on our backlog (#752) which should highlight these issues whenever we work on a resource from that list. I have fixed this specific issue in #962, but there are probably more resources and fields with this problem in the provider, so please keep opening issues if you find anything. |
#962) The fields `ip` and `use_private_ip` are marked as conflicting because `use_private_ip` only takes effect with label selector and server id targets. So far we have always set `use_private_ip` to whatever the API returned. But this causes issues with the command `terraform plan -generate-config-out=` as it writes all attributes we set in the state to a TF file. For an LB Target IP this now causes a conflict because both fields are set. This is fixed by only setting the field when the target type is not IP. Closes #961
🤖 I have created a release *beep* *boop* --- ## [1.48.0](v1.47.0...v1.48.0) (2024-07-25) ### Features * add support for opentofu v1.7 ([#950](#950)) ([ae115a8](ae115a8)) * add support for terraform v1.9 ([#949](#949)) ([642ac15](642ac15)) * drop support for terraform v1.7.x ([#947](#947)) ([f6372aa](f6372aa)) * **server-type:** mark included_traffic attribute as deprecated ([#963](#963)) ([e8101cc](e8101cc)) ### Bug Fixes * do not continue if an api error occurred ([#958](#958)) ([85a4dd0](85a4dd0)) * **load-balancer:** automatic import of target adds conflicting fields ([#962](#962)) ([6c0b1c4](6c0b1c4)), closes [#961](#961) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
What happened?
Running a vanilla import with a file with contents of this type
(names and IPs are obfuscated for this example).
The command I was running was
Then an error occurred stating
From the documentation, I understand that if the target type is
ip
, then there should be no fielduse_private_ip
. However, the field pops up in the generated terraform file, and subsequently causes theplan
phase to fail.What did you expect to happen?
I expected the import to have no problem when running
Please provide a minimal working example
The example above with a valid IP and resource_id is a minimum working example for this bug.
The text was updated successfully, but these errors were encountered: