Skip to content

Commit

Permalink
Add gridscale_mysql resource example
Browse files Browse the repository at this point in the history
  • Loading branch information
nvthongswansea authored Jun 9, 2021
1 parent 3680839 commit 2a55541
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
11 changes: 11 additions & 0 deletions mysql/README.md
Original file line number Diff line number Diff line change
@@ -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.
25 changes: 25 additions & 0 deletions mysql/mysql.tf
Original file line number Diff line number Diff line change
@@ -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"
}

0 comments on commit 2a55541

Please sign in to comment.