Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
8c1e146
feat: existing scc instance for DA
Aug 7, 2024
9f33ef3
feat: existing scc instance for DA
Aug 7, 2024
18e6c2e
Merge branch 'main' into existing-scc
jor2 Aug 12, 2024
847a824
feat: add existing scc instance config
Aug 12, 2024
2e91314
feat: add existing scc instance config
Aug 12, 2024
ed858b3
feat: add existing scc instance config
Aug 12, 2024
4f45e90
Merge branch 'main' into existing-scc
jor2 Aug 19, 2024
781f6b4
Merge branch 'main' into existing-scc
jor2 Aug 19, 2024
eec97ff
Merge branch 'main' of github.com:terraform-ibm-modules/stack-ibm-cor…
Aug 23, 2024
2639af6
Merge branch 'main' into existing-scc
jor2 Aug 26, 2024
adc2bc9
Merge branch 'main' into existing-scc
jor2 Sep 2, 2024
0592e4d
Merge branch 'existing-scc' of github.com:terraform-ibm-modules/stack…
Sep 2, 2024
4c7446d
fix: key name
Sep 2, 2024
bd26001
fix: module named
Sep 2, 2024
9980af9
fix: module named
Sep 2, 2024
4ee96d6
Update stack_definition.json
jor2 Sep 5, 2024
be578a9
Merge branch 'main' into existing-scc
jor2 Oct 1, 2024
1e4cb9c
Update stack_definition.json
jor2 Oct 2, 2024
527022a
Update stack_definition.json
jor2 Oct 2, 2024
d06c02b
Update stack_definition.json
jor2 Oct 9, 2024
1e79df0
Merge branch 'main' into existing-scc
jor2 Oct 9, 2024
4ada1f8
fix: add more vars
Oct 10, 2024
6db4def
Merge branch 'main' into existing-scc
jor2 Oct 14, 2024
66178ef
Merge branch 'main' into existing-scc
jor2 Nov 5, 2024
ab7c667
Merge branch 'main' into existing-scc
jor2 Dec 12, 2024
fd1b04b
fix: update value
Dec 12, 2024
0d3dd27
Update pr_test.go
jor2 Dec 12, 2024
f62c94b
fix: tests
Dec 12, 2024
92f9ff7
Merge branch 'main' into existing-scc
jor2 Feb 12, 2025
fb3309d
Merge branch 'main' into existing-scc
jor2 Feb 18, 2025
0ee13f4
Merge branch 'main' into existing-scc
jor2 Apr 28, 2025
6cd7249
fix: tests
Apr 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions ibm_catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,13 @@
"description": "The CRN of an existing IBM Cloud Secrets Manager instance to use in this solution. If not set, a new Secrets Manager instance is provisioned.",
"required": false
},
{
"key": "existing_scc_instance_crn",
"type": "string",
"default_value": "__NULL__",
"description": "The CRN of an existing Security and Compliance Center instance. If not supplied, a new instance will be created.",
"required": false
},
{
"key": "sm_service_plan",
"type": "string",
Expand Down
16 changes: 16 additions & 0 deletions stack_definition.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@
"default": "__NULL__",
"custom_config": {}
},
{
"name": "existing_scc_instance_crn",
"required": false,
"type": "string",
"hidden": false,
"default": "__NULL__",
"custom_config": {}
},
{
"name": "en_email_list",
"required": false,
Expand Down Expand Up @@ -258,6 +266,14 @@
"name": "scc_region",
"value": "ref:../../inputs/region"
},
{
"name": "existing_scc_instance_crn",
"value": "ref:../../inputs/existing_scc_instance_crn"
},
{
"name": "provision_scc_workload_protection",
"value": true
},
{
"name": "prefix",
"value": "ref:../../inputs/prefix"
Expand Down
7 changes: 5 additions & 2 deletions tests/pr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,14 @@ func TestProjectsExistingResourcesTest(t *testing.T) {
"region": terraform.Output(t, existingTerraformOptions, "region"),
"existing_resource_group_name": terraform.Output(t, existingTerraformOptions, "resource_group_name"),
"ibmcloud_api_key": options.RequiredEnvironmentVars["TF_VAR_ibmcloud_api_key"], // always required by the stack
"enable_platform_metrics": false,
"enable_platform_logs_metrics": false,
"existing_secrets_manager_crn": terraform.Output(t, existingTerraformOptions, "secrets_manager_instance_crn"),
"skip_iam_authorization_policy": true, // skip as s2s auth policy was already created for existing instance
"existing_kms_instance_crn": permanentResources["hpcs_south_crn"],
"en_email_list": []string{"[email protected]"},
"existing_scc_instance_crn": terraform.Output(t, existingTerraformOptions, "existing_scc_instance_crn"),
"existing_cos_instance_crn": terraform.Output(t, existingTerraformOptions, "existing_cos_instance_crn"),
// "existing_scc_cos_bucket_name": terraform.Output(t, existingTerraformOptions, "existing_scc_cos_bucket_name"),
"en_email_list": []string{"[email protected]"},
}

err := options.RunProjectsTest()
Expand Down
32 changes: 32 additions & 0 deletions tests/resources/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,35 @@ module "secrets_manager" {
sm_service_plan = "trial"
sm_tags = var.resource_tags
}

#############################################################################
# Provision cloud object storage and bucket
#############################################################################

module "cos" {
source = "terraform-ibm-modules/cos/ibm"
version = "8.11.3"
resource_group_id = module.resource_group.resource_group_id
cos_instance_name = "${var.prefix}-cos"
kms_encryption_enabled = false
retention_enabled = false
bucket_name = "${var.prefix}-cb"
}

##############################################################################
# SCC
##############################################################################

module "scc_instance" {
source = "terraform-ibm-modules/scc/ibm"
version = "1.7.2"
instance_name = "${var.prefix}-scc-instance"
region = var.region
resource_group_id = module.resource_group.resource_group_id
resource_tags = var.resource_tags
access_tags = []
cos_bucket = module.cos.bucket_name
cos_instance_crn = module.cos.cos_instance_id
attach_wp_to_scc_instance = false
skip_cos_iam_authorization_policy = false
}
15 changes: 15 additions & 0 deletions tests/resources/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,18 @@ output "secrets_manager_instance_crn" {
value = module.secrets_manager.secrets_manager_crn
description = "CRN of created secret manager instance"
}

output "existing_scc_instance_crn" {
value = module.scc_instance.crn
description = "CRN of created scc instance"
}

output "existing_cos_instance_crn" {
value = module.cos.cos_instance_crn
description = "CRN of cos instance"
}

output "existing_scc_cos_bucket_name" {
value = module.cos.bucket_name
description = "Bucket name of created bucket in cos instance"
}