File tree Expand file tree Collapse file tree 6 files changed +81
-3
lines changed Expand file tree Collapse file tree 6 files changed +81
-3
lines changed Original file line number Diff line number Diff line change @@ -91,6 +91,8 @@ You need the following permissions to run this module.
91
91
92
92
| Name | Description |
93
93
| ------| -------------|
94
+ | <a name =" output_cbr_rule_ids " ></a > [ cbr\_ rule\_ ids] ( #output\_ cbr\_ rule\_ ids ) | CBR rule ids created to restrict Postgresql |
95
+ | <a name =" output_crn " ></a > [ crn] ( #output\_ crn ) | Postgresql instance crn |
94
96
| <a name =" output_guid " ></a > [ guid] ( #output\_ guid ) | Postgresql instance guid |
95
97
| <a name =" output_id " ></a > [ id] ( #output\_ id ) | Postgresql instance id |
96
98
| <a name =" output_service_credentials_json " ></a > [ service\_ credentials\_ json] ( #output\_ service\_ credentials\_ json ) | Service credentials json map |
Original file line number Diff line number Diff line change @@ -104,3 +104,36 @@ module "postgresql_db" {
104
104
}
105
105
]
106
106
}
107
+
108
+ # VPE provisioning should wait for the database provisioning
109
+ resource "time_sleep" "wait_120_seconds" {
110
+ depends_on = [module . postgresql_db ]
111
+ create_duration = " 120s"
112
+ }
113
+
114
+ # #############################################################################
115
+ # VPE
116
+ # #############################################################################
117
+
118
+ resource "ibm_is_security_group" "sg1" {
119
+ name = " ${ var . prefix } -sg1"
120
+ vpc = ibm_is_vpc. example_vpc . id
121
+ }
122
+
123
+ resource "ibm_is_virtual_endpoint_gateway" "pgvpe" {
124
+ name = " ${ var . prefix } -vpe-to-pg"
125
+ target {
126
+ crn = module. postgresql_db . crn
127
+ resource_type = " provider_cloud_service"
128
+ }
129
+ vpc = ibm_is_vpc. example_vpc . id
130
+ ips {
131
+ subnet = ibm_is_subnet. testacc_subnet . id
132
+ name = " ${ var . prefix } -pg-access-reserved-ip"
133
+ }
134
+ resource_group = module. resource_group . resource_group_id
135
+ security_groups = [ibm_is_security_group . sg1 . id ]
136
+ depends_on = [
137
+ time_sleep . wait_120_seconds
138
+ ]
139
+ }
Original file line number Diff line number Diff line change @@ -6,6 +6,11 @@ output "id" {
6
6
value = module. postgresql_db . id
7
7
}
8
8
9
+ output "guid" {
10
+ description = " Postgresql instance guid"
11
+ value = module. postgresql_db . guid
12
+ }
13
+
9
14
output "version" {
10
15
description = " Postgresql instance version"
11
16
value = module. postgresql_db . version
@@ -22,3 +27,8 @@ output "service_credentials_object" {
22
27
value = module. postgresql_db . service_credentials_object
23
28
sensitive = true
24
29
}
30
+
31
+ output "cbr_rule_ids" {
32
+ description = " CBR rule ids created to restrict Postgresql"
33
+ value = module. postgresql_db . cbr_rule_ids
34
+ }
Original file line number Diff line number Diff line change @@ -6,5 +6,9 @@ terraform {
6
6
source = " IBM-Cloud/ibm"
7
7
version = " 1.49.0"
8
8
}
9
+ time = {
10
+ source = " hashicorp/time"
11
+ version = " >= 0.8.0"
12
+ }
9
13
}
10
14
}
Original file line number Diff line number Diff line change 248
248
}
249
249
},
250
250
"outputs" : {
251
+ "cbr_rule_ids" : {
252
+ "name" : " cbr_rule_ids" ,
253
+ "description" : " CBR rule ids created to restrict Postgresql" ,
254
+ "pos" : {
255
+ "filename" : " outputs.tf" ,
256
+ "line" : 38
257
+ }
258
+ },
259
+ "crn" : {
260
+ "name" : " crn" ,
261
+ "description" : " Postgresql instance crn" ,
262
+ "value" : " ibm_database.postgresql_db.resource_crn" ,
263
+ "pos" : {
264
+ "filename" : " outputs.tf" ,
265
+ "line" : 15
266
+ },
267
+ "type" : " TypeString"
268
+ },
251
269
"guid" : {
252
270
"name" : " guid" ,
253
271
"description" : " Postgresql instance guid" ,
274
292
"sensitive" : true ,
275
293
"pos" : {
276
294
"filename" : " outputs.tf" ,
277
- "line" : 20
295
+ "line" : 25
278
296
}
279
297
},
280
298
"service_credentials_object" : {
284
302
"sensitive" : true ,
285
303
"pos" : {
286
304
"filename" : " outputs.tf" ,
287
- "line" : 26
305
+ "line" : 31
288
306
}
289
307
},
290
308
"version" : {
293
311
"value" : " ibm_database.postgresql_db.version" ,
294
312
"pos" : {
295
313
"filename" : " outputs.tf" ,
296
- "line" : 15
314
+ "line" : 20
297
315
},
298
316
"type" : " TypeString"
299
317
}
Original file line number Diff line number Diff line change @@ -12,6 +12,11 @@ output "guid" {
12
12
value = ibm_database. postgresql_db . guid
13
13
}
14
14
15
+ output "crn" {
16
+ description = " Postgresql instance crn"
17
+ value = ibm_database. postgresql_db . resource_crn
18
+ }
19
+
15
20
output "version" {
16
21
description = " Postgresql instance version"
17
22
value = ibm_database. postgresql_db . version
@@ -28,3 +33,9 @@ output "service_credentials_object" {
28
33
value = local. service_credentials_object
29
34
sensitive = true
30
35
}
36
+
37
+
38
+ output "cbr_rule_ids" {
39
+ description = " CBR rule ids created to restrict Postgresql"
40
+ value = module. cbr_rule [* ]. rule_id
41
+ }
You can’t perform that action at this time.
0 commit comments