generated from terraform-ibm-modules/terraform-ibm-module-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Full chain of deploy added #208
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
Merged
Merged
Changes from 10 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
f1d3151
chain of deploy created
RiadhJouini c36d6bd
correct templateID variable
RiadhJouini 215896e
output templateID generated correclty
RiadhJouini e4868fe
corrected the enterprise_id issue
RiadhJouini 5004d5c
trusted profile general correction
RiadhJouini c05350d
adjustments done on account groups
RiadhJouini 1959b55
added a README.md file
RiadhJouini 260f233
added the provider back to basic folder
RiadhJouini c97839a
added graduated tier in the wp module calling
RiadhJouini e8567ea
replaced the sources with module ones
RiadhJouini 4b21975
cleaning and adjusting
RiadhJouini 0b2bd41
Refactor: use variables to dynamically create IAM policy templates wi…
RiadhJouini 6907e5e
adjusted sources from local to modules
RiadhJouini 2df6577
adjusting as per IBM standards
RiadhJouini 87d99cc
adjustments
RiadhJouini 7c83e01
App Config Config Aggregator sub-module moved to Resource
RiadhJouini 279fed6
Move trusted relationship sub-module to main Trusted Profile module a…
RiadhJouini 319c066
adjustments
RiadhJouini e093d1d
other adjustments
RiadhJouini cfdd65e
corrected README
RiadhJouini a648fa8
adjusting the modules syntax
RiadhJouini 03b8f64
added versions
RiadhJouini 053108d
Merge branch 'main' into main
ocofaigh 9b752bc
cleanup
ocofaigh 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 |
|---|---|---|
| @@ -1,8 +1,5 @@ | ||
| ######################################################################################################################## | ||
| # Provider config | ||
| ######################################################################################################################## | ||
|
|
||
| provider "ibm" { | ||
| ibmcloud_api_key = var.ibmcloud_api_key | ||
| region = var.region | ||
| } | ||
|
|
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,43 @@ | ||
| # Complete Example: SCC-WP with App Config and Trusted Profiles | ||
|
|
||
| This example demonstrates the full deployment of: | ||
|
|
||
| - IBM Cloud App Configuration | ||
| - IBM Cloud Security and Compliance Center Workload Protection (SCC-WP) | ||
| - IAM Trusted Profile Template with 3 Trusted Profiles | ||
| - Template assignment to account groups | ||
| - Configuration Aggregator to link SCC-WP with App Config | ||
|
|
||
| --- | ||
|
|
||
| ## Flow Overview | ||
|
|
||
| 1. Create or reuse a resource group | ||
| A resource group is created. | ||
|
|
||
| 2. Deploy App Config | ||
| App Config is deployed along with a collection for organizing features and properties. | ||
|
|
||
| 3. Deploy SCC Workload Protection | ||
| SCC-WP is deployed with the `graduated-tier` plan (customizable via variable). | ||
|
|
||
| 4. Create a Trusted Profile Template with 3 profiles | ||
| - App Config - Enterprise | ||
| For IAM template management across the enterprise. | ||
| - App Config - General | ||
| For reading platform and IAM services. | ||
| - SCC-WP Profile | ||
| For integrating SCC-WP with App Config and enterprise usage. | ||
|
|
||
| 5. Assign the template to account groups | ||
|
|
||
| 6. Create SCC-WP Config Aggregator | ||
| The aggregator connects SCC-WP to App Config and uses the enterprise trusted profile and template ID to enforce secure access. | ||
|
|
||
| --- | ||
|
|
||
| ## Usage | ||
|
|
||
| terraform init | ||
| terraform apply | ||
|
|
|
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,71 @@ | ||
| provider "ibm" { | ||
| region = var.region | ||
| ibmcloud_api_key = var.ibmcloud_api_key | ||
| } | ||
|
|
||
| module "resource_group" { | ||
| source = "terraform-ibm-modules/resource-group/ibm" | ||
| version = "1.1.6" | ||
|
|
||
| resource_group_name = var.resource_group == null ? "${var.prefix}-rg" : null | ||
| existing_resource_group_name = var.resource_group | ||
| } | ||
|
|
||
| data "ibm_iam_account_settings" "iam_account_settings" {} | ||
|
|
||
| module "scc_wp" { | ||
RiadhJouini marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| source = "terraform-ibm-modules/scc-workload-protection/ibm" | ||
| version = "1.0.0" | ||
|
|
||
| name = var.prefix | ||
| region = var.region | ||
| scc_wp_service_plan = "graduated-tier" | ||
| resource_group_id = module.resource_group.resource_group_id | ||
| resource_tags = var.resource_tags | ||
| access_tags = var.access_tags | ||
| } | ||
|
|
||
| module "app_config" { | ||
| source = "terraform-ibm-modules/app-configuration/ibm" | ||
| version = "1.0.0" | ||
|
|
||
| region = var.region | ||
| resource_group_id = module.resource_group.resource_group_id | ||
| 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}" | ||
| } | ||
| ] | ||
| } | ||
|
|
||
| module "trusted_profiles" { | ||
| source = "terraform-ibm-modules/trusted-profile-enterprise/ibm" | ||
| version = "1.0.0" | ||
|
|
||
| region = var.region | ||
| app_config_crn = module.app_config.app_config_crn | ||
| scc_wp_crn = module.scc_wp.wp_instance_crn | ||
| ibmcloud_api_key = var.ibmcloud_api_key | ||
| onboard_account_groups = var.onboard_account_groups | ||
| account_group_ids = var.account_group_ids | ||
| } | ||
|
|
||
| module "scc_wp_config_aggregator" { | ||
| source = "terraform-ibm-modules/scc-wp-config-aggregator/ibm" | ||
| version = "1.0.0" | ||
|
|
||
| app_config_instance_guid = module.app_config.app_config_guid | ||
| region = var.region | ||
| enterprise_id = var.enterprise_id | ||
| template_id = module.trusted_profiles.trusted_profile_template_id | ||
| enterprise_trusted_profile_id = module.trusted_profiles.trusted_profile_app_config_enterprise.profile_id | ||
| general_trusted_profile_id = module.trusted_profiles.trusted_profile_app_config_general.profile_id | ||
|
|
||
| depends_on = [module.trusted_profiles] | ||
| } | ||
|
|
||
RiadhJouini marked this conversation as resolved.
Outdated
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,64 @@ | ||
| provider "ibm" { | ||
| region = var.region | ||
| ibmcloud_api_key = var.ibmcloud_api_key | ||
| } | ||
|
|
||
| module "resource_group" { | ||
| source = "terraform-ibm-modules/resource-group/ibm" | ||
| version = "1.1.6" | ||
| resource_group_name = var.resource_group == null ? "${var.prefix}-rg" : null | ||
| existing_resource_group_name = var.resource_group | ||
| } | ||
|
|
||
| data "ibm_iam_account_settings" "iam_account_settings" {} | ||
|
|
||
| module "scc_wp" { | ||
| source = "../.." | ||
| name = var.prefix | ||
| region = var.region | ||
| scc_wp_service_plan = "graduated-tier" | ||
| resource_group_id = module.resource_group.resource_group_id | ||
| resource_tags = var.resource_tags | ||
| access_tags = var.access_tags | ||
| } | ||
|
|
||
| module "app_config" { | ||
| source = "../../../terraform-ibm-app-configuration" | ||
| region = var.region | ||
| resource_group_id = module.resource_group.resource_group_id | ||
| 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}" | ||
| } | ||
| ] | ||
| } | ||
|
|
||
| module "trusted_profiles" { | ||
| source = "../../../terraform-ibm-trusted-profile/examples/enterprise" | ||
| region = var.region | ||
| app_config_crn = module.app_config.app_config_crn | ||
| scc_wp_crn = module.scc_wp.wp_instance_crn | ||
| ibmcloud_api_key = var.ibmcloud_api_key | ||
| onboard_account_groups = var.onboard_account_groups | ||
| account_group_ids = var.account_group_ids | ||
| } | ||
|
|
||
|
|
||
|
|
||
| module "scc_wp_config_aggregator" { | ||
| source = "../../../terraform-ibm-app-configuration/modules/scc_wp_config_aggregator" | ||
|
|
||
| app_config_instance_guid = module.app_config.app_config_guid | ||
| region = var.region | ||
| enterprise_id = var.enterprise_id | ||
| template_id = module.trusted_profiles.trusted_profile_template_id | ||
| enterprise_trusted_profile_id = module.trusted_profiles.trusted_profile_app_config_enterprise.profile_id | ||
| general_trusted_profile_id = module.trusted_profiles.trusted_profile_app_config_general.profile_id | ||
| depends_on = [module.trusted_profiles] | ||
| } | ||
|
|
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 @@ | ||
| output "scc_wp_crn" { | ||
| description = "CRN of the SCC Workload Protection instance" | ||
| value = module.scc_wp.wp_instance_crn | ||
| } | ||
| output "scc_wp_config_aggregator_id" { | ||
| value = module.scc_wp_config_aggregator.scc_wp_config_aggregator_id | ||
| } | ||
| output "trusted_profile_template_id" { | ||
| value = module.trusted_profiles.trusted_profile_template_id | ||
| } | ||
|
|
||
| output "trusted_profile_enterprise_id" { | ||
| value = module.trusted_profiles.trusted_profile_app_config_enterprise.profile_id | ||
| } | ||
|
|
||
| output "app_config_guid" { | ||
| value = module.app_config.app_config_guid | ||
| } | ||
|
|
||
| output "app_config_crn" { | ||
| value = module.app_config.app_config_crn | ||
| } | ||
|
|
|
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,55 @@ | ||
|
|
||
RiadhJouini marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| variable "region" { | ||
| type = string | ||
| } | ||
|
|
||
| variable "prefix" { | ||
| type = string | ||
| } | ||
|
|
||
|
|
||
| variable "onboard_account_groups" { | ||
RiadhJouini marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| type = bool | ||
| default = true | ||
| description = "Whether to onboard all account groups to the template." | ||
| } | ||
|
|
||
| variable "account_group_ids" { | ||
| type = list(string) | ||
| default = [] # ✅ ← IMPORTANT : éviter les prompts inutiles | ||
| description = "Liste des ID de groupes de comptes à assigner au modèle. Utilisé uniquement si onboard_account_groups est false." | ||
| } | ||
RiadhJouini marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
|
|
||
| variable "resource_group" { | ||
| type = string | ||
| default = null | ||
| } | ||
|
|
||
| variable "resource_tags" { | ||
| type = list(string) | ||
| default = [] | ||
| } | ||
|
|
||
| variable "access_tags" { | ||
| type = list(string) | ||
| default = [] | ||
| } | ||
|
|
||
| variable "enterprise_id" { | ||
| type = string | ||
| description = "Enterprise ID for App Configuration aggregator" | ||
| } | ||
|
|
||
| variable "template_id" { | ||
| description = "The ID of the trusted profile template (optional if created later)" | ||
| type = string | ||
| default = null | ||
| } | ||
|
|
||
RiadhJouini marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| variable "ibmcloud_api_key" { | ||
| type = string | ||
| description = "IBM Cloud API key" | ||
| sensitive = true | ||
| } | ||
|
|
||
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,11 @@ | ||
| terraform { | ||
| required_version = ">= 1.3.0" | ||
|
|
||
| required_providers { | ||
| ibm = { | ||
| source = "ibm-cloud/ibm" | ||
| version = ">= 1.65.0, < 2.0.0" | ||
RiadhJouini marked this conversation as resolved.
Outdated
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
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.