Skip to content

Commit f1fa4e1

Browse files
author
Adrian Lopez
committed
add example for db flags
1 parent 640e4f4 commit f1fa4e1

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

examples/mysql-and-postgres/main.tf

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ data "google_client_config" "current" {}
3434

3535
data "google_compute_subnetwork" "default-us-central1" {
3636
project = "${data.google_client_config.current.project}"
37-
region = "${var.region}"
38-
name = "default"
37+
region = "${var.region}"
38+
name = "default"
3939
}
4040

4141
resource "random_id" "name" {
@@ -47,12 +47,20 @@ module "mysql-db" {
4747
source = "../../"
4848
name = "example-mysql-${random_id.name.hex}"
4949
database_version = "MYSQL_5_6"
50+
5051
ip_configuration = [{
5152
authorized_networks = [{
52-
name = "default"
53+
name = "default"
5354
value = "${data.google_compute_subnetwork.default-us-central1.ip_cidr_range}"
5455
}]
5556
}]
57+
58+
database_flags = [
59+
{
60+
name = "log_bin_trust_function_creators"
61+
value = "on"
62+
},
63+
]
5664
}
5765

5866
module "postgresql-db" {
@@ -61,9 +69,10 @@ module "postgresql-db" {
6169
name = "example-postgresql-${random_id.name.hex}"
6270
user_host = ""
6371
database_version = "POSTGRES_9_6"
72+
6473
ip_configuration = [{
6574
authorized_networks = [{
66-
name = "default"
75+
name = "default"
6776
value = "${data.google_compute_subnetwork.default-us-central1.ip_cidr_range}"
6877
}]
6978
}]

variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ variable db_charset {
5454
}
5555

5656
variable db_collation {
57-
description = "The collation for the default database. Example for MySQL databases: 'utf8', and Postgres: 'en_US.UTF8'"
57+
description = "The collation for the default database. Example for MySQL databases: 'utf8_general_ci', and Postgres: 'en_US.UTF8'"
5858
default = ""
5959
}
6060

0 commit comments

Comments
 (0)