diff --git a/README.md b/README.md index bd177b3..72ddd59 100644 --- a/README.md +++ b/README.md @@ -117,7 +117,7 @@ For more information on access and permissions, see [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)` |
[
"all"
]
| no | | [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 | | [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 | -| [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. | `string` | `"us-south"` | no | +| [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 | | [resource\_group\_id](#input\_resource\_group\_id) | The resource group ID where resources will be provisioned. | `string` | n/a | yes | ### Outputs diff --git a/ibm_catalog.json b/ibm_catalog.json index 7ed272f..4e5ea21 100644 --- a/ibm_catalog.json +++ b/ibm_catalog.json @@ -9,7 +9,8 @@ "ibm_created", "terraform", "solution", - "support_ibm" + "target_terraform", + "converged_infra" ], "keywords": [ "terraform", @@ -19,30 +20,35 @@ "IaC", "infrastructure as code" ], - "short_description": "Creates and configures an App Configuration service on IBM Cloud", - "long_description": "This deployable architecture automates the provisioning of IBM Cloud App Configuration along with initial collection to help you manage feature flags and dynamic properties at scale. It also includes support for configuration aggregators, enabling centralized monitoring and management of configurations across multiple App Configuration instances. It simplifies onboarding by preconfiguring key resources and provides support for defining context-based restrictions (CBR) to enhance security and control access based on network policies. Ideal for teams adopting feature flagging, experimentation, or remote configuration strategies in cloud-native applications, this solution accelerates setup while following IBM Cloud best practices. Refer [this](https://cloud.ibm.com/docs/app-configuration) for more information.", + "short_description": "Creates and configures an App Configuration service on IBM Cloud with optional integration of observability", + "long_description": "This deployable architecture automates the provisioning of IBM Cloud App Configuration along with initial collection to help you manage feature flags and dynamic properties at scale. It also includes support for configuration aggregators, enabling centralized monitoring and management of configurations across multiple App Configuration instances. It simplifies onboarding by preconfiguring key resources and provides support for defining context-based restrictions (CBR) to enhance security and control access based on network policies. Ideal for teams adopting feature flagging, experimentation, or remote configuration strategies in cloud-native applications, this solution accelerates setup while following IBM Cloud best practices. Refer [this](https://cloud.ibm.com/docs/app-configuration) for more information.\n\nℹ️ This Terraform-based automation is part of a broader suite of IBM-maintained Infrastructure as Code (IaC) assets, each following the naming pattern \"Cloud automation for *servicename*\" and focusing on single IBM Cloud service. These single-service deployable architectures can be used on their own to streamline and automate service deployments through an [IaC approach](https://cloud.ibm.com/docs/secure-enterprise?topic=secure-enterprise-understanding-projects), or assembled together into a broader [automated IaC stack](https://cloud.ibm.com/docs/secure-enterprise?topic=secure-enterprise-config-stack) to automate the deployment of an end-to-end solution architecture.", "offering_docs_url": "https://github.com/terraform-ibm-modules/terraform-ibm-app-configuration/blob/main/README.md", "offering_icon_url": "https://raw.githubusercontent.com/terraform-ibm-modules/terraform-ibm-app-configuration/main/images/app_config-icon.png", "provider_name": "IBM", "features": [ { - "title": "Provision Collection", - "description": "Supports creation of collection to help manage feature flags and dynamic properties at scale." + "title": "Collections", + "description": "Supports creation of one or more [collections](https://cloud.ibm.com/docs/app-configuration?topic=app-configuration-ac-collections) depending on the plan to help manage feature flags and dynamic properties at scale." }, { "title": "CBR Enhanced Security", - "description": "Provides support for defining context-based restrictions (CBR) to enhance security and control access based on network policies." + "description": "Provides support for defining context-based restrictions ([CBR](https://cloud.ibm.com/docs/app-configuration?topic=app-configuration-ac-restrict-access-cbr)) to enhance security and control access based on network policies." + }, + { + "title": "Trusted Profile", + "description": "Creates [trusted profile](https://cloud.ibm.com/docs/app-configuration?topic=app-configuration-ac-configuration-aggregator#ac-enable-configuration-aggregator-single-account) needed with required access for configuration aggregator." }, { "title": "Configuration Aggregator", - "description": "Supports creation and management of configuration aggregator to manage configurations across multiple App Configuration instances." + "description": "Supports creation and management of configuration [aggregator](https://cloud.ibm.com/docs/app-configuration?topic=app-configuration-ac-configuration-aggregator) to manage configurations across multiple App Configuration instances." } ], - "support_details": "This product is in the community registry, as such support is handled through the originated repo. If you experience issues please open an issue in that repository [https://github.com/terraform-ibm-modules/terraform-ibm-app-configuration/issues](https://github.com/terraform-ibm-modules/terraform-ibm-app-configuration/issues). Please note this product is not supported via the IBM Cloud Support Center.", + "support_details": "This product is in the community registry, as such support is handled through the originated repo. If you experience issues please open an issue in that repository [here](https://github.com/terraform-ibm-modules/terraform-ibm-app-configuration/issues). Please note this product is not supported via the IBM Cloud Support Center.", "flavors": [ { "label": "Fully configurable", "name": "fully-configurable", + "index": 1, "install_type": "fullstack", "working_directory": "solutions/fully-configurable", "compliance": { @@ -105,6 +111,14 @@ { "displayname": "Sao Paulo (br-sao)", "value": "br-sao" + }, + { + "displayname": "BNPP_EU", + "value": "eu-fr2" + }, + { + "displayname": "Montreal (ca-mon)", + "value": "ca-mon" } ] }, @@ -132,36 +146,37 @@ }, { "key": "enable_platform_metrics", - "type": "string", - "default_value": "true", + "type": "boolean", + "default_value": false, "description": "When set to `true`, the IBM Cloud Monitoring instance will be configured to collect platform metrics from the provided region. You can configure 1 instance only of the IBM Cloud Monitoring service per region to collect platform metrics in that location. Check with the account or service administrator if another monitoring instance has already been configured. You may not have permissions to see all monitoring instances in the region. [Learn more](https://cloud.ibm.com/docs/monitoring?topic=monitoring-platform_metrics_enabling).", "required": true, "virtual": true, "options": [ { "displayname": "true", - "value": "true" + "value": true }, { "displayname": "false", - "value": "false" + "value": false } ] }, { "key": "logs_routing_tenant_regions", - "type": "list(string)", - "default_value": "[]", + "type": "array", + "default_value": [], "description": "To manage platform logs that are generated by IBM Cloud services in a region of IBM Cloud, you must create a tenant in each region that you operate. Pass a list of regions to create a tenant in. [Learn more](https://cloud.ibm.com/docs/logs-router?topic=logs-router-about-platform-logs).", "required": true, - "virtual": true, "custom_config": { + "type": "array", "grouping": "deployment", "original_grouping": "deployment", "config_constraints": { - "type": "string" + "type": "string" } - } + }, + "virtual": true }, { "key": "existing_resource_group_name", @@ -192,7 +207,13 @@ ] }, { - "key": "app_config_collections" + "key": "app_config_collections", + "type": "array", + "custom_config": { + "type": "textarea", + "grouping": "deployment", + "original_grouping": "deployment" + } }, { "key": "app_config_tags", @@ -229,7 +250,13 @@ "key": "config_aggregator_enterprise_account_ids_to_assign" }, { - "key": "app_config_cbr_rules" + "key": "cbr_rules", + "type": "array", + "custom_config": { + "type": "textarea", + "grouping": "deployment", + "original_grouping": "deployment" + } }, { "key": "provider_visibility", @@ -252,10 +279,11 @@ ], "iam_permissions": [ { - "service_name": "resource-group", "role_crns": [ "crn:v1:bluemix:public:iam::::role:Viewer" - ] + ], + "service_name": "Resource group only", + "notes": "Viewer access is required in the resource group you want to provision in." }, { "role_crns": [ @@ -264,27 +292,77 @@ ], "service_name": "apprapp", "notes": "Required for provisioning the App Configuration instance." + }, + { + "role_crns": [ + "crn:v1:bluemix:public:iam::::role:Administrator" + ], + "service_name": "All Account Management services", + "notes": "[Optional] Required to deploy Cloud automation for account configuration which creates resource group and to create trusted profile for App Configuration aggregator." + }, + { + "role_crns": [ + "crn:v1:bluemix:public:iam::::role:Administrator" + ], + "service_name": "All Identity and Access enabled services", + "notes": "[Optional] Required to deploy Cloud automation for account configuration which creates foundational IBM Cloud account resources, like resource group with account settings and to create trusted profile for App Configuration aggregator." + }, + { + "role_crns": [ + "crn:v1:bluemix:public:iam::::serviceRole:Writer", + "crn:v1:bluemix:public:iam::::role:Editor" + ], + "service_name": "atracker", + "notes": "[Optional] Required to configure Activity Tracker Event Routing with Cloud automation for Observability." + }, + { + "role_crns": [ + "crn:v1:bluemix:public:iam::::serviceRole:Manager", + "crn:v1:bluemix:public:iam::::role:Editor" + ], + "service_name": "sysdig-monitor", + "notes": "[Optional] Required to create an instance of Cloud Monitoring." + }, + { + "role_crns": [ + "crn:v1:bluemix:public:iam::::serviceRole:Manager", + "crn:v1:bluemix:public:iam::::role:Editor" + ], + "service_name": "logs", + "notes": "[Optional] Required to create an instance of Cloud Logs." + }, + { + "role_crns": [ + "crn:v1:bluemix:public:iam::::serviceRole:Manager", + "crn:v1:bluemix:public:iam::::role:Editor" + ], + "service_name": "hs-crypto", + "notes": "[Optional] Required if Hyper Protect Crypto Services is used in Cloud automation for Observability." + }, + { + "role_crns": [ + "crn:v1:bluemix:public:iam::::serviceRole:Manager", + "crn:v1:bluemix:public:iam::::role:Editor" + ], + "service_name": "kms", + "notes": "[Optional] Required to deploy Cloud automation for Key Protect, so you can use your own managed encryption keys." + }, + { + "role_crns": [ + "crn:v1:bluemix:public:iam::::serviceRole:Manager", + "crn:v1:bluemix:public:iam::::role:Editor" + ], + "service_name": "cloud-object-storage", + "notes": "[Optional] Required to deploy Cloud automation for Object Storage." } ], "architecture": { "descriptions": "This architecture supports creating and configuring an IBM Cloud App Configuration", "features": [ { - "title": "App Configuration instance with Collections", - "description": "Creates App Configuration instance. Collections can be created and configured for the instance" - }, - { - "title": "Use existing resource group", - "description": "Supports deployment into an existing IBM Cloud resource group." - }, - { - "title": "CBR Enhanced Security", - "description": "Enforces network-based access control through context-based restrictions (CBR) rules." - }, - { - "title": "Configuration Aggregator", - "description": "Enables the creation and management of configuration aggregator to consolidate and monitor configurations across multiple App Configuration instances." - } + "title": " ", + "description": "Configured to use IBM secure-by-default standards, but can be edited to fit your use case." + } ], "diagrams": [ { @@ -293,7 +371,7 @@ "url": "https://raw.githubusercontent.com/terraform-ibm-modules/terraform-ibm-app-configuration/main/reference-architecture/app_configuration.svg", "type": "image/svg+xml" }, - "description": "**App Configuration on IBM Cloud**

Description
This architecture automates the setup of IBM Cloud App Configuration. The modular design includes the creation of a collection to streamline the management of feature flags and properties, consolidation of multiple App Cpnfiguration instances via configuration aggregator and optionally integrates context-based restrictions (CBR) to improve access control and align with your network security policies." + "description": "This architecture automates the setup of IBM Cloud App Configuration. The modular design includes the creation of a collection to streamline the management of feature flags and properties, consolidation of multiple App Cpnfiguration instances via configuration aggregator and optionally integrates context-based restrictions (CBR) to improve access control and align with your network security policies." } ] }, @@ -330,7 +408,7 @@ }, { "name": "deploy-arch-ibm-observability", - "description": "Enable to provision and configure IBM Cloud Logs, Cloud Monitoring, Metrics routing and Activity Tracker event routing for analysing logs and metrics generated by the App Configuration instance.", + "description": "Configures IBM Cloud Logs, Cloud Monitoring, Metrics routing and Activity Tracker event routing for analysing logs and metrics generated by the App Configuration instance.", "flavors": [ "instances" ], diff --git a/reference-architecture/app_configuration.svg b/reference-architecture/app_configuration.svg index 2d05474..d4b5066 100644 --- a/reference-architecture/app_configuration.svg +++ b/reference-architecture/app_configuration.svg @@ -1,4 +1,4 @@ -
IBM Cloud
Region
Resource Group
App Config
\ No newline at end of file +IBM CloudRegion[Optional]
Observability
Cloud LogsCloud Monitoring
Resource Group
App Config
\ No newline at end of file diff --git a/solutions/fully-configurable/DA-cbr_rules.md b/solutions/fully-configurable/DA-cbr_rules.md index 0581f0f..56e34e3 100644 --- a/solutions/fully-configurable/DA-cbr_rules.md +++ b/solutions/fully-configurable/DA-cbr_rules.md @@ -1,12 +1,12 @@ # Configuring context-based restrictions (CBRs) -The `app_config_cbr_rules` input variable allows you to provide a rule for the target service to enforce access restrictions for the service based on the context of access requests. Contexts are criteria that include the network location of access requests, the endpoint type from where the request is sent, etc. +The `cbr_rules` input variable allows you to provide a rule for the target service to enforce access restrictions for the service based on the context of access requests. Contexts are criteria that include the network location of access requests, the endpoint type from where the request is sent, etc. -- Variable name: `app_config_cbr_rules`. +- Variable name: `cbr_rules`. - Type: A list of objects. Allows only one object representing a rule for the target service - Default value: An empty list (`[]`). -### Options for app_config_cbr_rules +### Options for cbr_rules - `description` (required): The description of the rule to create. - `account_id` (required): The IBM Cloud Account ID @@ -28,8 +28,8 @@ The `app_config_cbr_rules` input variable allows you to provide a rule for the t [ { description = "Restrict access to App Config from trusted network" - account_id = "" - enforcement_mode = "enabled" + account_id = "" + enforcement_mode = "report" tags = [ { name = "env" @@ -41,7 +41,7 @@ The `app_config_cbr_rules` input variable allows you to provide a rule for the t attributes = [ { name = "networkZoneId" - value = "" + value = "" }, { "name" : "endpointType", diff --git a/solutions/fully-configurable/DA-prefix.md b/solutions/fully-configurable/DA-prefix.md deleted file mode 100644 index 822c7d1..0000000 --- a/solutions/fully-configurable/DA-prefix.md +++ /dev/null @@ -1,38 +0,0 @@ -# Prefix in Deployable Architecture - -The **`prefix`** input variable allows you to prepend a custom string to the names of all resources created by this automation. This is especially useful for: - -- **Avoiding naming collisions** when deploying the same solution multiple times within the same account. -- **Creating identical infrastructure** across multiple regions or environments. -- **Improving resource traceability** by embedding environment or region identifiers into resource names. - -If you do not wish to use a prefix, you may set the value to `null` or an empty string (`""`). - -**Important**: The automation automatically inserts a hyphen between the prefix and the resource name. Therefore, you do not need to include a hyphen in the prefix yourself. - -### Examples - -Here are some common patterns for using the prefix: - -- **Environment-based**: - - `dev`, `test`, `prod` -- **Environment + Region**: - - `dev-eu-gb`, `prod-us-south`, `test-jp-tok` -- **Project-specific**: - - `webapp-dev`, `ml-prod`, `iot-test` -- **Team or department identifiers**: - - `fin-dev`, `hr-prod`, `eng-test` -- **Date or version-based** (for temporary or experimental deployments): - - `exp-202505`, `v2-dev` - -These conventions help ensure that resources are clearly grouped and easily identifiable, especially in shared or multi-tenant accounts. - -### Naming Rules - -To ensure compatibility and consistency, the prefix must follow these rules: - -- Must begin with a **lowercase letter** -- May contain only **lowercase letters**, **digits**, and **hyphens (`-`)** -- Must **not end** with a hyphen (`-`) -- Must **not contain consecutive hyphens** (`--`) -- Maximum length: **16 characters** diff --git a/solutions/fully-configurable/README.md b/solutions/fully-configurable/README.md index b4c8f7b..d9b8d3b 100644 --- a/solutions/fully-configurable/README.md +++ b/solutions/fully-configurable/README.md @@ -1,11 +1,3 @@ -# Cloud automation for App Configuration - -[![Catalog release](https://img.shields.io/badge/release-IBM%20Cloud%20Catalog-3662FF?logo=ibm)](https://cloud.ibm.com/catalog/7a4d68b4-cf8b-40cd-a3d1-f49aff526eb3/architecture/deploy-arch-ibm-apprapp-045c1169-d15a-4046-ae81-aa3d3348421f-global) - -This solution supports provisioning and configuring the following infrastructure: - -- App Config instance and collections -- Optional context-based restrictions (CBR) -- Configuration aggregator +# Cloud automation for App Configuration (Fully configurable) :exclamation: **Important:** This solution is not intended to be called by other modules because it contains a provider configuration and is not compatible with the `for_each`, `count`, and `depends_on` arguments. For more information, see [Providers Within Modules](https://developer.hashicorp.com/terraform/language/modules/develop/providers). diff --git a/solutions/fully-configurable/main.tf b/solutions/fully-configurable/main.tf index 59a5a7a..d705736 100644 --- a/solutions/fully-configurable/main.tf +++ b/solutions/fully-configurable/main.tf @@ -31,5 +31,5 @@ module "app_config" { config_aggregator_enterprise_trusted_profile_template_name = "${local.prefix}${var.config_aggregator_enterprise_trusted_profile_template_name}" config_aggregator_enterprise_account_group_ids_to_assign = var.config_aggregator_enterprise_account_group_ids_to_assign config_aggregator_enterprise_account_ids_to_assign = var.config_aggregator_enterprise_account_ids_to_assign - cbr_rules = var.app_config_cbr_rules + cbr_rules = var.cbr_rules } diff --git a/solutions/fully-configurable/provider.tf b/solutions/fully-configurable/provider.tf index f69fb6d..146dea9 100644 --- a/solutions/fully-configurable/provider.tf +++ b/solutions/fully-configurable/provider.tf @@ -1,5 +1,6 @@ provider "ibm" { - ibmcloud_api_key = var.ibmcloud_api_key - region = var.region - visibility = var.provider_visibility + ibmcloud_api_key = var.ibmcloud_api_key + region = var.region + visibility = var.provider_visibility + private_endpoint_type = (var.provider_visibility == "private" && var.region == "ca-mon") ? "vpe" : null } diff --git a/solutions/fully-configurable/variables.tf b/solutions/fully-configurable/variables.tf index d47ffbd..ab7ad33 100644 --- a/solutions/fully-configurable/variables.tf +++ b/solutions/fully-configurable/variables.tf @@ -29,7 +29,7 @@ variable "existing_resource_group_name" { variable "prefix" { type = string nullable = true - description = "The prefix to be added to all resources created by this solution. To skip using a prefix, set this value to null or an empty string. The prefix must begin with a lowercase letter and may contain only lowercase letters, digits, and hyphens '-'. It should not exceed 16 characters, must not end with a hyphen('-'), and can not contain consecutive hyphens ('--'). Example: prod-us-south. [Learn more](https://github.com/terraform-ibm-modules/terraform-ibm-app-configuration/tree/main/solutions/fully-configurable/DA-prefix.md)." + description = "The prefix to be added to all resources created by this solution. To skip using a prefix, set this value to null or an empty string. The prefix must begin with a lowercase letter and may contain only lowercase letters, digits, and hyphens '-'. It should not exceed 16 characters, must not end with a hyphen('-'), and can not contain consecutive hyphens ('--'). Example: prod-us-south. [Learn more](https://terraform-ibm-modules.github.io/documentation/#/prefix.md)." validation { # - null and empty string is allowed @@ -49,7 +49,7 @@ variable "prefix" { variable "region" { type = string - description = "The region to provision resources to." + description = "The region to provision all resources in. [Learn more](https://terraform-ibm-modules.github.io/documentation/#/region) about how to select different regions for different services." default = "us-south" nullable = false } @@ -61,14 +61,14 @@ variable "region" { variable "app_config_name" { type = string - description = "Name for the App Configuration service instance" + description = "Name for the App Configuration service instance." default = "app-config" nullable = false } variable "app_config_plan" { type = string - description = "Plan for the App Configuration service instance" + description = "Plan for the App Configuration service instance." default = "standardv2" nullable = false } @@ -196,7 +196,7 @@ variable "config_aggregator_enterprise_account_ids_to_assign" { # Context-based restriction (CBR) ############################################################## -variable "app_config_cbr_rules" { +variable "cbr_rules" { type = list(object({ description = string account_id = string diff --git a/tests/pr_test.go b/tests/pr_test.go index a38801d..2a25d0d 100644 --- a/tests/pr_test.go +++ b/tests/pr_test.go @@ -30,6 +30,8 @@ var validRegions = []string{ "us-south", "ca-tor", "br-sao", + "eu-fr2", + "ca-mon", } func setupOptions(t *testing.T, prefix string, dir string) *testhelper.TestOptions { diff --git a/variables.tf b/variables.tf index fca58dc..4fb5617 100644 --- a/variables.tf +++ b/variables.tf @@ -8,13 +8,13 @@ variable "resource_group_id" { } variable "region" { - description = "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." + description = "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." type = string default = "us-south" validation { - condition = contains(["au-syd", "jp-osa", "jp-tok", "eu-de", "eu-gb", "eu-es", "us-east", "us-south", "ca-tor", "br-sao", "eu-fr2"], var.region) - error_message = "Value for region must be one of the following: ${join(", ", ["jp-osa", "au-syd", "jp-tok", "eu-de", "eu-gb", "eu-es", "us-east", "us-south", "ca-tor", "br-sao", "eu-fr2"])}" + condition = contains(["au-syd", "jp-osa", "jp-tok", "eu-de", "eu-gb", "eu-es", "us-east", "us-south", "ca-tor", "br-sao", "eu-fr2", "ca-mon"], var.region) + error_message = "Value for region must be one of the following: ${join(", ", ["jp-osa", "au-syd", "jp-tok", "eu-de", "eu-gb", "eu-es", "us-east", "us-south", "ca-tor", "br-sao", "eu-fr2", "ca-mon"])}" } }