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

Cannot unlink billing account #133

Closed
ubschmidt2 opened this issue Jun 16, 2017 · 4 comments
Closed

Cannot unlink billing account #133

ubschmidt2 opened this issue Jun 16, 2017 · 4 comments

Comments

@ubschmidt2
Copy link
Contributor

Terraform Version

Terraform v0.10.0-dev (9706042ddd51b85a46e23356536a1d812efa5a38+CHANGES)

Affected Resource(s)

  • google_project

Terraform Configuration Files

provider "google" {
  region  = "us-central1"
}

resource "google_project" "project" {
  name            = "stschmidt-tf-022"
  project_id      = "stschmidt-tf-022"
  org_id = <withheld>
  # billing_account = "<withheld>"
}

Debug Output

2017/06/16 14:32:39 [DEBUG] plugin: terraform-provider-google: -----------------------------------------------------
2017/06/16 14:32:39 [DEBUG] plugin: terraform-provider-google: 2017/06/16 14:32:39 [DEBUG] Google API Request Details:
2017/06/16 14:32:39 [DEBUG] plugin: terraform-provider-google: ---[ REQUEST ]---------------------------------------
2017/06/16 14:32:39 [DEBUG] plugin: terraform-provider-google: PUT http://cloudbilling.googleapis.com/v1/projects/stschmidt-tf-022/billingInfo?alt=json HTTP/1.1
2017/06/16 14:32:39 [DEBUG] plugin: terraform-provider-google: Host: cloudbilling.googleapis.com
2017/06/16 14:32:39 [DEBUG] plugin: terraform-provider-google: User-Agent: google-api-go-client/0.5 (linux amd64) Terraform/0.9.8
2017/06/16 14:32:39 [DEBUG] plugin: terraform-provider-google: Content-Length: 42
2017/06/16 14:32:39 [DEBUG] plugin: terraform-provider-google: Content-Type: application/json
2017/06/16 14:32:39 [DEBUG] plugin: terraform-provider-google: Accept-Encoding: gzip
2017/06/16 14:32:39 [DEBUG] plugin: terraform-provider-google: 
2017/06/16 14:32:39 [DEBUG] plugin: terraform-provider-google: {"billingAccountName":"billingAccounts/"}
2017/06/16 14:32:39 [DEBUG] plugin: terraform-provider-google: 
2017/06/16 14:32:39 [DEBUG] plugin: terraform-provider-google: -----------------------------------------------------
2017/06/16 14:32:39 [DEBUG] plugin: terraform-provider-google: 2017/06/16 14:32:39 [DEBUG] Google API Response Details:
2017/06/16 14:32:39 [DEBUG] plugin: terraform-provider-google: ---[ RESPONSE ]--------------------------------------
2017/06/16 14:32:39 [DEBUG] plugin: terraform-provider-google: HTTP/2.0 400 Bad Request
2017/06/16 14:32:39 [DEBUG] plugin: terraform-provider-google: Alt-Svc: quic=":443"; ma=2592000; v="38,37,36,35"
2017/06/16 14:32:39 [DEBUG] plugin: terraform-provider-google: Cache-Control: private
2017/06/16 14:32:39 [DEBUG] plugin: terraform-provider-google: Content-Type: application/json; charset=UTF-8
2017/06/16 14:32:39 [DEBUG] plugin: terraform-provider-google: Date: Fri, 16 Jun 2017 12:32:39 GMT
2017/06/16 14:32:39 [DEBUG] plugin: terraform-provider-google: Server: ESF
2017/06/16 14:32:39 [DEBUG] plugin: terraform-provider-google: Vary: Origin
2017/06/16 14:32:39 [DEBUG] plugin: terraform-provider-google: Vary: X-Origin
2017/06/16 14:32:39 [DEBUG] plugin: terraform-provider-google: Vary: Referer
...
2017/06/16 14:32:39 [DEBUG] plugin: terraform-provider-google: 
2017/06/16 14:32:39 [DEBUG] plugin: terraform-provider-google: {
2017/06/16 14:32:39 [DEBUG] plugin: terraform-provider-google:   "error": {
2017/06/16 14:32:39 [DEBUG] plugin: terraform-provider-google:     "code": 400,
2017/06/16 14:32:39 [DEBUG] plugin: terraform-provider-google:     "message": "Request contains an invalid argument.",
2017/06/16 14:32:39 [DEBUG] plugin: terraform-provider-google:     "errors": [
2017/06/16 14:32:39 [DEBUG] plugin: terraform-provider-google:       {
2017/06/16 14:32:39 [DEBUG] plugin: terraform-provider-google:         "message": "Request contains an invalid argument.",
2017/06/16 14:32:39 [DEBUG] plugin: terraform-provider-google:         "domain": "global",
2017/06/16 14:32:39 [DEBUG] plugin: terraform-provider-google:         "reason": "badRequest",
2017/06/16 14:32:39 [DEBUG] plugin: terraform-provider-google:         "debugInfo": "detail: \"[ORIGINAL ERROR] generic::invalid_argument: com.google.apps.framework.request.BadRequestException: Invalid value for field: billing_account_name\"\n"
2017/06/16 14:32:39 [DEBUG] plugin: terraform-provider-google:       }
2017/06/16 14:32:39 [DEBUG] plugin: terraform-provider-google:     ],
2017/06/16 14:32:39 [DEBUG] plugin: terraform-provider-google:     "status": "INVALID_ARGUMENT"
2017/06/16 14:32:39 [DEBUG] plugin: terraform-provider-google:   }
2017/06/16 14:32:39 [DEBUG] plugin: terraform-provider-google: }
2017/06/16 14:32:39 [DEBUG] plugin: terraform-provider-google: 
2017/06/16 14:32:39 [DEBUG] plugin: terraform-provider-google: -----------------------------------------------------

Expected Behavior

Should successfully unlink the billing account.

Actual Behavior

Looks like an attempt to set the billing account reference to an empty string.

google_project.project: Refreshing state... (ID: stschmidt-tf-022)
google_project.project: Modifying... (ID: stschmidt-tf-022)
  billing_account: "<withheld>" => ""
Error applying plan:

1 error(s) occurred:

* google_project.project: 1 error(s) occurred:

* google_project.project: Error updating billing account "" for project "projects/stschmidt-tf-022": googleapi: Error 400: Request contains an invalid argument., badRequest

Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply

References

@danawillow
Copy link
Contributor

This is blocked on #93

ubschmidt2 added a commit to ubschmidt2/terraform-provider-google that referenced this issue Jun 16, 2017
ubschmidt2 added a commit to ubschmidt2/terraform-provider-google that referenced this issue Jun 17, 2017
@ubschmidt2
Copy link
Contributor Author

Doesn't seem to depend on #93.

@danawillow
Copy link
Contributor

Ah ok, I noticed the alpha API you listed and assumed it required that one but you're right, looks like it can be done with the APIs as they are now.

negz pushed a commit to negz/terraform-provider-google that referenced this issue Oct 17, 2017
* Allow unlinking of billing account. Closes hashicorp#133

* Add acceptance test for unlinking the billing account.

* Just apply the resource definition without the billing account instead of setting an empty billing account.
luis-silva pushed a commit to luis-silva/terraform-provider-google that referenced this issue May 21, 2019
add info about whether a resource/property is in beta into the docs
@ghost
Copy link

ghost commented Mar 31, 2020

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!

@ghost ghost locked and limited conversation to collaborators Mar 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants