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

Google project precheck #3145

Merged
merged 7 commits into from
Feb 19, 2020

Conversation

chrisst
Copy link
Contributor

@chrisst chrisst commented Feb 18, 2020

closes hashicorp/terraform-provider-google#5671 as it's the upstream pr.
fixes hashicorp/terraform-provider-google#5222
references terraform-google-modules/terraform-google-project-factory#373

Release Note Template for Downstream PRs (will be copied)

compute: Updated `google_project` to check for valid permissions on the parent billing account before creating and tainting the resource.

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 1 file changed, 24 insertions(+))
Terraform Beta: Diff ( 1 file changed, 24 insertions(+))

Permissions: []string{perm},
}
resp, err := config.clientBilling.BillingAccounts.TestIamPermissions(ba, req).Do()
if err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was there a consensus on whether this request failing should actually fail the apply?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed my mind and decided it's fine. I'd love to make this a check for the correct API being enabled but I'm not sure it's possible at this point. I added something to that effect in hashicorp/terraform-provider-google#5671 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, thanks!

@chrisst chrisst merged commit 3834253 into GoogleCloudPlatform:master Feb 19, 2020
nathkn pushed a commit to nathkn/magic-modules that referenced this pull request May 18, 2020
* project: check for billing account perms as pre-requisite

* outdent

* typo

* rm type from error message

* simplify perms check

* simplify bool check

* simplify bool check

Co-authored-by: Umair Idris <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Project is getting tainted in TF state file, even though it got created; when billing id is incorrect
5 participants