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

Commit e461a86

Browse files
authored
feat: added adminuser and certificate_base64 outputs and updated the logic to always output hostname and port details (#189)
1 parent e2777d1 commit e461a86

File tree

13 files changed

+68
-22
lines changed

13 files changed

+68
-22
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ To attach access management tags to resources in this module, you need the follo
6363
| Name | Version |
6464
|------|---------|
6565
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3.0, <1.7.0 |
66-
| <a name="requirement_ibm"></a> [ibm](#requirement\_ibm) | >= 1.61.0, < 2.0.0 |
66+
| <a name="requirement_ibm"></a> [ibm](#requirement\_ibm) | >= 1.64.2, < 2.0.0 |
6767
| <a name="requirement_time"></a> [time](#requirement\_time) | >= 0.9.1, < 1.0.0 |
6868

6969
### Modules
@@ -119,12 +119,14 @@ To attach access management tags to resources in this module, you need the follo
119119

120120
| Name | Description |
121121
|------|-------------|
122+
| <a name="output_adminuser"></a> [adminuser](#output\_adminuser) | Database admin user name |
122123
| <a name="output_cbr_rule_ids"></a> [cbr\_rule\_ids](#output\_cbr\_rule\_ids) | CBR rule ids created to restrict Enterprise DB |
124+
| <a name="output_certificate_base64"></a> [certificate\_base64](#output\_certificate\_base64) | Database connection certificate |
123125
| <a name="output_crn"></a> [crn](#output\_crn) | Enterprise DB instance crn |
124126
| <a name="output_guid"></a> [guid](#output\_guid) | Enterprise DB instance guid |
125-
| <a name="output_hostname"></a> [hostname](#output\_hostname) | Database hostname. Only contains value when var.service\_credential\_names or var.users are set. |
127+
| <a name="output_hostname"></a> [hostname](#output\_hostname) | Database connection hostname |
126128
| <a name="output_id"></a> [id](#output\_id) | Enterprise DB instance id |
127-
| <a name="output_port"></a> [port](#output\_port) | Database port. Only contains value when var.service\_credential\_names or var.users are set. |
129+
| <a name="output_port"></a> [port](#output\_port) | Database connection port |
128130
| <a name="output_service_credentials_json"></a> [service\_credentials\_json](#output\_service\_credentials\_json) | Service credentials json map |
129131
| <a name="output_service_credentials_object"></a> [service\_credentials\_object](#output\_service\_credentials\_object) | Service credentials object |
130132
| <a name="output_version"></a> [version](#output\_version) | Enterprise DB instance version |

examples/backup/version.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
# Use latest version of provider in non-basic examples to verify latest version works with module
55
ibm = {
66
source = "IBM-Cloud/ibm"
7-
version = ">= 1.61.0, <2.0.0"
7+
version = ">= 1.64.2, <2.0.0"
88
}
99
}
1010
}

examples/basic/outputs.tf

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,24 @@ output "version" {
1010
description = "Enterprise DB instance version"
1111
value = module.enterprise_db.version
1212
}
13+
14+
output "adminuser" {
15+
description = "Database admin user name"
16+
value = module.enterprise_db.adminuser
17+
}
18+
19+
output "hostname" {
20+
description = "Database connection hostname"
21+
value = module.enterprise_db.hostname
22+
}
23+
24+
output "port" {
25+
description = "Database connection port"
26+
value = module.enterprise_db.port
27+
}
28+
29+
output "certificate_base64" {
30+
description = "Database connection certificate"
31+
value = module.enterprise_db.certificate_base64
32+
sensitive = true
33+
}

examples/basic/version.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
# Pin to the lowest provider version of the range defined in the main module's version.tf to ensure lowest version still works
55
ibm = {
66
source = "IBM-Cloud/ibm"
7-
version = "1.61.0"
7+
version = "1.64.2"
88
}
99
}
1010
}

examples/complete/version.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
# Use latest version of provider in non-basic examples to verify latest version works with module
55
ibm = {
66
source = "IBM-Cloud/ibm"
7-
version = ">= 1.61.0, <2.0.0"
7+
version = ">= 1.64.2, <2.0.0"
88
}
99
time = {
1010
source = "hashicorp/time"

examples/fscloud/version.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
# Use latest version of provider in non-basic examples to verify latest version works with module
55
ibm = {
66
source = "IBM-Cloud/ibm"
7-
version = ">= 1.61.0, <2.0.0"
7+
version = ">= 1.64.2, <2.0.0"
88
}
99
}
1010
}

examples/pitr/version.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
# Use latest version of provider in non-basic examples to verify latest version works with module
55
ibm = {
66
source = "IBM-Cloud/ibm"
7-
version = ">= 1.61.0, <2.0.0"
7+
version = ">= 1.64.2, <2.0.0"
88
}
99
}
1010
}

main.tf

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,8 @@ locals {
217217
}
218218

219219
data "ibm_database_connection" "database_connection" {
220-
count = length(var.users) > 0 ? 1 : 0
221220
endpoint_type = var.service_endpoints
222221
deployment_id = ibm_database.enterprise_db.id
223-
user_id = var.users[0].name
224-
user_type = var.users[0].type
222+
user_id = ibm_database.enterprise_db.adminuser
223+
user_type = "database"
225224
}

modules/fscloud/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The IBM Cloud Framework for Financial Services mandates the application of an in
1414
| Name | Version |
1515
|------|---------|
1616
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3.0, <1.7.0 |
17-
| <a name="requirement_ibm"></a> [ibm](#requirement\_ibm) | >= 1.61.0, <2.0.0 |
17+
| <a name="requirement_ibm"></a> [ibm](#requirement\_ibm) | >= 1.64.2, <2.0.0 |
1818

1919
### Modules
2020

@@ -55,10 +55,12 @@ No resources.
5555

5656
| Name | Description |
5757
|------|-------------|
58+
| <a name="output_adminuser"></a> [adminuser](#output\_adminuser) | Database admin user name |
59+
| <a name="output_certificate_base64"></a> [certificate\_base64](#output\_certificate\_base64) | Database connection certificate |
5860
| <a name="output_crn"></a> [crn](#output\_crn) | Enterprise DB instance crn |
5961
| <a name="output_guid"></a> [guid](#output\_guid) | Enterprise DB instance guid |
60-
| <a name="output_hostname"></a> [hostname](#output\_hostname) | Enterprise DB instance hostname |
62+
| <a name="output_hostname"></a> [hostname](#output\_hostname) | Database connection hostname |
6163
| <a name="output_id"></a> [id](#output\_id) | Enterprise DB instance id |
62-
| <a name="output_port"></a> [port](#output\_port) | Enterprise DB instance port |
64+
| <a name="output_port"></a> [port](#output\_port) | Database connection port |
6365
| <a name="output_version"></a> [version](#output\_version) | Enterprise DB instance version |
6466
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

modules/fscloud/outputs.tf

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,23 @@ output "crn" {
2222
value = module.enterprise_db.crn
2323
}
2424

25+
output "adminuser" {
26+
description = "Database admin user name"
27+
value = module.enterprise_db.adminuser
28+
}
29+
2530
output "hostname" {
26-
description = "Enterprise DB instance hostname"
31+
description = "Database connection hostname"
2732
value = module.enterprise_db.hostname
2833
}
2934

3035
output "port" {
31-
description = "Enterprise DB instance port"
36+
description = "Database connection port"
3237
value = module.enterprise_db.port
3338
}
39+
40+
output "certificate_base64" {
41+
description = "Database connection certificate"
42+
value = module.enterprise_db.certificate_base64
43+
sensitive = true
44+
}

0 commit comments

Comments
 (0)