This is a collection of sub modules and which will take tree based enterprise inputs and create child accounts and account-groups in an enterprise
Full examples are in the examples folder, but basic usage is as follows for creation of enterprise children is
provider "ibm" {
ibmcloud_api_key = "XXXXXXXX" # pragma: allowlist secret
}
data "ibm_enterprises" "enterprise" {
name = "my-enterprise-account"
}
module "enterprise" {
source = "terraform-ibm-modules/terraform-ibm-enterprise"
enterprise_crn = data.ibm_enterprises.enterprise.enterprises[0].crn
enterprise_primary_contact_iam_id = data.ibm_enterprises.enterprise.enterprises[0].primary_contact_iam_id
enterprise_account_groups = [
{
key_name = "group-key-1"
name = "account_group_1"
parent_key_name = null
}]
enterprise_accounts = [
{
key_name = "acct-key-1"
name = "account_1"
parent_key_name = null
}
{
key_name = "acct-key-2"
name = "account_2"
parent_key_name = null
add_owner_iam_policies = true # this field enable child account to have IAM_APIKey with owner IAM policies
}
]
}
- Account Management
- Enterprise service
Administrator
platform access
- Enterprise service
Name | Version |
---|---|
terraform | >= 1.3.0 |
ibm | >= 1.65.0, < 2.0.0 |
Name | Source | Version |
---|---|---|
dynamic_values | ./submodules/dynamic_values | n/a |
enterprise_hierarchy_depth_0 | ./submodules/enterprise_hierarchy | n/a |
enterprise_hierarchy_depth_1 | ./submodules/enterprise_hierarchy | n/a |
enterprise_hierarchy_depth_2 | ./submodules/enterprise_hierarchy | n/a |
No resources.
Name | Description | Type | Default | Required |
---|---|---|---|---|
enterprise_account_groups | List of enterprise child account_groups in the enterprise | list(object({ name = string, key_name = string, parent_key_name = optional(string, null), owner_iam_id = optional(string, null) })) |
[] |
no |
enterprise_accounts | List of enterprise child accounts in the enterprise | list(object({ name = string, key_name = string, parent_key_name = optional(string, null), owner_iam_id = optional(string, null), add_owner_iam_policies = optional(bool, false) })) |
[] |
no |
enterprise_crn | The CRN of the parent Enterprise account to use. | string |
n/a | yes |
enterprise_primary_contact_iam_id | The IAM id of the parent Enterprise account owner. | string |
n/a | yes |
Name | Description |
---|---|
enterprise_account_groups | List of account groups created in an Enterprise |
enterprise_accounts | List of accounts created in an Enterprise |
enterprise_accounts_iam_response | List of accounts created in an Enterprise |
You can report issues and request features for this module in GitHub issues in the module repo. See Report an issue or request a feature.
To set up your local development environment, see Local development setup in the project documentation.