Skip to content

terraform-ibm-modules/terraform-ibm-enterprise

Repository files navigation

IBM Enterprise Account module

Stable (Adopted) latest release pre-commit Renovate enabled semantic-release

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

Overview

terraform-ibm-enterprise

Usage

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
    }
  ]
                                      }

Required IAM access policies

  • Account Management
    • Enterprise service
      • Administrator platform access

Requirements

Name Version
terraform >= 1.3.0, <1.7.0
ibm >= 1.54.0, < 2.0.0

Modules

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

Resources

No resources.

Inputs

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) })) n/a yes
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) })) n/a yes
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

Outputs

Name Description
enterprise_account_groups List of account groups created in an Enterprise
enterprise_accounts List of accounts created in an Enterprise

Contributing

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.