generated from terraform-ibm-modules/terraform-ibm-module-template
-
Notifications
You must be signed in to change notification settings - Fork 3
App config Gaps fixed - Config aggregator module added #204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 8 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
794fc62
service config gap first step correction
RiadhJouini e7c2137
service config working with central account cspm aggregation
RiadhJouini 8a8a3d7
add repo appconfig module
RiadhJouini 4a9663a
corrected the appconfig crn output
RiadhJouini 59d700f
corrected the appconfig crn output in the root module
RiadhJouini 2b958db
output templateID generated correclty
RiadhJouini 91af9ba
corrected the enterprise_id issue
RiadhJouini c14aff8
trusted profile general correction
RiadhJouini bd88369
cleaning and adjusting
RiadhJouini abc6bdd
adjusting as per IBM standards
RiadhJouini 551a8df
added README.md
RiadhJouini 03b82d6
Update README.md
RiadhJouini 823d4c5
deleting the appconfig folder
RiadhJouini File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| ############################################################################## | ||
| # App Config Only Example | ||
| ############################################################################## | ||
|
|
||
| ######################################################################################################################## | ||
| # Resource group | ||
| ######################################################################################################################## | ||
|
|
||
| module "resource_group" { | ||
| source = "terraform-ibm-modules/resource-group/ibm" | ||
| version = "1.1.6" | ||
| resource_group_name = var.resource_group == null ? "${var.prefix}-resource-group" : null | ||
| existing_resource_group_name = var.resource_group | ||
| } | ||
|
|
||
| ############################################################################## | ||
| # Get Cloud Account ID | ||
| ############################################################################## | ||
|
|
||
| data "ibm_iam_account_settings" "iam_account_settings" {} | ||
|
|
||
| ############################################################################## | ||
| # VPC | ||
| ############################################################################## | ||
|
|
||
| resource "ibm_is_vpc" "example_vpc" { | ||
| name = "${var.prefix}-vpc" | ||
| resource_group = module.resource_group.resource_group_id | ||
| tags = var.resource_tags | ||
| } | ||
|
|
||
| ############################################################################## | ||
| # Create CBR Zone | ||
| ############################################################################## | ||
|
|
||
| module "cbr_zone" { | ||
| source = "terraform-ibm-modules/cbr/ibm//modules/cbr-zone-module" | ||
| version = "1.28.0" | ||
| name = "${var.prefix}-VPC-network-zone" | ||
| zone_description = "CBR Network zone representing VPC" | ||
| account_id = data.ibm_iam_account_settings.iam_account_settings.account_id | ||
| addresses = [{ | ||
| type = "vpc", | ||
| value = ibm_is_vpc.example_vpc.crn, | ||
| }] | ||
| } | ||
|
|
||
| ############################################################################## | ||
| # App Config | ||
| ############################################################################## | ||
|
|
||
| module "app_config" { | ||
| source = "../.." | ||
| resource_group_id = module.resource_group.resource_group_id | ||
| region = var.region | ||
| app_config_name = "${var.prefix}-app-config" | ||
| app_config_tags = var.resource_tags | ||
|
|
||
| app_config_collections = [ | ||
| { | ||
| name = "${var.prefix}-collection", | ||
| collection_id = "${var.prefix}-collection" | ||
| description = "Collection for ${var.prefix}" | ||
| } | ||
| ] | ||
|
|
||
| cbr_rules = [ | ||
| { | ||
| description = "${var.prefix}-APP-CONF access only from vpc" | ||
| enforcement_mode = "enabled" | ||
| account_id = data.ibm_iam_account_settings.iam_account_settings.account_id | ||
| tags = [ | ||
| { | ||
| name = "test-name" | ||
| value = "test-value" | ||
| } | ||
| ] | ||
| rule_contexts = [{ | ||
| attributes = [ | ||
| { | ||
| name = "endpointType" | ||
| value = "private" | ||
| }, | ||
| { | ||
| name = "networkZoneId" | ||
| value = module.cbr_zone.zone_id | ||
| } | ||
| ] | ||
| }] | ||
| } | ||
| ] | ||
| } | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| output "app_config_crn" { | ||
| value = ibm_resource_instance.app_config.crn | ||
| } | ||
|
|
||
| output "app_config_guid" { | ||
| description = "GUID of the App Configuration instance" | ||
| value = module.app_config.app_config_guid | ||
| } | ||
|
|
||
| output "app_config_collection_ids" { | ||
| description = "List of IDs for the collections in the App Configuration instance" | ||
| value = module.app_config.app_config_collection_ids | ||
| } | ||
|
|
||
| output "resource_group_name" { | ||
| description = "Name of the resource group used" | ||
| value = var.resource_group | ||
| } | ||
|
|
||
| output "vpc_id" { | ||
| description = "ID of the created VPC" | ||
| value = ibm_is_vpc.example_vpc.id | ||
| } | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| variable "prefix" { | ||
| description = "Prefix for naming all resources" | ||
| type = string | ||
| } | ||
|
|
||
| variable "region" { | ||
| description = "Region where resources will be deployed" | ||
| type = string | ||
| default = "us-south" | ||
| } | ||
|
|
||
| variable "resource_group" { | ||
| description = "Name of existing resource group (if any)" | ||
| type = string | ||
| default = null | ||
| } | ||
|
|
||
| variable "resource_tags" { | ||
| description = "Tags to assign to resources" | ||
| type = list(string) | ||
| default = [] | ||
| } | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| resource "null_resource" "debug_vars" { | ||
RiadhJouini marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| provisioner "local-exec" { | ||
| command = <<EOT | ||
| echo "📦 Template ID: ${var.template_id}" | ||
| echo "🏢 Enterprise ID: ${var.enterprise_id}" | ||
| echo "🔐 Trusted Profile ID: ${var.enterprise_trusted_profile_id}" | ||
| EOT | ||
| } | ||
| } | ||
|
|
||
| resource "ibm_config_aggregator_settings" "scc_wp_aggregator" { | ||
| instance_id = var.app_config_instance_guid | ||
| region = var.region | ||
| resource_collection_enabled = true | ||
| resource_collection_regions = ["all"] | ||
| trusted_profile_id = var.general_trusted_profile_id | ||
|
|
||
| additional_scope { | ||
| type = "Enterprise" | ||
| enterprise_id = var.enterprise_id | ||
|
|
||
| profile_template { | ||
| id = var.template_id | ||
| trusted_profile_id = var.enterprise_trusted_profile_id | ||
| } | ||
| } | ||
| } | ||
|
|
||
RiadhJouini marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| resource "ibm_config_aggregator_settings" "scc_wp_aggregator" { | ||
| instance_id = var.app_config_instance_guid | ||
| region = var.region | ||
| resource_collection_enabled = true | ||
| resource_collection_regions = ["all"] | ||
| trusted_profile_id = var.enterprise_trusted_profile_id | ||
|
|
||
| additional_scope { | ||
| type = "Enterprise" | ||
| enterprise_id = var.enterprise_id | ||
|
|
||
| profile_template { | ||
| id = var.template_id | ||
| trusted_profile_id = var.enterprise_trusted_profile_id | ||
| } | ||
| } | ||
| } | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| output "config_aggregator_instance_id" { | ||
| description = "App Config instance ID used for aggregation" | ||
| value = var.app_config_instance_guid | ||
| } | ||
| output "scc_wp_config_aggregator_id" { | ||
| description = "ID of the SCC-WP Config Aggregator" | ||
| value = ibm_config_aggregator_settings.scc_wp_aggregator.id | ||
| } | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| variable "app_config_instance_guid" { | ||
| type = string | ||
| description = "GUID of the App Configuration instance" | ||
| } | ||
|
|
||
| variable "region" { | ||
| type = string | ||
| description = "Region where the Config Aggregator will be deployed" | ||
RiadhJouini marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| variable "enterprise_id" { | ||
| type = string | ||
| description = "Enterprise ID to scope the Config Aggregator" | ||
| } | ||
|
|
||
| variable "template_id" { | ||
RiadhJouini marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| type = string | ||
| description = "Trusted Profile Template ID used for additional scope" | ||
| } | ||
|
|
||
| variable "enterprise_trusted_profile_id" { | ||
| type = string | ||
| description = "Trusted Profile ID used to authorize resource collection scoping" | ||
| } | ||
RiadhJouini marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| variable "general_trusted_profile_id" { | ||
| type = string | ||
| description = "Trusted Profile ID used to authorize resource collection" | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| terraform { | ||
| required_providers { | ||
| ibm = { | ||
| source = "ibm-cloud/ibm" | ||
| version = ">= 1.65.0, < 2.0.0" | ||
| } | ||
| } | ||
| } | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.