Skip to content

Commit

Permalink
Added: random_id for cloudsql
Browse files Browse the repository at this point in the history
  • Loading branch information
konstantin-recurly committed May 22, 2020
1 parent 74ec0ab commit 4df8f4f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion modules/mysql/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,14 @@ locals {
backups_enabled = var.availability_type == "REGIONAL" ? true : lookup(var.backup_configuration, "enabled", null)
}

resource "random_id" "prefix" {
byte_length = 4
}

resource "google_sql_database_instance" "default" {
provider = google-beta
project = var.project_id
name = var.name
name = "${var.name}-${random_id.prefix.hex}"
database_version = var.database_version
region = var.region
encryption_key_name = var.encryption_key_name
Expand Down

0 comments on commit 4df8f4f

Please sign in to comment.