1
0
mirror of synced 2025-12-19 18:05:44 -05:00

fix a few things from tests

This commit is contained in:
Rob Morgan
2019-06-25 13:53:18 +02:00
parent d5554b29f4
commit 1fdb587e0b
2 changed files with 66 additions and 24 deletions

View File

@@ -41,14 +41,21 @@ resource "google_sql_database_instance" "master" {
settings { settings {
tier = var.machine_type tier = var.machine_type
activation_policy = var.activation_policy activation_policy = var.activation_policy
authorized_gae_applications = [var.authorized_gae_applications] authorized_gae_applications = var.authorized_gae_applications
disk_autoresize = var.disk_autoresize disk_autoresize = var.disk_autoresize
ip_configuration { ip_configuration {
authorized_networks = [var.authorized_networks] dynamic "authorized_networks" {
ipv4_enabled = var.enable_public_internet_access for_each = var.authorized_networks
private_network = var.private_network content {
require_ssl = var.require_ssl name = authorized_networks.value.name
value = authorized_networks.value.value
}
}
ipv4_enabled = var.enable_public_internet_access
private_network = var.private_network
require_ssl = var.require_ssl
} }
location_preference { location_preference {
@@ -70,9 +77,16 @@ resource "google_sql_database_instance" "master" {
disk_size = var.disk_size disk_size = var.disk_size
disk_type = var.disk_type disk_type = var.disk_type
database_flags = [var.database_flags]
availability_type = local.actual_availability_type availability_type = local.actual_availability_type
dynamic "database_flags" {
for_each = var.database_flags
content {
name = database_flags.value.name
value = database_flags.value.value
}
}
user_labels = var.custom_labels user_labels = var.custom_labels
} }
@@ -155,14 +169,21 @@ resource "google_sql_database_instance" "failover_replica" {
crash_safe_replication = true crash_safe_replication = true
tier = var.machine_type tier = var.machine_type
authorized_gae_applications = [var.authorized_gae_applications] authorized_gae_applications = var.authorized_gae_applications
disk_autoresize = var.disk_autoresize disk_autoresize = var.disk_autoresize
ip_configuration { ip_configuration {
authorized_networks = [var.authorized_networks] dynamic "authorized_networks" {
ipv4_enabled = var.enable_public_internet_access for_each = var.authorized_networks
private_network = var.private_network content {
require_ssl = var.require_ssl name = authorized_networks.value.name
value = authorized_networks.value.value
}
}
ipv4_enabled = var.enable_public_internet_access
private_network = var.private_network
require_ssl = var.require_ssl
} }
location_preference { location_preference {
@@ -170,9 +191,16 @@ resource "google_sql_database_instance" "failover_replica" {
zone = var.mysql_failover_replica_zone zone = var.mysql_failover_replica_zone
} }
disk_size = var.disk_size disk_size = var.disk_size
disk_type = var.disk_type disk_type = var.disk_type
database_flags = [var.database_flags]
dynamic "database_flags" {
for_each = var.database_flags
content {
name = database_flags.value.name
value = database_flags.value.value
}
}
user_labels = var.custom_labels user_labels = var.custom_labels
} }
@@ -217,14 +245,21 @@ resource "google_sql_database_instance" "read_replica" {
settings { settings {
tier = var.machine_type tier = var.machine_type
authorized_gae_applications = [var.authorized_gae_applications] authorized_gae_applications = var.authorized_gae_applications
disk_autoresize = var.disk_autoresize disk_autoresize = var.disk_autoresize
ip_configuration { ip_configuration {
authorized_networks = [var.authorized_networks] dynamic "authorized_networks" {
ipv4_enabled = var.enable_public_internet_access for_each = var.authorized_networks
private_network = var.private_network content {
require_ssl = var.require_ssl name = authorized_networks.value.name
value = authorized_networks.value.value
}
}
ipv4_enabled = var.enable_public_internet_access
private_network = var.private_network
require_ssl = var.require_ssl
} }
location_preference { location_preference {
@@ -232,9 +267,16 @@ resource "google_sql_database_instance" "read_replica" {
zone = element(var.read_replica_zones, count.index) zone = element(var.read_replica_zones, count.index)
} }
disk_size = var.disk_size disk_size = var.disk_size
disk_type = var.disk_type disk_type = var.disk_type
database_flags = [var.database_flags]
dynamic "database_flags" {
for_each = var.database_flags
content {
name = database_flags.value.name
value = database_flags.value.value
}
}
user_labels = var.custom_labels user_labels = var.custom_labels
} }

View File

@@ -56,7 +56,7 @@ variable "activation_policy" {
variable "authorized_networks" { variable "authorized_networks" {
description = "A list of authorized CIDR-formatted IP address ranges that can connect to this DB. Only applies to public IP instances." description = "A list of authorized CIDR-formatted IP address ranges that can connect to this DB. Only applies to public IP instances."
type = list(string) type = list(any)
default = [] default = []
# Example: # Example:
@@ -125,7 +125,7 @@ variable "db_collation" {
variable "database_flags" { variable "database_flags" {
description = "List of Cloud SQL flags that are applied to the database server" description = "List of Cloud SQL flags that are applied to the database server"
type = list(map(string)) type = list(any)
default = [] default = []
# Example: # Example: