Skip to content

Commit

Permalink
Updated: mysql-public example
Browse files Browse the repository at this point in the history
  • Loading branch information
konstantin-recurly committed Jun 9, 2020
1 parent f1bbd4c commit effbe56
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
13 changes: 0 additions & 13 deletions examples/mysql-public/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,6 @@ resource "random_id" "name" {
byte_length = 2
}

resource "random_id" "instance_name_suffix" {
byte_length = 5
}

locals {
/*
Random instance name needed because:
"You cannot reuse an instance name for up to a week after you have deleted an instance."
See https://cloud.google.com/sql/docs/mysql/delete-instance for details.
*/
instance_name = "${var.db_name}-${random_id.instance_name_suffix.hex}"
}

module "mysql-db" {
source = "../../modules/mysql"
name = var.db_name
Expand Down
2 changes: 1 addition & 1 deletion examples/mysql-public/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ output "project_id" {
}

output "name" {
value = local.instance_name
value = module.mysql-db.instance_name
description = "The name for Cloud SQL instance"
}

Expand Down

0 comments on commit effbe56

Please sign in to comment.