alicloud_governance_account

更新时间:

Provides a Governance Account resource.

Member account created by the Cloud Governance Center account factory.

For information about Governance Account and how to use it, see What is Account.

-> NOTE: Available since v1.228.0.

Example Usage

Basic Usage


variable "name" {
  default = "terraform-example"
}

provider "alicloud" {
  region = "cn-hangzhou"
}

resource "random_integer" "default" {
  min = 10000
  max = 99999
}

data "alicloud_account" "default" {
}

data "alicloud_governance_baselines" "default" {
}

data "alicloud_resource_manager_folders" "default" {
}

resource "alicloud_governance_account" "default" {
  account_name_prefix = "${var.name}-${random_integer.default.result}"
  folder_id           = data.alicloud_resource_manager_folders.default.ids.0
  baseline_id         = data.alicloud_governance_baselines.default.ids.0
  payer_account_id    = data.alicloud_account.default.id
  display_name        = "${var.name}-${random_integer.default.result}"
}

Deleting alicloud_governance_account or removing it from your configuration

Terraform cannot destroy resource alicloud_governance_account. Terraform will remove this resource from the state file, however resources may remain.

Argument Reference

The following arguments are supported:

  • account_id - (Optional, ForceNew, Computed) The ID of the enrolled account.

    • If you are creating a new resource account, this parameter is not required.
    • If you are enrolling a existing account to account factory, this parameter is required.
  • account_name_prefix - (Optional) Account name prefix.

    • This parameter is required if you are creating a new resource account.
    • If the registration application is applied to an existing account, this parameter does not need to be filled in.
  • baseline_id - (Required) The baseline ID.

    If it is left blank, the system default baseline is used by default.

  • display_name - (Optional) The account display name.

    • This parameter is required if you are creating a new resource account.
    • If the registration application is applied to an existing account, this parameter does not need to be filled in.
  • folder_id - (Optional) The ID of the parent resource folder.

    If you want to create a new resource account and leave this parameter blank, the account is created in the Root folder by default.

    If the registration application is applied to an existing account, this parameter does not need to be filled in.

  • payer_account_id - (Optional) The ID of the billing account. If you leave this parameter empty, the current account is used as the billing account.

  • default_domain_name - (Optional, Available since v1.231.0) The domain name is used to qualify the login name of RAM users and RAM roles.

    Format: <AccountAlias>.onaliyun.com where <AccountAlias> is the account alias, and the default value is the Aliyun account ID. The default domain name must end with the .onaliyun.com suffix. The maximum length of the default domain name (including suffix) is 64 characters. It can contain English letters, numbers, English periods (.) , dashes (-) and underscores (_).

Attributes Reference

The following attributes are exported:

  • id - The ID of the resource supplied above.
  • status - Account registration status. Value:

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

  • create - (Defaults to 5 mins) Used when create the Account.
  • update - (Defaults to 5 mins) Used when update the Account.

Import

Governance Account can be imported using the id, e.g.

$ terraform import alicloud_governance_account.example <id>