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

Commit 366ed93

Browse files
authored
feat: exposed the ability to create SCC attachements using the profile_attachments input variable. Supports passing multiple, but default to the latest IBM Cloud Framework for Financial Services profile (#73)
1 parent cf48748 commit 366ed93

File tree

6 files changed

+58
-7
lines changed

6 files changed

+58
-7
lines changed

common-dev-assets

ibm_catalog.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,9 @@
229229
{
230230
"key": "skip_scc_workload_protection_auth_policy"
231231
},
232+
{
233+
"key": "profile_attachments"
234+
},
232235
{
233236
"key": "provision_scc_workload_protection"
234237
},

reference-architecture/scc.svg

Lines changed: 1 addition & 1 deletion
Loading

solutions/instances/README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ This solution supports the following:
55
- Provisioning and configuring of a Security and Compliance Center instance.
66
- Provisioning of a COS instance and KMS encrypted bucket which is required to store Security and Compliance Center data.
77
- Provisioning and configuring of a Security and Compliance Center Workload Protection instance.
8+
- Create SCC profile attachments configured to the SCC instance provisioned in this module.
89

910
**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)
1011

@@ -22,14 +23,17 @@ This solution supports the following:
2223
| Name | Source | Version |
2324
|------|--------|---------|
2425
| <a name="module_cos"></a> [cos](#module\_cos) | terraform-ibm-modules/cos/ibm//modules/fscloud | 7.5.3 |
26+
| <a name="module_create_profile_attachment"></a> [create\_profile\_attachment](#module\_create\_profile\_attachment) | terraform-ibm-modules/scc/ibm//modules/attachment | 1.5.0 |
2527
| <a name="module_kms"></a> [kms](#module\_kms) | terraform-ibm-modules/kms-all-inclusive/ibm | 4.11.8 |
2628
| <a name="module_resource_group"></a> [resource\_group](#module\_resource\_group) | terraform-ibm-modules/resource-group/ibm | 1.1.5 |
27-
| <a name="module_scc"></a> [scc](#module\_scc) | terraform-ibm-modules/scc/ibm | 1.4.2 |
29+
| <a name="module_scc"></a> [scc](#module\_scc) | terraform-ibm-modules/scc/ibm | 1.5.0 |
2830
| <a name="module_scc_wp"></a> [scc\_wp](#module\_scc\_wp) | terraform-ibm-modules/scc-workload-protection/ibm | 1.3.0 |
2931

3032
### Resources
3133

32-
No resources.
34+
| Name | Type |
35+
|------|------|
36+
| [ibm_iam_account_settings.iam_account_settings](https://registry.terraform.io/providers/IBM-Cloud/ibm/1.65.1/docs/data-sources/iam_account_settings) | data source |
3337

3438
### Inputs
3539

@@ -51,6 +55,7 @@ No resources.
5155
| <a name="input_kms_endpoint_type"></a> [kms\_endpoint\_type](#input\_kms\_endpoint\_type) | The type of endpoint to be used for commincating with the KMS instance. Allowed values are: 'public' or 'private' (default) | `string` | `"private"` | no |
5256
| <a name="input_management_endpoint_type_for_bucket"></a> [management\_endpoint\_type\_for\_bucket](#input\_management\_endpoint\_type\_for\_bucket) | The type of endpoint for the IBM terraform provider to use to manage COS buckets. (`public`, `private` or `direct`). Ensure to enable virtual routing and forwarding (VRF) in your account if using `private`, and that the terraform runtime has access to the the IBM Cloud private network. | `string` | `"private"` | no |
5357
| <a name="input_prefix"></a> [prefix](#input\_prefix) | (Optional) Prefix to append to all resources created by this solution. | `string` | `null` | no |
58+
| <a name="input_profile_attachments"></a> [profile\_attachments](#input\_profile\_attachments) | Optional list of SCC profile attachments to create that will be scoped to your specific IBM Cloud account with a `daily` attachment schedule and defaults to the latest version of the specified profile attachments. | `list(string)` | <pre>[<br> "IBM Cloud Framework for Financial Services"<br>]</pre> | no |
5459
| <a name="input_provision_scc_workload_protection"></a> [provision\_scc\_workload\_protection](#input\_provision\_scc\_workload\_protection) | Whether to provision an SCC Workload Protection instance. | `bool` | `true` | no |
5560
| <a name="input_resource_group_name"></a> [resource\_group\_name](#input\_resource\_group\_name) | The name of a new or an existing resource group in which to provision resources to. If prefix input variable is passed then it will get prefixed infront of the value in the format of '<prefix>-value'. | `string` | n/a | yes |
5661
| <a name="input_scc_cos_bucket_access_tags"></a> [scc\_cos\_bucket\_access\_tags](#input\_scc\_cos\_bucket\_access\_tags) | Optional list of access tags to be added to the SCC COS bucket. | `list(string)` | `[]` | no |

solutions/instances/main.tf

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,12 @@ module "cos" {
128128
}
129129

130130
#######################################################################################################################
131-
# SCC
131+
# SCC Instance
132132
#######################################################################################################################
133133

134134
module "scc" {
135135
source = "terraform-ibm-modules/scc/ibm"
136-
version = "1.4.2"
136+
version = "1.5.0"
137137
resource_group_id = module.resource_group.resource_group_id
138138
region = var.scc_region
139139
instance_name = local.scc_instance_name
@@ -149,7 +149,44 @@ module "scc" {
149149
}
150150

151151
#######################################################################################################################
152-
# SCC WP
152+
# SCC Attachment
153+
#######################################################################################################################
154+
155+
# Data source to account settings
156+
data "ibm_iam_account_settings" "iam_account_settings" {}
157+
158+
module "create_profile_attachment" {
159+
source = "terraform-ibm-modules/scc/ibm//modules/attachment"
160+
version = "1.5.0"
161+
for_each = {
162+
for idx, profile_attachment in var.profile_attachments :
163+
profile_attachment => idx
164+
}
165+
profile_name = each.key
166+
profile_version = "latest"
167+
scc_instance_id = module.scc.guid
168+
attachment_name = "${each.value + 1} daily full account attachment"
169+
attachment_description = "SCC profile attachment scoped to your specific IBM Cloud account id ${data.ibm_iam_account_settings.iam_account_settings.account_id} with a daily attachment schedule."
170+
attachment_schedule = "daily"
171+
scope = [
172+
{
173+
environment = "ibm-cloud"
174+
properties = [
175+
{
176+
name = "scope_type"
177+
value = "account"
178+
},
179+
{
180+
name = "scope_id"
181+
value = data.ibm_iam_account_settings.iam_account_settings.account_id
182+
},
183+
]
184+
}
185+
]
186+
}
187+
188+
#######################################################################################################################
189+
# SCC Workload Protection
153190
#######################################################################################################################
154191

155192
module "scc_wp" {

solutions/instances/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,12 @@ variable "skip_scc_workload_protection_auth_policy" {
214214
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."
215215
}
216216

217+
variable "profile_attachments" {
218+
type = list(string)
219+
description = "Optional list of SCC profile attachments to create that will be scoped to your specific IBM Cloud account with a `daily` attachment schedule and defaults to the latest version of the specified profile attachments."
220+
default = ["IBM Cloud Framework for Financial Services"]
221+
}
222+
217223
########################################################################################################################
218224
# SCC Workload Protection variables
219225
########################################################################################################################

0 commit comments

Comments
 (0)