Skip to content

Commit 08a5200

Browse files
Merge branch 'main' into renovate/dependencies
2 parents 403a1cf + 1533ff1 commit 08a5200

28 files changed

+1745
-528
lines changed

.catalog-onboard-pipeline.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@ offerings:
1313
instance_id: 1c7d5f78-9262-44c3-b779-b28fe4d88c37
1414
region: us-south
1515
scope_resource_group_var_name: existing_resource_group_name
16+
pre_validation: "tests/scripts/pre-validation.sh"
17+
post_validation: "tests/scripts/post-validation.sh"

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ For more information on access and permissions, see <https://cloud.ibm.com/docs/
8080
|------|---------|
8181
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.9.0 |
8282
| <a name="requirement_ibm"></a> [ibm](#requirement\_ibm) | >= 1.79.1, < 2.0.0 |
83+
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 3.5.1, < 4.0.0 |
84+
| <a name="requirement_time"></a> [time](#requirement\_time) | >= 0.9.1, < 1.0.0 |
8385

8486
### Modules
8587

@@ -89,21 +91,32 @@ For more information on access and permissions, see <https://cloud.ibm.com/docs/
8991
| <a name="module_config_aggregator_trusted_profile"></a> [config\_aggregator\_trusted\_profile](#module\_config\_aggregator\_trusted\_profile) | terraform-ibm-modules/trusted-profile/ibm | 3.1.1 |
9092
| <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 | 3.1.1 |
9193
| <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 | 3.1.1 |
94+
| <a name="module_en_crn_parser"></a> [en\_crn\_parser](#module\_en\_crn\_parser) | terraform-ibm-modules/common-utilities/ibm//modules/crn-parser | 1.2.0 |
95+
| <a name="module_kms_crn_parser"></a> [kms\_crn\_parser](#module\_kms\_crn\_parser) | terraform-ibm-modules/common-utilities/ibm//modules/crn-parser | 1.2.0 |
9296

9397
### Resources
9498

9599
| Name | Type |
96100
|------|------|
97101
| [ibm_app_config_collection.collections](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/app_config_collection) | resource |
102+
| [ibm_app_config_integration_en.app_config_integration_en](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/app_config_integration_en) | resource |
103+
| [ibm_app_config_integration_kms.app_config_integration_kms](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/app_config_integration_kms) | resource |
98104
| [ibm_config_aggregator_settings.config_aggregator_settings](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/config_aggregator_settings) | resource |
105+
| [ibm_iam_authorization_policy.en_policy](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/iam_authorization_policy) | resource |
106+
| [ibm_iam_authorization_policy.kms_policy](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/iam_authorization_policy) | resource |
99107
| [ibm_iam_custom_role.template_assignment_reader](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/iam_custom_role) | resource |
100108
| [ibm_resource_instance.app_config](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/resource_instance) | resource |
109+
| [random_string.en_integration_id](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/string) | resource |
110+
| [random_string.kms_integration_id](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/string) | resource |
111+
| [time_sleep.wait_for_en_authorization_policy](https://registry.terraform.io/providers/hashicorp/time/latest/docs/resources/sleep) | resource |
112+
| [time_sleep.wait_for_kms_authorization_policy](https://registry.terraform.io/providers/hashicorp/time/latest/docs/resources/sleep) | resource |
101113

102114
### Inputs
103115

104116
| Name | Description | Type | Default | Required |
105117
|------|-------------|------|---------|:--------:|
106118
| <a name="input_app_config_collections"></a> [app\_config\_collections](#input\_app\_config\_collections) | A list of collections to be added to the App Configuration instance | <pre>list(object({<br/> name = string<br/> collection_id = string<br/> description = optional(string, null)<br/> tags = optional(string, null)<br/> }))</pre> | `[]` | no |
119+
| <a name="input_app_config_event_notifications_source_name"></a> [app\_config\_event\_notifications\_source\_name](#input\_app\_config\_event\_notifications\_source\_name) | The name by which Event Notifications source will be created in the existing Event Notification instance. | `string` | `"app-config-en-source-name"` | no |
107120
| <a name="input_app_config_name"></a> [app\_config\_name](#input\_app\_config\_name) | Name for the App Configuration service instance | `string` | n/a | yes |
108121
| <a name="input_app_config_plan"></a> [app\_config\_plan](#input\_app\_config\_plan) | Plan for the App Configuration service instance, valid plans are lite, basic, standardv2, and enterprise. | `string` | `"lite"` | no |
109122
| <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 |
@@ -117,8 +130,18 @@ For more information on access and permissions, see <https://cloud.ibm.com/docs/
117130
| <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 |
118131
| <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 |
119132
| <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 |
133+
| <a name="input_enable_event_notifications"></a> [enable\_event\_notifications](#input\_enable\_event\_notifications) | Flag to enable the event notification when the configured plan is 'enterprise'. | `bool` | `false` | no |
134+
| <a name="input_event_notifications_endpoint_url"></a> [event\_notifications\_endpoint\_url](#input\_event\_notifications\_endpoint\_url) | The URL of the Event Notifications service endpoint to use for notifying configuration changes. For more information on the endpoint URL for Event Notifications, go to [Service endpoints](https://cloud.ibm.com/docs/event-notifications?topic=event-notifications-en-regions-endpoints#en-service-endpoints). It is required if `enable_event_notifications` is set to true. | `string` | `null` | no |
135+
| <a name="input_event_notifications_integration_description"></a> [event\_notifications\_integration\_description](#input\_event\_notifications\_integration\_description) | The description of integration between Event Notification and App Configuration service. | `string` | `"The App Configuration integration to send notifications of events of users"` | no |
136+
| <a name="input_existing_event_notifications_instance_crn"></a> [existing\_event\_notifications\_instance\_crn](#input\_existing\_event\_notifications\_instance\_crn) | The CRN of the existing Event Notifications instance to enable notifications for your App Configuration instance. It is required if `enable_event_notifications` is set to true | `string` | `null` | no |
137+
| <a name="input_existing_kms_instance_crn"></a> [existing\_kms\_instance\_crn](#input\_existing\_kms\_instance\_crn) | The CRN of the Hyper Protect Crypto Services or Key Protect instance. Required only if `var.kms_encryption_enabled` is set to `true`. | `string` | `null` | no |
138+
| <a name="input_kms_encryption_enabled"></a> [kms\_encryption\_enabled](#input\_kms\_encryption\_enabled) | Flag to enable the KMS encryption when the configured plan is 'enterprise'. | `bool` | `false` | no |
139+
| <a name="input_kms_endpoint_url"></a> [kms\_endpoint\_url](#input\_kms\_endpoint\_url) | The URL of the key management service endpoint to use for key encryption. For more information on the endpoint URL format for Hyper Protect Crypto Services, go to [Instance-based endpoints](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-regions#new-service-endpoints). For more information on the endpoint URL format for Key Protect, go to [Service endpoints](https://cloud.ibm.com/docs/key-protect?topic=key-protect-regions#service-endpoints). It is required if `kms_encryption_enabled` is set to true. | `string` | `null` | no |
120140
| <a name="input_region"></a> [region](#input\_region) | The region to provision the App Configuration service, valid regions are au-syd, jp-osa, jp-tok, eu-de, eu-gb, eu-es, us-east, us-south, ca-tor, br-sao, eu-fr2, ca-mon. | `string` | `"us-south"` | no |
121141
| <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 |
142+
| <a name="input_root_key_id"></a> [root\_key\_id](#input\_root\_key\_id) | The key ID of a root key, existing in the key management service instance passed in `var.existing_kms_instance_crn`, which is used to encrypt the data encryption keys which are then used to encrypt the data. Required only if `var.kms_encryption_enabled` is set to `true`. | `string` | `null` | no |
143+
| <a name="input_skip_app_config_event_notifications_auth_policy"></a> [skip\_app\_config\_event\_notifications\_auth\_policy](#input\_skip\_app\_config\_event\_notifications\_auth\_policy) | Set to true to skip the creation of an IAM authorization policy that permits App configuration instances to integrate with Event Notification in the same account. | `bool` | `false` | no |
144+
| <a name="input_skip_app_config_kms_auth_policy"></a> [skip\_app\_config\_kms\_auth\_policy](#input\_skip\_app\_config\_kms\_auth\_policy) | Set to true to skip the creation of an IAM authorization policy that permits App configuration instances to read the encryption key from the KMS instance in the same account. | `bool` | `false` | no |
122145

123146
### Outputs
124147

examples/advanced/README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,13 @@
66
An end-to-end example that will provision the following:
77

88
- A new resource group if one is not passed in.
9+
- A new Key Management Service instance with Key Protect encryption.
10+
- A root key inside the key ring for the above KMS instance.
11+
- A new Event Notifications instance.
912
- A new App Configuration instance.
1013
- A new collection within the App Configuration instance.
1114
- 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
15+
- Integration between App Configuration and Key Management Service instance.
16+
- Integration between App Configuration and Event Notification instance.
17+
- A CBR zone for the Schematics service
18+
- A CBR rule to only allow the App Configuration instance to be accessed from Schematics over private endpoint

examples/advanced/main.tf

Lines changed: 65 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,30 +18,71 @@ data "ibm_iam_account_settings" "iam_account_settings" {
1818
}
1919

2020
##############################################################################
21-
# VPC
22-
##############################################################################
23-
resource "ibm_is_vpc" "example_vpc" {
24-
name = "${var.prefix}-vpc"
25-
resource_group = module.resource_group.resource_group_id
26-
tags = var.resource_tags
27-
}
28-
29-
##############################################################################
30-
# Create CBR Zone
21+
# Create CBR Zone for Schematics service
3122
##############################################################################
3223

3324
module "cbr_zone" {
3425
source = "terraform-ibm-modules/cbr/ibm//modules/cbr-zone-module"
35-
version = "1.33.0"
36-
name = "${var.prefix}-VPC-network-zone"
37-
zone_description = "CBR Network zone representing VPC"
26+
version = "1.33.2"
27+
name = "${var.prefix}-schematics-zone"
28+
zone_description = "CBR Network zone containing Schematics"
3829
account_id = data.ibm_iam_account_settings.iam_account_settings.account_id
3930
addresses = [{
40-
type = "vpc", # to bind a specific vpc to the zone
41-
value = ibm_is_vpc.example_vpc.crn,
31+
type = "serviceRef",
32+
ref = {
33+
account_id = data.ibm_iam_account_settings.iam_account_settings.account_id
34+
service_name = "schematics"
35+
}
4236
}]
4337
}
4438

39+
##############################################################################
40+
# Create KMS Instance
41+
##############################################################################
42+
43+
locals {
44+
key_ring_name = "${var.prefix}-ring"
45+
key_name = "${var.prefix}-root-key"
46+
}
47+
48+
module "key_protect_all_inclusive" {
49+
source = "terraform-ibm-modules/kms-all-inclusive/ibm"
50+
version = "5.1.22"
51+
resource_group_id = module.resource_group.resource_group_id
52+
key_protect_instance_name = "${var.prefix}-kms"
53+
region = var.region
54+
resource_tags = var.resource_tags
55+
key_ring_endpoint_type = "public"
56+
key_endpoint_type = "public"
57+
keys = [
58+
{
59+
key_ring_name = local.key_ring_name
60+
keys = [
61+
{
62+
key_name = local.key_name
63+
force_delete = true # Setting it to true for testing purpose
64+
}
65+
]
66+
}
67+
]
68+
}
69+
70+
##############################################################################
71+
# Create EN Instance
72+
##############################################################################
73+
74+
module "event_notifications" {
75+
source = "terraform-ibm-modules/event-notifications/ibm"
76+
version = "2.7.0"
77+
resource_group_id = module.resource_group.resource_group_id
78+
name = "${var.prefix}-en"
79+
tags = var.resource_tags
80+
plan = "lite"
81+
service_endpoints = "public-and-private"
82+
region = var.region
83+
}
84+
85+
4586
########################################################################################################################
4687
# App Config
4788
########################################################################################################################
@@ -53,7 +94,7 @@ module "app_config" {
5394
app_config_name = "${var.prefix}-app-config"
5495
app_config_tags = var.resource_tags
5596
enable_config_aggregator = true # See https://cloud.ibm.com/docs/app-configuration?topic=app-configuration-ac-configuration-aggregator
56-
app_config_plan = "standardv2"
97+
app_config_plan = "enterprise"
5798
config_aggregator_trusted_profile_name = "${var.prefix}-config-aggregator-trusted-profile"
5899
app_config_collections = [
59100
{
@@ -64,7 +105,7 @@ module "app_config" {
64105
]
65106
cbr_rules = [
66107
{
67-
description = "${var.prefix}-APP-CONF access only from vpc"
108+
description = "${var.prefix}-APP-CONF access only from Schematics"
68109
enforcement_mode = "enabled"
69110
account_id = data.ibm_iam_account_settings.iam_account_settings.account_id
70111
tags = [
@@ -86,4 +127,11 @@ module "app_config" {
86127
}]
87128
}
88129
]
130+
kms_encryption_enabled = true
131+
existing_kms_instance_crn = module.key_protect_all_inclusive.key_protect_crn
132+
root_key_id = module.key_protect_all_inclusive.keys["${local.key_ring_name}.${local.key_name}"].key_id
133+
kms_endpoint_url = module.key_protect_all_inclusive.kms_public_endpoint
134+
enable_event_notifications = true
135+
existing_event_notifications_instance_crn = module.event_notifications.crn
136+
event_notifications_endpoint_url = module.event_notifications.event_notifications_public_endpoint
89137
}

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.79.1"
9+
version = "1.82.1"
1010
}
1111
}
1212
}

0 commit comments

Comments
 (0)