瀏覽代碼

tag nat gateway

Chris Mague 6 年之前
父節點
當前提交
fc0e42fc48
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      private_subnets.tf

+ 2 - 1
private_subnets.tf

@@ -17,6 +17,7 @@ resource "aws_nat_gateway" "private" {
   allocation_id = "${element(aws_eip.private-nat-eip.*.id, count.index)}"
   allocation_id = "${element(aws_eip.private-nat-eip.*.id, count.index)}"
   subnet_id     = "${element(aws_subnet.public.*.id, count.index)}"
   subnet_id     = "${element(aws_subnet.public.*.id, count.index)}"
   depends_on    = ["aws_internet_gateway.vpc"]
   depends_on    = ["aws_internet_gateway.vpc"]
+  tags          = merge({ Name = "${var.vpc-name}-private-${element(var.vpc-azs, count.index)}" }, var.common-tags)
 }
 }
 
 
 resource "aws_route" "nat_gateway" {
 resource "aws_route" "nat_gateway" {
@@ -30,4 +31,4 @@ resource "aws_route_table" "private" {
   count  = "${length(var.vpc-azs)}"
   count  = "${length(var.vpc-azs)}"
   vpc_id = "${aws_vpc.vpc.id}"
   vpc_id = "${aws_vpc.vpc.id}"
   tags   = merge({ Name = "${var.vpc-name}-private-${element(var.vpc-azs, count.index)}" }, var.common-tags)
   tags   = merge({ Name = "${var.vpc-name}-private-${element(var.vpc-azs, count.index)}" }, var.common-tags)
-}
+}