Closed andor44 closed 5 years ago
I was too quick on the trigger here: the billing account actually is being changed properly. I had tried to incorrectly use -target
on my project which was causing no changes to be planned.
Thank you for this. I was experiencing a similar issue and thought the error was indicating that the billing_account couldn't be set because the cloudbilling api was not enabled yet, but now I realize it's because cloudbilling wasn't enabled on my 'management' project.
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 👉 hashibot-feedback@hashicorp.com. Thanks!
Community Note
Terraform Version
Affected Resource(s)
google_project
Terraform Configuration Files
Debug Output
Can provide if needed
Panic Output
No panic
Expected Behavior
If no billing account is attached to the project a re-plan would try to modify it.
Actual Behavior
I had Cloud Resource Manager API enabled so I could create the project, but not Cloud Billing API so the billing account could not be attached. I received the following error:
* google_project.foo_project: Error setting billing account "xxx-xxx-xx" for project "projects/foo-project": googleapi: Error 403: Cloud Billing API has not been used in project [redacted] before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/cloudbilling.googleapis.com/overview?project=[redacted] then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry., accessNotConfigured
After enabling the above API running plan again shows 0 pending changes, and the project has no billing account attached.
Steps to Reproduce
terraform plan
, observe no changes planned.