From 3dbb6ead79c84eaaa89a74a9f8500d6648729d3d Mon Sep 17 00:00:00 2001 From: young Date: Fri, 2 Aug 2019 20:27:36 +0900 Subject: [PATCH] resource namig rule --- README.md | 2 +- label.tf | 4 ++-- main.tf | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 23221cc..d21e77b 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ You can use this module like as below example. ``` -odule "mysql" { +module "mysql" { source = "tf-mod/mysql/aws" version = "1.0.0" diff --git a/label.tf b/label.tf index 8245c04..f25d032 100644 --- a/label.tf +++ b/label.tf @@ -11,6 +11,6 @@ resource "random_string" "suffix" { ### frigga naming rule locals { name = "${join("-", compact(list(var.name, var.stack, var.detail, random_string.suffix.result)))}" - cluster_name = "${local.name}" - cluster_id = "${local.name}" + cluster-name = "${local.name}" + cluster-id = "${local.name}" } diff --git a/main.tf b/main.tf index 4d32621..0577035 100644 --- a/main.tf +++ b/main.tf @@ -19,7 +19,7 @@ resource "aws_security_group" "db" { }" } -resource "aws_security_group_rule" "db_ingress_rules" { +resource "aws_security_group_rule" "db-ingress-rules" { type = "ingress" from_port = "${var.mysql_port}" to_port = "${var.mysql_port}" @@ -69,7 +69,7 @@ resource "aws_db_parameter_group" "db" { ### rds (aurora) resource "aws_rds_cluster" "db" { - cluster_identifier_prefix = "${local.cluster_id}-" + cluster_identifier_prefix = "${local.cluster-id}-" engine = "aurora-mysql" engine_version = "${var.mysql_version}" engine_mode = "provisioned" @@ -94,7 +94,7 @@ resource "aws_rds_cluster" "db" { ### instances resource "aws_rds_cluster_instance" "db" { count = "${var.mysql_node_count}" - identifier = "${local.cluster_id}-${count.index}" + identifier = "${local.cluster-id}-${count.index}" cluster_identifier = "${aws_rds_cluster.db.id}" instance_class = "${var.mysql_node_type}" engine = "aurora-mysql" @@ -106,7 +106,7 @@ resource "aws_rds_cluster_instance" "db" { ### dns records resource "aws_route53_record" "db" { zone_id = "${var.dns_zone_id}" - name = "${local.cluster_id}-db.${var.dns_zone}" + name = "${local.cluster-id}-db.${var.dns_zone}" type = "CNAME" ttl = 300 records = ["${coalescelist(aws_rds_cluster.db.*.endpoint, list(""))}"]