File tree Expand file tree Collapse file tree 4 files changed +21
-16
lines changed
Expand file tree Collapse file tree 4 files changed +21
-16
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ An end-to-end example that uses the IBM Cloud Terraform provider to create the f
55- A resource group, if one is not passed in.
66- A Key Protect instance with a root key.
77- An instance of Databases for MongoDB with BYOK encryption.
8+ - Set 250 max connection for Databases for MongoDB instance.
89- Service credentials for the database instance.
910- A sample virtual private cloud (VPC).
1011- A context-based restriction (CBR) rule to only allow MongoDB to be accessible from within the VPC.
Original file line number Diff line number Diff line change @@ -83,6 +83,9 @@ module "mongodb" {
8383 access_tags = var. access_tags
8484 tags = var. resource_tags
8585 service_credential_names = var. service_credential_names
86+ configuration = {
87+ max_connections = 250
88+ }
8689 cbr_rules = [
8790 {
8891 description = " ${ var . prefix } -mongodb access only from vpc"
Original file line number Diff line number Diff line change @@ -45,18 +45,19 @@ resource "time_sleep" "wait_for_authorization_policy" {
4545}
4646
4747resource "ibm_database" "mongodb" {
48- depends_on = [ibm_iam_authorization_policy . kms_policy ]
49- name = var. instance_name
50- location = var. region
51- plan = var. plan
52- service = " databases-for-mongodb"
53- version = var. mongodb_version
54- resource_group_id = var. resource_group_id
55- adminpassword = var. admin_pass
56- tags = var. tags
57- service_endpoints = var. endpoints
58- plan_validation = var. plan_validation
59- configuration = var. configuration != null ? jsonencode (var. configuration ) : null
48+ depends_on = [ibm_iam_authorization_policy . kms_policy ]
49+ name = var. instance_name
50+ location = var. region
51+ plan = var. plan
52+ service = " databases-for-mongodb"
53+ version = var. mongodb_version
54+ resource_group_id = var. resource_group_id
55+ adminpassword = var. admin_pass
56+ tags = var. tags
57+ service_endpoints = var. endpoints
58+ plan_validation = var. plan_validation
59+ # remove elements with null values: see https://github.com/terraform-ibm-modules/terraform-ibm-icd-postgresql/issues/273
60+ configuration = var. configuration != null ? jsonencode ({ for k , v in var . configuration : k => v if v != null }) : null
6061 key_protect_key = var. kms_key_crn
6162 backup_encryption_key_crn = local. backup_encryption_key_crn
6263
Original file line number Diff line number Diff line change 481481 },
482482 "pos" : {
483483 "filename" : " main.tf" ,
484- "line" : 182
484+ "line" : 183
485485 }
486486 },
487487 "ibm_resource_tag.mongodb_tag" : {
497497 },
498498 "pos" : {
499499 "filename" : " main.tf" ,
500- "line" : 131
500+ "line" : 132
501501 }
502502 },
503503 "time_sleep.wait_for_authorization_policy" : {
529529 },
530530 "pos" : {
531531 "filename" : " main.tf" ,
532- "line" : 210
532+ "line" : 211
533533 }
534534 }
535535 },
608608 },
609609 "pos" : {
610610 "filename" : " main.tf" ,
611- "line" : 142
611+ "line" : 143
612612 }
613613 }
614614 }
You can’t perform that action at this time.
0 commit comments