Skip to content
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

feat: existing scc instance for DA #106

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -236,6 +236,13 @@
"description": "The CRN of an existing 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
18 changes: 17 additions & 1 deletion stack_definition.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,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 @@ -242,6 +250,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": false
},
{
"name": "prefix",
"value": "ref:../../inputs/prefix"
Expand Down Expand Up @@ -286,7 +302,7 @@
}
],
"name": "4a - Security and Compliance Center",
"version_locator": "7a4d68b4-cf8b-40cd-a3d1-f49aff526eb3.c689955e-d4ad-4f9e-8bdc-c8929dd5991a-global"
"version_locator": "7a4d68b4-cf8b-40cd-a3d1-f49aff526eb3.fe8a807c-900f-4c31-a5ad-eeae4579d3a0-global"
},
{
"inputs": [
Expand Down
1 change: 1 addition & 0 deletions tests/pr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ func TestProjectsExistingResourcesTest(t *testing.T) {
"existing_secrets_manager_crn": terraform.Output(t, existingTerraformOptions, "secrets_manager_instance_crn"),
"secret_manager_iam_engine_enabled": true,
"existing_kms_instance_crn": permanentResources["hpcs_south_crn"],
"existing_scc_instance_crn": terraform.Output(t, existingTerraformOptions, "existing_scc_instance_crn"),
"en_email_list": []string{"[email protected]"},
}

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
}
5 changes: 5 additions & 0 deletions tests/resources/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,8 @@ 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"
}