Skip to content

Commit

Permalink
Allow unlinking of billing account. Closes hashicorp#133
Browse files Browse the repository at this point in the history
  • Loading branch information
ubschmidt2 committed Jun 16, 2017
1 parent abea820 commit 72aac20
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ IMPROVEMENTS:
BUG FIXES:

* Changed `google_compute_instance_group_manager` `target_size` default to 0 [GH-65]
* Allow unlinking of billing account [GH-133]
5 changes: 3 additions & 2 deletions google/resource_google_project.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,9 @@ func resourceGoogleProjectUpdate(d *schema.ResourceData, meta interface{}) error
// Billing account has changed
if ok := d.HasChange("billing_account"); ok {
name := d.Get("billing_account").(string)
ba := cloudbilling.ProjectBillingInfo{
BillingAccountName: "billingAccounts/" + name,
ba := cloudbilling.ProjectBillingInfo{}
if name != "" {
ba.BillingAccountName = "billingAccounts/" + name
}
_, err = config.clientBilling.Projects.UpdateBillingInfo(prefixedProject(pid), &ba).Do()
if err != nil {
Expand Down

0 comments on commit 72aac20

Please sign in to comment.