-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Cloud SQL flag examples (#5943)
* Added Cloud SQL flags and user examples * Changed name to id to fix Reference to undeclared resource error * fixed references * fixed flags * Removed the user part because it's causing errors
- Loading branch information
1 parent
fee7c1e
commit 2cf8c40
Showing
4 changed files
with
108 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
mmv1/templates/terraform/examples/sql_mysql_instance_flags.tf.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# [START cloud_sql_mysql_instance_flags] | ||
resource "google_sql_database_instance" "<%= ctx[:primary_resource_id] %>" { | ||
database_version = "MYSQL_8_0" | ||
name = "<%= ctx[:vars]['mysql_instance'] %>" | ||
region = "us-central1" | ||
settings { | ||
database_flags { | ||
name = "general_log" | ||
value = "on" | ||
} | ||
database_flags { | ||
name = "skip_show_database" | ||
value = "on" | ||
} | ||
database_flags { | ||
name = "wait_timeout" | ||
value = "200000" | ||
} | ||
disk_type = "PD_SSD" | ||
tier = "db-n1-standard-2" | ||
} | ||
deletion_protection = "<%= ctx[:vars]['deletion_protection'] %>" | ||
} | ||
# [END cloud_sql_mysql_instance_flags] |
19 changes: 19 additions & 0 deletions
19
mmv1/templates/terraform/examples/sql_postgres_instance_flags.tf.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# [START cloud_sql_postgres_instance_flags] | ||
resource "google_sql_database_instance" "<%= ctx[:primary_resource_id] %>" { | ||
name = "<%= ctx[:vars]['postgres_instance'] %>" | ||
region = "us-central1" | ||
database_version = "POSTGRES_14" | ||
settings { | ||
database_flags { | ||
name = "log_connections" | ||
value = "on" | ||
} | ||
database_flags { | ||
name = "log_min_error_statement" | ||
value = "error" | ||
} | ||
tier = "db-custom-2-7680" | ||
} | ||
deletion_protection = "<%= ctx[:vars]['deletion_protection'] %>" | ||
} | ||
# [END cloud_sql_postgres_instance_flags] |
24 changes: 24 additions & 0 deletions
24
mmv1/templates/terraform/examples/sql_sqlserver_instance_flags.tf.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# [START cloud_sql_sqlserver_instance_flags] | ||
resource "google_sql_database_instance" "<%= ctx[:primary_resource_id] %>" { | ||
name = "<%= ctx[:vars]['sqlserver_instance'] %>" | ||
region = "us-central1" | ||
database_version = "SQLSERVER_2019_STANDARD" | ||
root_password = "INSERT-PASSWORD-HERE" | ||
settings { | ||
database_flags { | ||
name = "1204" | ||
value = "on" | ||
} | ||
database_flags { | ||
name = "remote access" | ||
value = "on" | ||
} | ||
database_flags { | ||
name = "remote query timeout (s)" | ||
value = "300" | ||
} | ||
tier = "db-custom-2-7680" | ||
} | ||
deletion_protection = "<%= ctx[:vars]['deletion_protection'] %>" | ||
} | ||
# [END cloud_sql_sqlserver_instance_flags] |