-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Import of google_cloud_asset_folder_feed forces replacement despite matching config #9461
Comments
@mchesler can you see if below records are in the state?
|
@edwardmedia no, I see this in the state:
|
@mchesler below fields are
|
@edwardmedia Looks like those fields were not included in the API response:
The issue with re-applying is as I originally stated above - terraform is going to force replacement of the resource, which I do not want to happen. |
@mchesler exactly. The provider does not have control over what api sends back. Did you create the resource via Terraform? If not, did you provided the data for these fields? I understood you didn't want to re-apply, but by doing so we may be able to see if these fields are captured by API. Make sense?
|
@mchesler is this still an issue? |
@edwardmedia yes, still an issue. It seems as though the values get stored in terraform state when terraform creates the resource, so it's not constantly trying to destroy and recreate. While I can recreate at will for testing, I'm not able to destroy and recreate the resource in production, so I'm somewhat stuck. |
@mchesler was the state created via imported or when you created the resource ? Did something happen after the resource initially created? I am trying to understand (the below) how the
|
@edwardmedia the state appears to be created correctly when I create the resource via
And the resulting state shows the correct information:
However, if I remove and reimport the resource, the state looks like this:
To recap, the API responses on create vs import look identical, but resource creation results in correct/complete terraform state, while resource import does not and forces resource replacement on the next apply. |
@mchesler I think I understood your issue now. After import, you still need to construct the resource config, |
@edwardmedia I think that covers the issue. Stated slightly differently - after importing a |
I see. We can populate |
[upstream:5320b7984e43c4f7ff843058ea029551327e4a06] Signed-off-by: Modular Magician <magic-modules@google.com>
I've confirmed this is still an issue. Import is effectively broken for this resource, in that it requires a subsequent recreation to resolve (or hand-editing the state). Recommendation is to:
Note that a similar fix might be needed for the other *Feed resources. |
Community Note
modular-magician
user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned tohashibot
, a community member has claimed the issue already.Terraform Version
Terraform version 0.12.31
Google Provider version 3.74.0
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
After import,
terraform plan
should show no changes to applyActual Behavior
After import,
terraform plan
shows output like below:Steps to Reproduce
terraform import google_cloud_asset_folder_feed.my-feed folders/1234567890/feeds/my-feed
terraform plan
Important Factoids
None
References
b/374161733
The text was updated successfully, but these errors were encountered: