Skip to content
This repository was archived by the owner on Mar 19, 2025. It is now read-only.

Commit be22e36

Browse files
authored
feat: added support to attach SCC Workload Protection instance to the SCC instance. If provision_scc_workload_protection is true, the instance will automatically be attached (#53)
1 parent af2a9f3 commit be22e36

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

solutions/instances/README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ This solution supports the following:
88

99
**NB:** This solution is not intended to be called by one or more other modules since it contains a provider configurations, meaning it 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)
1010

11-
### Current limitation
12-
Currently this solution does not support attaching the Workload Protection instance to the SCC instance. That enhancement is being tracked in https://github.com/terraform-ibm-modules/terraform-ibm-scc-da/issues/23
13-
1411
<!-- Below content is automatically populated via pre-commit hook -->
1512
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
1613
### Requirements
@@ -27,7 +24,7 @@ Currently this solution does not support attaching the Workload Protection insta
2724
| <a name="module_cos"></a> [cos](#module\_cos) | terraform-ibm-modules/cos/ibm//modules/fscloud | 7.5.3 |
2825
| <a name="module_kms"></a> [kms](#module\_kms) | terraform-ibm-modules/kms-all-inclusive/ibm | 4.8.5 |
2926
| <a name="module_resource_group"></a> [resource\_group](#module\_resource\_group) | terraform-ibm-modules/resource-group/ibm | 1.1.5 |
30-
| <a name="module_scc"></a> [scc](#module\_scc) | terraform-ibm-modules/scc/ibm | 1.4.0 |
27+
| <a name="module_scc"></a> [scc](#module\_scc) | terraform-ibm-modules/scc/ibm | 1.4.1 |
3128
| <a name="module_scc_wp"></a> [scc\_wp](#module\_scc\_wp) | terraform-ibm-modules/scc-workload-protection/ibm | 1.3.0 |
3229

3330
### Resources
@@ -72,6 +69,7 @@ No resources.
7269
| <a name="input_scc_wp_service_plan"></a> [scc\_wp\_service\_plan](#input\_scc\_wp\_service\_plan) | SCC Workload Protection instance service pricing plan. Allowed values are: `free-trial` or `graduated-tier`. | `string` | `"graduated-tier"` | no |
7370
| <a name="input_skip_cos_kms_auth_policy"></a> [skip\_cos\_kms\_auth\_policy](#input\_skip\_cos\_kms\_auth\_policy) | Set to true to skip the creation of an IAM authorization policy that permits the COS instance created to read the encryption key from the KMS instance. WARNING: An authorization policy must exist before an encrypted bucket can be created | `bool` | `false` | no |
7471
| <a name="input_skip_scc_cos_auth_policy"></a> [skip\_scc\_cos\_auth\_policy](#input\_skip\_scc\_cos\_auth\_policy) | Set to true to skip the creation of an IAM authorization policy that permits the SCC instance created by this solution write access to the COS instance. Only used if `provision_scc_instance` is set to true. | `bool` | `false` | no |
72+
| <a name="input_skip_scc_wp_auth_policy"></a> [skip\_scc\_wp\_auth\_policy](#input\_skip\_scc\_wp\_auth\_policy) | Set to true to skip the creation of an IAM authorization policy that permits the SCC instance created by this solution read access to the workload protection instance. Only used if `provision_scc_workload_protection` is set to true. | `bool` | `false` | no |
7573
| <a name="input_use_existing_resource_group"></a> [use\_existing\_resource\_group](#input\_use\_existing\_resource\_group) | Whether to use an existing resource group. | `bool` | `false` | no |
7674

7775
### Outputs

solutions/instances/main.tf

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ module "cos" {
125125

126126
module "scc" {
127127
source = "terraform-ibm-modules/scc/ibm"
128-
version = "1.4.0"
128+
version = "1.4.1"
129129
resource_group_id = module.resource_group.resource_group_id
130130
region = var.scc_region
131131
instance_name = var.scc_instance_name
@@ -135,6 +135,9 @@ module "scc" {
135135
en_instance_crn = var.existing_en_crn
136136
skip_cos_iam_authorization_policy = var.skip_scc_cos_auth_policy
137137
resource_tags = var.scc_instance_tags
138+
attach_wp_to_scc_instance = var.provision_scc_workload_protection
139+
wp_instance_crn = var.provision_scc_workload_protection ? module.scc_wp[0].crn : null
140+
skip_scc_wp_auth_policy = var.skip_scc_wp_auth_policy
138141
}
139142

140143
#######################################################################################################################

solutions/instances/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,12 @@ variable "scc_instance_tags" {
202202
default = []
203203
}
204204

205+
variable "skip_scc_wp_auth_policy" {
206+
type = bool
207+
default = false
208+
description = "Set to true to skip the creation of an IAM authorization policy that permits the SCC instance created by this solution read access to the workload protection instance. Only used if `provision_scc_workload_protection` is set to true."
209+
}
210+
205211
########################################################################################################################
206212
# SCC Workload Protection variables
207213
########################################################################################################################

0 commit comments

Comments
 (0)