Skip to content

Commit 390adb6

Browse files
authored
chore: updated to consume tim secret manager module (#84)
1 parent ff875ef commit 390adb6

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

examples/complete/main.tf

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
locals {
2-
sm_guid = var.existing_sm_instance_guid == null ? ibm_resource_instance.secrets_manager[0].guid : var.existing_sm_instance_guid
2+
sm_guid = var.existing_sm_instance_guid == null ? module.secrets_manager.secrets_manager_guid : var.existing_sm_instance_guid
33
sm_region = var.existing_sm_instance_region == null ? var.region : var.existing_sm_instance_region
44
}
55

@@ -78,18 +78,15 @@ resource "elasticsearch_cluster_settings" "global" {
7878
##############################################################################
7979

8080
# Create Secrets Manager Instance (if not using existing one)
81-
resource "ibm_resource_instance" "secrets_manager" {
82-
count = var.existing_sm_instance_guid == null ? 1 : 0
83-
name = "${var.prefix}-sm" #checkov:skip=CKV_SECRET_6: does not require high entropy string as is static value
84-
service = "secrets-manager"
85-
service_endpoints = "public-and-private"
86-
plan = "trial"
87-
location = var.region
88-
resource_group_id = module.resource_group.resource_group_id
89-
90-
timeouts {
91-
create = "30m" # Extending provisioning time to 30 minutes
92-
}
81+
module "secrets_manager" {
82+
source = "terraform-ibm-modules/secrets-manager/ibm"
83+
version = "1.1.0"
84+
resource_group_id = module.resource_group.resource_group_id
85+
region = var.region
86+
secrets_manager_name = "${var.prefix}-secrets-manager"
87+
sm_service_plan = "trial"
88+
service_endpoints = "public-and-private"
89+
sm_tags = var.resource_tags
9390
}
9491

9592
# Add a Secrets Group to the secret manager instance

0 commit comments

Comments
 (0)