Allows creation and management of a Google Cloud Billing Subaccount.
resource "google_billing_subaccount" "subaccount" {
display_name = "My Billing Account"
master_billing_account = "012345-567890-ABCDEF"
}
display_name
(Required) - The display name of the billing account.
master_billing_account
(Required) - The name of the master billing account that the subaccount
will be created under in the form {billing_account_id}
or billingAccounts/{billing_account_id}
.
deletion_policy
(Optional) - If set to "RENAME_ON_DESTROY" the billing account display_name
will be changed to "Terraform Destroyed" along with a timestamp. If set to "" this will not occur.
Default is "".
The following additional attributes are exported:
open
- true
if the billing account is open, false
if the billing account is closed.
name
- The resource name of the billing account in the form billingAccounts/{billing_account_id}
.
billing_account_id
- The billing account id.
Billing Subaccounts can be imported using any of these accepted formats:
billingAccounts/{billing_account_id}
In Terraform v1.5.0 and later, use an import
block to import Billing Subaccounts using one of the formats above. For example:
import {
id = "billingAccounts/{billing_account_id}"
to = google_billing_subaccount.default
}
When using the terraform import
command, Billing Subaccounts can be imported using one of the formats above. For example:
$ terraform import google_billing_subaccount.default billingAccounts/{billing_account_id}