Skip to content
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

Backfill user project overrides, billing_project support across handwritten resources #9454

Open
rileykarson opened this issue Jun 28, 2021 · 0 comments

Comments

@rileykarson
Copy link
Collaborator

rileykarson commented Jun 28, 2021

Affected Resource(s)

  • google_*

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment. If the issue is assigned to the "modular-magician" user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If the issue is assigned to a user, that user is claiming responsibility for the issue. If the issue is assigned to "hashibot", a community member has claimed the issue already.

Description

Add support for user project overrides and the billing_project provider-level field to all remaining handwritten resources. We support this on generated resources and #9437 will apply billing_project support to generated IAM resources, but it requires a small amount of in-resource code that isn't present on handwritten resources.

For anyone reading this issue that needs support for a specific resource, we can prioritise that ahead of the general backfill. Please file an enhancement request and reference this issue.

@rileykarson rileykarson added this to the Goals milestone Jun 28, 2021
ericnorris added a commit to ericnorris/terraform-provider-google that referenced this issue Jul 26, 2021
This commit partially addresses hashicorp#9454, in the case when the provider is
configured with both the user_project_override AND billing_project
setting, by setting a ClientOption option in the LoadAndValidate
function stage on the HTTP client used by all handwritten resources.

This does not address having user_project_override set to true w/o the
billing_project setting, as that would require more logic to determine
which project the resource is referring to.
ericnorris added a commit to ericnorris/terraform-provider-google that referenced this issue Jul 29, 2021
This commit partially addresses hashicorp#9454, in the case when the provider is
configured with both the user_project_override AND billing_project
setting, by setting a header in the LoadAndValidate function stage on
the HTTP client used by all handwritten resources.

Originally this commit used a Google API client ClientOption [1],
but unfortunately headers set by the Google API client's transport
implementation [2] aren't visible by the logging transport [3]. I
thought it would be better to include the header at a higher level in
order to aid with debugging in the future. If [4] is ever merged, moving
the logging transport _inside_ of the API client and switching to a
ClientOption for the header would probably be a better way.

Finally, this does not address having user_project_override set to true
without the billing_project setting, as that would require more logic to
determine which project the resource is referring to.

[1] https://pkg.go.dev/google.golang.org/api/option#WithQuotaProject
[2] https://github.com/googleapis/google-api-go-client/blob/3e2b6a25f224e301409d11443d464af92671d2f0/transport/http/dial.go#L86-L88
[3] https://github.com/hashicorp/terraform-provider-google/blob/0e315b07d9ed37bd884a1060c22681908d23f270/google/config.go#L373-L374
[4] googleapis/google-cloud-go#1962
modular-magician added a commit to modular-magician/terraform-provider-google that referenced this issue Nov 17, 2023
)

* feat(vertexai): iam resources for vertex ai prediction

* fix: update the import format

* refactor: add two spaces for docs

* refactor: remove the suffix 'generated' from the hand-written tests
[upstream:6b15a46443be95916fd32b81671f0bea3b5cb0cf]

Signed-off-by: Modular Magician <magic-modules@google.com>
modular-magician added a commit that referenced this issue Nov 17, 2023
)

* feat(vertexai): iam resources for vertex ai prediction

* fix: update the import format

* refactor: add two spaces for docs

* refactor: remove the suffix 'generated' from the hand-written tests
[upstream:6b15a46443be95916fd32b81671f0bea3b5cb0cf]

Signed-off-by: Modular Magician <magic-modules@google.com>
@roaks3 roaks3 added service/terraform forward/exempt Never forward this issue labels Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants