-
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
Add import support for org, folder, billing logging sinks #1860
Conversation
Type: schema.TypeString, | ||
Required: true, | ||
ForceNew: true, | ||
StateFunc: func(v interface{}) string { |
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.
Is a statefunc better than a diff suppress or flattener for this?
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.
Oops! Just saw this comment now. Like I said in the PR description, this is just some weirdness with one of the tests - it wasn't following the diff suppress and wrongly errored out comparing folder/1234
to 1234
, but it played nicely with the StateFunc so I used that instead.
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.
(I think this is a function of the importstateverify tests doing a direct comparison of what's in state, meaning diff suppress functions aren't used, but I could be wrong.)
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.
I think at some point we need to resolve the ImportStateVerify problem, but that's not really relevant to or scoped to this PR, so that may be a conversation for another day.
Type: schema.TypeString, | ||
Required: true, | ||
ForceNew: true, | ||
StateFunc: func(v interface{}) string { |
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.
(I think this is a function of the importstateverify tests doing a direct comparison of what's in state, meaning diff suppress functions aren't used, but I could be wrong.)
…1860) Fixes hashicorp#1494. * Add import support for `google_logging_organization_sink`, `google_logging_folder_sink`, `google_logging_billing_account_sink`. Using `StateFunc` over `DiffSuppressFunc` should only affect tests; for some reason `TestAccLoggingFolderSink_folderAcceptsFullFolderPath` expected a `folder` value of `folders/{{id}}` vs expecting `{{id}}` when only `DiffSuppressFunc` was used, when in real use `DiffSuppressFunc` should be sufficient.
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks! |
Fixes #1494.
google_logging_organization_sink
,google_logging_folder_sink
,google_logging_billing_account_sink
.Using
StateFunc
overDiffSuppressFunc
should only affect tests; for some reasonTestAccLoggingFolderSink_folderAcceptsFullFolderPath
expected afolder
value offolders/{{id}}
vs expecting{{id}}
when onlyDiffSuppressFunc
was used, when in real useDiffSuppressFunc
should be sufficient.