Skip to content

Commit 640e4f4

Browse files
author
Adrian Lopez
committed
add master_instance_name (for replica) + databse_tags
1 parent 40f5a39 commit 640e4f4

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

main.tf

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@
1515
*/
1616

1717
resource "google_sql_database_instance" "master" {
18-
name = "${var.name}"
19-
project = "${var.project}"
20-
region = "${var.region}"
21-
database_version = "${var.database_version}"
18+
name = "${var.name}"
19+
project = "${var.project}"
20+
region = "${var.region}"
21+
database_version = "${var.database_version}"
22+
master_instance_name = "${var.master_instance_name}"
2223

2324
settings {
2425
tier = "${var.tier}"
@@ -33,6 +34,7 @@ resource "google_sql_database_instance" "master" {
3334
disk_type = "${var.disk_type}"
3435
pricing_plan = "${var.pricing_plan}"
3536
replication_type = "${var.replication_type}"
37+
database_flags = ["${var.database_flags}"]
3638
}
3739

3840
replica_configuration = ["${var.replica_configuration}"]

variables.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ variable database_version {
3333
default = "MYSQL_5_6"
3434
}
3535

36+
variable master_instance_name {
37+
description = "The name of the master instance to replicate"
38+
default = ""
39+
}
40+
3641
variable tier {
3742
description = "The machine tier (First Generation) or type (Second Generation). See this page for supported tiers and pricing: https://cloud.google.com/sql/pricing"
3843
default = "db-f1-micro"
@@ -104,6 +109,11 @@ variable replication_type {
104109
default = "SYNCHRONOUS"
105110
}
106111

112+
variable database_flags {
113+
description = "List of Cloud SQL flags that are applied to the database server"
114+
default = []
115+
}
116+
107117
variable backup_configuration {
108118
description = "The backup_configuration settings subblock for the database setings"
109119
type = "map"

0 commit comments

Comments
 (0)