Skip to content

Commit 1defaa0

Browse files
authored
feat: add support for config aggregator and related trusted profiles (#214)
1 parent 8841a91 commit 1defaa0

File tree

16 files changed

+295
-32
lines changed

16 files changed

+295
-32
lines changed

README.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ https://terraform-ibm-modules.github.io/documentation/#/implementation-guideline
2121
## Overview
2222
* [terraform-ibm-app-configuration](#terraform-ibm-app-configuration)
2323
* [Examples](./examples)
24+
* [Advanced example](./examples/advanced)
2425
* [Basic example](./examples/basic)
25-
* [Complete example](./examples/complete)
2626
* [Contributing](#contributing)
2727
<!-- END OVERVIEW HOOK -->
2828

@@ -79,19 +79,24 @@ For more information on access and permissions, see <https://cloud.ibm.com/docs/
7979
| Name | Version |
8080
|------|---------|
8181
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.9.0 |
82-
| <a name="requirement_ibm"></a> [ibm](#requirement\_ibm) | >= 1.65.0, < 2.0.0 |
82+
| <a name="requirement_ibm"></a> [ibm](#requirement\_ibm) | >= 1.76.1, < 2.0.0 |
8383

8484
### Modules
8585

8686
| Name | Source | Version |
8787
|------|--------|---------|
8888
| <a name="module_cbr_rule"></a> [cbr\_rule](#module\_cbr\_rule) | terraform-ibm-modules/cbr/ibm//modules/cbr-rule-module | 1.28.0 |
89+
| <a name="module_config_aggregator_trusted_profile"></a> [config\_aggregator\_trusted\_profile](#module\_config\_aggregator\_trusted\_profile) | terraform-ibm-modules/trusted-profile/ibm | 2.1.1 |
90+
| <a name="module_config_aggregator_trusted_profile_enterprise"></a> [config\_aggregator\_trusted\_profile\_enterprise](#module\_config\_aggregator\_trusted\_profile\_enterprise) | terraform-ibm-modules/trusted-profile/ibm | 2.1.1 |
91+
| <a name="module_config_aggregator_trusted_profile_template"></a> [config\_aggregator\_trusted\_profile\_template](#module\_config\_aggregator\_trusted\_profile\_template) | terraform-ibm-modules/trusted-profile/ibm//modules/trusted-profile-template | 2.2.0 |
8992

9093
### Resources
9194

9295
| Name | Type |
9396
|------|------|
9497
| [ibm_app_config_collection.collections](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/app_config_collection) | resource |
98+
| [ibm_config_aggregator_settings.config_aggregator_settings](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/config_aggregator_settings) | resource |
99+
| [ibm_iam_custom_role.template_assignment_reader](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/iam_custom_role) | resource |
95100
| [ibm_resource_instance.app_config](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/resource_instance) | resource |
96101

97102
### Inputs
@@ -104,6 +109,13 @@ For more information on access and permissions, see <https://cloud.ibm.com/docs/
104109
| <a name="input_app_config_service_endpoints"></a> [app\_config\_service\_endpoints](#input\_app\_config\_service\_endpoints) | Service Endpoints for the App Configuration service instance, valid endpoints are public or public-and-private. | `string` | `"public-and-private"` | no |
105110
| <a name="input_app_config_tags"></a> [app\_config\_tags](#input\_app\_config\_tags) | Optional list of tags to be added to the App Config instance. | `list(string)` | `[]` | no |
106111
| <a name="input_cbr_rules"></a> [cbr\_rules](#input\_cbr\_rules) | The list of context-based restriction rules to create. | <pre>list(object({<br/> description = string<br/> account_id = string<br/> tags = optional(list(object({<br/> name = string<br/> value = string<br/> })), [])<br/> rule_contexts = list(object({<br/> attributes = optional(list(object({<br/> name = string<br/> value = string<br/> }))) }))<br/> enforcement_mode = string<br/> }))</pre> | `[]` | no |
112+
| <a name="input_config_aggregator_enterprise_account_group_ids_to_assign"></a> [config\_aggregator\_enterprise\_account\_group\_ids\_to\_assign](#input\_config\_aggregator\_enterprise\_account\_group\_ids\_to\_assign) | A list of enterprise account group IDs to assign the trusted profile template to in order for the accounts to be scanned. Supports passing the string 'all' in the list to assign to all account groups. Only applies if `enable_config_aggregator` is true and a value is being passed for `config_aggregator_enterprise_id`. | `list(string)` | <pre>[<br/> "all"<br/>]</pre> | no |
113+
| <a name="input_config_aggregator_enterprise_id"></a> [config\_aggregator\_enterprise\_id](#input\_config\_aggregator\_enterprise\_id) | If the account is an enterprise account, this value should be set to the enterprise ID (NOTE: This is different to the account ID). | `string` | `null` | no |
114+
| <a name="input_config_aggregator_enterprise_trusted_profile_name"></a> [config\_aggregator\_enterprise\_trusted\_profile\_name](#input\_config\_aggregator\_enterprise\_trusted\_profile\_name) | The name to give the enterprise viewer trusted profile with that will be created if `enable_config_aggregator` is set to `true` and a value is passed for `config_aggregator_enterprise_id`. | `string` | `"config-aggregator-enterprise-trusted-profile"` | no |
115+
| <a name="input_config_aggregator_enterprise_trusted_profile_template_name"></a> [config\_aggregator\_enterprise\_trusted\_profile\_template\_name](#input\_config\_aggregator\_enterprise\_trusted\_profile\_template\_name) | The name to give the trusted profile template that will be created if `enable_config_aggregator` is set to `true` and a value is passed for `config_aggregator_enterprise_id`. | `string` | `"config-aggregator-trusted-profile-template"` | no |
116+
| <a name="input_config_aggregator_resource_collection_regions"></a> [config\_aggregator\_resource\_collection\_regions](#input\_config\_aggregator\_resource\_collection\_regions) | From which region do you want to collect configuration data? Only applies if `enable_config_aggregator` is set to true. | `list(string)` | <pre>[<br/> "all"<br/>]</pre> | no |
117+
| <a name="input_config_aggregator_trusted_profile_name"></a> [config\_aggregator\_trusted\_profile\_name](#input\_config\_aggregator\_trusted\_profile\_name) | The name to give the trusted profile that will be created if `enable_config_aggregator` is set to `true`. | `string` | `"config-aggregator-trusted-profile"` | no |
118+
| <a name="input_enable_config_aggregator"></a> [enable\_config\_aggregator](#input\_enable\_config\_aggregator) | Set to true to enable configuration aggregator. By setting to true a trusted profile will be created with the required access to record configuration data from all resources across regions in your account. [Learn more](https://cloud.ibm.com/docs/app-configuration?topic=app-configuration-ac-configuration-aggregator). | `bool` | `false` | no |
107119
| <a name="input_region"></a> [region](#input\_region) | The region to provision the App Configuration service, valid regions are us-south, us-east, eu-gb, and au-syd. | `string` | `"us-south"` | no |
108120
| <a name="input_resource_group_id"></a> [resource\_group\_id](#input\_resource\_group\_id) | The resource group ID where resources will be provisioned. | `string` | n/a | yes |
109121

@@ -116,6 +128,9 @@ For more information on access and permissions, see <https://cloud.ibm.com/docs/
116128
| <a name="output_app_config_crn"></a> [app\_config\_crn](#output\_app\_config\_crn) | CRN of the App Configuration instance |
117129
| <a name="output_app_config_guid"></a> [app\_config\_guid](#output\_app\_config\_guid) | GUID of the App Configuration instance |
118130
| <a name="output_app_config_id"></a> [app\_config\_id](#output\_app\_config\_id) | ID of the App Configuration instance |
131+
| <a name="output_config_aggregator_enterprise_trusted_profile_id"></a> [config\_aggregator\_enterprise\_trusted\_profile\_id](#output\_config\_aggregator\_enterprise\_trusted\_profile\_id) | ID of the config aggregator trusted profile for enterprise access |
132+
| <a name="output_config_aggregator_enterprise_trusted_profile_template_id"></a> [config\_aggregator\_enterprise\_trusted\_profile\_template\_id](#output\_config\_aggregator\_enterprise\_trusted\_profile\_template\_id) | ID of the config aggregator trusted profile enterprise template ID |
133+
| <a name="output_config_aggregator_trusted_profile_id"></a> [config\_aggregator\_trusted\_profile\_id](#output\_config\_aggregator\_trusted\_profile\_id) | ID of the config aggregator trusted profile |
119134
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
120135

121136
<!-- Leave this section as is so that your module has a link to local development environment set up steps for contributors to follow -->

cra-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# More info about this file at https://github.com/terraform-ibm-modules/common-pipeline-assets/blob/main/.github/workflows/terraform-test-pipeline.md#cra-config-yaml
22
version: "v1"
33
CRA_TARGETS:
4-
- CRA_TARGET: "examples/complete" # Target directory for CRA scan. If not provided, the CRA Scan will not be run.
4+
- CRA_TARGET: "examples/advanced" # Target directory for CRA scan. If not provided, the CRA Scan will not be run.
55
CRA_IGNORE_RULES_FILE: "cra-tf-validate-ignore-rules.json" # CRA Ignore file to use. If not provided, it checks the repo root directory for `cra-tf-validate-ignore-rules.json`
66
PROFILE_ID: "fe96bd4d-9b37-40f2-b39f-a62760e326a3" # SCC profile ID (currently set to 'IBM Cloud Framework for Financial Services' '1.7.0' profile).

examples/advanced/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Advanced example
2+
3+
<!-- There is a pre-commit hook that will take the title of each example add include it in the repos main README.md -->
4+
<!-- Add text below should describe exactly what resources are provisioned / configured by the example -->
5+
6+
An end-to-end example that will provision the following:
7+
8+
- A new resource group if one is not passed in.
9+
- A new App Configuration instance.
10+
- A new collection within the App Configuration instance.
11+
- Configuration aggregator ([learn more](https://cloud.ibm.com/docs/app-configuration?topic=app-configuration-ac-configuration-aggregator))
12+
- A simple VPC
13+
- A CBR zone for the VPC
14+
- A CBR rule to only allow the App Configuration instance to be accessed from within the VPC zone over private endpoint

examples/complete/main.tf renamed to examples/advanced/main.tf

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
##############################################################################
2-
# Complete example
3-
##############################################################################
4-
51
########################################################################################################################
62
# Resource group
73
########################################################################################################################
@@ -33,6 +29,7 @@ resource "ibm_is_vpc" "example_vpc" {
3329
##############################################################################
3430
# Create CBR Zone
3531
##############################################################################
32+
3633
module "cbr_zone" {
3734
source = "terraform-ibm-modules/cbr/ibm//modules/cbr-zone-module"
3835
version = "1.28.0"
@@ -50,20 +47,19 @@ module "cbr_zone" {
5047
########################################################################################################################
5148

5249
module "app_config" {
53-
source = "../.."
54-
resource_group_id = module.resource_group.resource_group_id
55-
region = var.region
56-
app_config_name = "${var.prefix}-app-config"
57-
app_config_tags = var.resource_tags
58-
50+
source = "../.."
51+
resource_group_id = module.resource_group.resource_group_id
52+
region = var.region
53+
app_config_name = "${var.prefix}-app-config"
54+
app_config_tags = var.resource_tags
55+
enable_config_aggregator = true # See https://cloud.ibm.com/docs/app-configuration?topic=app-configuration-ac-configuration-aggregator
5956
app_config_collections = [
6057
{
6158
name = "${var.prefix}-collection",
6259
collection_id = "${var.prefix}-collection"
6360
description = "Collection for ${var.prefix}"
6461
}
6562
]
66-
6763
cbr_rules = [
6864
{
6965
description = "${var.prefix}-APP-CONF access only from vpc"
File renamed without changes.
File renamed without changes.

examples/complete/variables.tf renamed to examples/advanced/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ variable "region" {
1313
variable "prefix" {
1414
type = string
1515
description = "Prefix to append to all resources created by this example"
16-
default = "complete"
16+
default = "advanced"
1717
}
1818

1919
variable "resource_group" {

examples/complete/version.tf renamed to examples/advanced/version.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ terraform {
66
required_providers {
77
ibm = {
88
source = "IBM-Cloud/ibm"
9-
version = ">= 1.65.0, < 2.0.0"
9+
version = ">= 1.76.1, < 2.0.0"
1010
}
1111
}
1212
}

examples/basic/version.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ terraform {
66
required_providers {
77
ibm = {
88
source = "IBM-Cloud/ibm"
9-
version = "1.65.0"
9+
version = "1.76.1"
1010
}
1111
}
1212
}

0 commit comments

Comments
 (0)