diff --git a/mysql/README.md b/mysql/README.md new file mode 100644 index 0000000..672092d --- /dev/null +++ b/mysql/README.md @@ -0,0 +1,11 @@ +# MySQL Example + +This example shows how you can manage a MySQL with Terraform using the `"gridscale_mysql"` resource. + +Before you run Terraform, you need to set the `GRIDSCALE_TOKEN` and `GRIDSCALE_UUID` environment variables to their appropriate values. Take a look at the `.envrc` file for all variables. + +## Example + +In this example we will provision 2 MySQL resources: +- The first one is a simple MySQL resource without any MySQL parameters. +- The second one is a MySQL resourece with some MySQL parameters. diff --git a/mysql/mysql.tf b/mysql/mysql.tf new file mode 100644 index 0000000..4314a8d --- /dev/null +++ b/mysql/mysql.tf @@ -0,0 +1,25 @@ +terraform { + required_providers { + gridscale = { + source = "gridscale/gridscale" + version = "~> 1.11.0" + } + } +} + +resource "gridscale_mysql" "my-mysql" { + name = "my new mysql" + release = "5.7" + performance_class = "insane" +} + +resource "gridscale_mysql" "mysql-with-params" { + name = "my mysql with params" + release = "10.5" + performance_class = "insane" + labels = ["test"] + mysql_query_cache_limit = "2M" + mysql_default_time_zone = "Europe/Berlin" + mysql_server_id = 2 + mysql_binlog_format = "MIXED" +} \ No newline at end of file