mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 08:55:24 +00:00
2fbe53b6c9
* Reorganized infrastructure, updated for frontend's loadtesting * Add changes suggested by @chiiph * Moved files per suggestion by Ben * Update docs with new links * Add config for multi account assume role
47 lines
1.2 KiB
HCL
47 lines
1.2 KiB
HCL
resource "random_password" "fleet-db-user-pw" {
|
|
length = 12
|
|
}
|
|
|
|
module "fleet-mysql" {
|
|
source = "GoogleCloudPlatform/sql-db/google//modules/mysql"
|
|
version = "9.0.0"
|
|
name = "${var.prefix}-mysql"
|
|
random_instance_name = true
|
|
project_id = var.project_id
|
|
|
|
deletion_protection = false
|
|
|
|
additional_users = [
|
|
{
|
|
name = var.db_user
|
|
password = random_password.fleet-db-user-pw.result
|
|
host = "% (any host)"
|
|
type = "BUILT_IN"
|
|
}
|
|
]
|
|
|
|
ip_configuration = {
|
|
ipv4_enabled = false
|
|
# We never set authorized networks, we need all connections via the
|
|
# public IP to be mediated by Cloud SQL.
|
|
authorized_networks = []
|
|
require_ssl = false
|
|
private_network = module.vpc.network_self_link
|
|
}
|
|
|
|
database_version = var.db_version
|
|
region = var.region
|
|
zone = var.db_zone
|
|
tier = var.db_tier
|
|
additional_databases = [
|
|
{
|
|
name = var.db_name
|
|
charset = "utf8mb4"
|
|
collation = "utf8mb4_general_ci"
|
|
}
|
|
]
|
|
|
|
|
|
// Optional: used to enforce ordering in the creation of resources.
|
|
module_depends_on = [module.private-service-access.peering_completed]
|
|
} |