magic-modules icon indicating copy to clipboard operation
magic-modules copied to clipboard

Support full resource names in autokey_config.folder

Open tdbhacks opened this issue 6 months ago • 16 comments

Add pre_* custom code to drop the 'folders/' prefix from API requests, as well as a diff suppressor for the same reason. The ID also needs to be adjusted on post_create.

Side change: add a time delay after setting the autokey_config in the basic example, to try to address test flakiness (#18935)

NOTE: looking at the debug logs, I see the following error:

2024-08-09T16:37:55.977Z [WARN]  Provider "provider[\"registry.terraform.io/hashicorp/google-beta\"]" produced an unexpected new value for google_kms_autokey_config.example-autokeyconfig, but we are tolerating it because it is using the legacy plugin SDK.
    The following problems may be the cause of any confusing errors from downstream operations:
      - .folder: was cty.StringVal("folders/966201355962"), but now cty.StringVal("966201355962")

looking for guidance on whether my current approach is fine, or if this should be addressed in a different way.

Thank you!

Release Note Template for Downstream PRs (will be copied)

kms: added support for full resource names in `folder` attribute of `google_kms_autokey_config`

tdbhacks avatar Aug 09 '24 17:08 tdbhacks