File tree Expand file tree Collapse file tree 7 files changed +18
-8
lines changed
test/fixtures/postgresql-ha Expand file tree Collapse file tree 7 files changed +18
-8
lines changed Original file line number Diff line number Diff line change @@ -19,8 +19,8 @@ locals {
19
19
ip_configuration_enabled = " ${ length (keys (var. ip_configuration )) > 0 ? true : false } "
20
20
21
21
ip_configurations = {
22
- enabled = " ${ list ( var. ip_configuration ) } "
23
- disabled = " ${ list ()} "
22
+ enabled = " ${ var . ip_configuration } "
23
+ disabled = " ${ map ()} "
24
24
}
25
25
}
26
26
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ resource "google_sql_database_instance" "replicas" {
41
41
settings {
42
42
tier = " ${ var . read_replica_tier } "
43
43
activation_policy = " ${ var . read_replica_activation_policy } "
44
- ip_configuration = " ${ local . ip_configurations [" ${ local . ip_configuration_enabled ? " enabled" : " disabled" } " ]} "
44
+ ip_configuration = [ " ${ local . ip_configurations [" ${ local . ip_configuration_enabled ? " enabled" : " disabled" } " ]} " ]
45
45
authorized_gae_applications = [" ${ var . authorized_gae_applications } " ]
46
46
47
47
crash_safe_replication = " ${ var . read_replica_crash_safe_replication } "
Original file line number Diff line number Diff line change 111
111
112
112
variable "ip_configuration" {
113
113
description = " The ip configuration for the master instance."
114
- default = {}
114
+
115
+ default = {
116
+ ipv4_enabled = " true"
117
+ }
115
118
}
116
119
117
120
// Read Replicas
Original file line number Diff line number Diff line change @@ -18,8 +18,8 @@ locals {
18
18
ip_configuration_enabled = " ${ length (keys (var. ip_configuration )) > 0 ? true : false } "
19
19
20
20
ip_configurations = {
21
- enabled = " ${ list ( var. ip_configuration ) } "
22
- disabled = " ${ list ()} "
21
+ enabled = " ${ var . ip_configuration } "
22
+ disabled = " ${ map ()} "
23
23
}
24
24
}
25
25
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ resource "google_sql_database_instance" "replicas" {
43
43
activation_policy = " ${ var . read_replica_activation_policy } "
44
44
authorized_gae_applications = [" ${ var . authorized_gae_applications } " ]
45
45
availability_type = " ${ var . read_replica_availability_type } "
46
- ip_configuration = " ${ local . ip_configurations [" ${ local . ip_configuration_enabled ? " enabled" : " disabled" } " ]} "
46
+ ip_configuration = [ " ${ local . ip_configurations [" ${ local . ip_configuration_enabled ? " enabled" : " disabled" } " ]} " ]
47
47
48
48
crash_safe_replication = " ${ var . read_replica_crash_safe_replication } "
49
49
disk_autoresize = " ${ var . read_replica_disk_autoresize } "
Original file line number Diff line number Diff line change @@ -115,7 +115,10 @@ variable "authorized_gae_applications" {
115
115
116
116
variable "ip_configuration" {
117
117
description = " The ip configuration for the master instances."
118
- default = {}
118
+
119
+ default = {
120
+ ipv4_enabled = " true"
121
+ }
119
122
}
120
123
121
124
variable "read_replica_size" {
Original file line number Diff line number Diff line change @@ -114,6 +114,10 @@ module "pg" {
114
114
user_password = " foobar"
115
115
116
116
additional_users = [
117
+ {
118
+ name = " tftest1"
119
+ password = " raboof"
120
+ },
117
121
{
118
122
name = " tftest2"
119
123
password = " abcdefg"
You can’t perform that action at this time.
0 commit comments