|
| 1 | +# Account Check |
| 2 | + |
| 3 | +This module determines whether a given IBM Cloud account is part of an `ENTERPRISE` or is a `Standalone (ACCOUNT)` account. |
| 4 | +It uses the IBM Cloud Enterprise Management API and can be easily integrated into Terraform configurations via the external data source. |
| 5 | + |
| 6 | +### Prerequisites |
| 7 | + |
| 8 | +This module utilizes an external script that relies on the following command-line tools being installed on the system where Terraform is executed: |
| 9 | +- `jq`: A lightweight and flexible command-line JSON processor. It is required for parsing the input provided by the Terraform external data source. |
| 10 | +- `curl`: A tool to transfer data with URLs, required for making API calls to the IBM Cloud Enterprise Management API. |
| 11 | + |
| 12 | +### Usage |
| 13 | +```hcl |
| 14 | +module "account_type_check" { |
| 15 | + source = "terraform-ibm-modules/scc-workload-protection/ibm//modules/account_check" |
| 16 | + target_account_id = <ACCOUNT_ID> |
| 17 | + iam_token = "XXXXXXXXXXXXXX" # pragma: allowlist secret |
| 18 | +} |
| 19 | +``` |
| 20 | + |
| 21 | +### Required IAM access policies |
| 22 | + |
| 23 | +- Account Management |
| 24 | + - **Enterprise** service |
| 25 | + - `Viewer` platform access |
| 26 | + - **All Identity and Access enabled** services |
| 27 | + - `Viewer` platform access |
| 28 | + |
| 29 | +<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK --> |
| 30 | +### Requirements |
| 31 | + |
| 32 | +| Name | Version | |
| 33 | +|------|---------| |
| 34 | +| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.9.0 | |
| 35 | +| <a name="requirement_external"></a> [external](#requirement\_external) | >= 2.3.5, <3.0.0 | |
| 36 | + |
| 37 | +### Modules |
| 38 | + |
| 39 | +No modules. |
| 40 | + |
| 41 | +### Resources |
| 42 | + |
| 43 | +| Name | Type | |
| 44 | +|------|------| |
| 45 | +| [external_external.account_check](https://registry.terraform.io/providers/hashicorp/external/latest/docs/data-sources/external) | data source | |
| 46 | + |
| 47 | +### Inputs |
| 48 | + |
| 49 | +| Name | Description | Type | Default | Required | |
| 50 | +|------|-------------|------|---------|:--------:| |
| 51 | +| <a name="input_iam_token"></a> [iam\_token](#input\_iam\_token) | The IBM Cloud platform IAM token needed to authenticate deploy IAM enabled resources. | `string` | n/a | yes | |
| 52 | +| <a name="input_target_account_id"></a> [target\_account\_id](#input\_target\_account\_id) | The ID of the target account to check for type. | `string` | n/a | yes | |
| 53 | + |
| 54 | +### Outputs |
| 55 | + |
| 56 | +| Name | Description | |
| 57 | +|------|-------------| |
| 58 | +| <a name="output_account_type"></a> [account\_type](#output\_account\_type) | The determined type of the IBM Cloud account. | |
| 59 | +<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK --> |
0 commit comments