fix a few things from tests
This commit is contained in:
@@ -41,11 +41,18 @@ 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" {
|
||||||
|
for_each = var.authorized_networks
|
||||||
|
content {
|
||||||
|
name = authorized_networks.value.name
|
||||||
|
value = authorized_networks.value.value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ipv4_enabled = var.enable_public_internet_access
|
ipv4_enabled = var.enable_public_internet_access
|
||||||
private_network = var.private_network
|
private_network = var.private_network
|
||||||
require_ssl = var.require_ssl
|
require_ssl = var.require_ssl
|
||||||
@@ -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,11 +169,18 @@ 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" {
|
||||||
|
for_each = var.authorized_networks
|
||||||
|
content {
|
||||||
|
name = authorized_networks.value.name
|
||||||
|
value = authorized_networks.value.value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ipv4_enabled = var.enable_public_internet_access
|
ipv4_enabled = var.enable_public_internet_access
|
||||||
private_network = var.private_network
|
private_network = var.private_network
|
||||||
require_ssl = var.require_ssl
|
require_ssl = var.require_ssl
|
||||||
@@ -172,7 +193,14 @@ resource "google_sql_database_instance" "failover_replica" {
|
|||||||
|
|
||||||
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,11 +245,18 @@ 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" {
|
||||||
|
for_each = var.authorized_networks
|
||||||
|
content {
|
||||||
|
name = authorized_networks.value.name
|
||||||
|
value = authorized_networks.value.value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ipv4_enabled = var.enable_public_internet_access
|
ipv4_enabled = var.enable_public_internet_access
|
||||||
private_network = var.private_network
|
private_network = var.private_network
|
||||||
require_ssl = var.require_ssl
|
require_ssl = var.require_ssl
|
||||||
@@ -234,7 +269,14 @@ resource "google_sql_database_instance" "read_replica" {
|
|||||||
|
|
||||||
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
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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:
|
||||||
|
|||||||
Reference in New Issue
Block a user