Skip to content

Commit

Permalink
Merge pull request #2 from sagansystems/fix-typo
Browse files Browse the repository at this point in the history
Fix typo in zone name and move db subnet to database.tf
  • Loading branch information
darend authored Nov 1, 2017
2 parents d20d374 + 1736cb7 commit 61f6848
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
21 changes: 21 additions & 0 deletions database.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
module "db_subnet_label" {
enabled = "${var.enabled}"
source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.3.0"
namespace = "${var.namespace}"
stage = "${var.stage}"
name = "db-subnet"
attributes = ["replica"]
tags = "${var.tags}"
}

resource "aws_db_subnet_group" "replica" {
count = "${var.enabled == "true" ? 1 : 0}"
provider = "aws.replica"

name = "${module.db_subnet_label.id}"
description = "Database subnet group for ${module.db_subnet_label.name}"
subnet_ids = ["${aws_subnet.zone_1.id}", "${aws_subnet.zone_2.id}", "${aws_subnet.zone_3.id}"]

tags = "${module.db_subnet_label.tags}"
}

module "kms_label" {
enabled = "${var.enabled}"
source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.3.0"
Expand Down
27 changes: 3 additions & 24 deletions vpc.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ resource "aws_vpc" "replica" {
}

locals {
zone_1_az = "${element(data.aws_availability_zones.available.names, 0)}"
zone_2_az = "${element(data.aws_availability_zones.available.names, 1)}"
zone_3_az = "${element(data.aws_availability_zones.available.names, 2)}"
zone_1_az = "${element(data.aws_availability_zones.available.names, 0)}"
zone_2_az = "${element(data.aws_availability_zones.available.names, 1)}"
zone_3_az = "${element(data.aws_availability_zones.available.names, 2)}"
}

module "zone_1_label" {
Expand Down Expand Up @@ -82,24 +82,3 @@ resource "aws_subnet" "zone_3" {

tags = "${module.zone_3_label.tags}"
}

module "db_subnet_label" {
enabled = "${var.enabled}"
source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.3.0"
namespace = "${var.namespace}"
stage = "${var.stage}"
name = "db-subnet"
attributes = ["replica"]
tags = "${var.tags}"
}

resource "aws_db_subnet_group" "replica" {
count = "${var.enabled == "true" ? 1 : 0}"
provider = "aws.replica"

name = "${module.db_subnet_label.id}"
description = "Database subnet group for ${module.db_subnet_label.name}"
subnet_ids = ["${aws_subnet.zone_1.id}", "${aws_subnet.zone_2.id}", "${aws_subnet.zone_1.id}"]

tags = "${module.db_subnet_label.tags}"
}

0 comments on commit 61f6848

Please sign in to comment.