private_subnets.tf 1.5 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #resource "aws_subnet" "private" {
  2. # count = "${length(var.vpc-azs)}"
  3. # vpc_id = "${aws_vpc.vpc.id}"
  4. # cidr_block = "${cidrsubnet(var.vpc-cidr, length(var.vpc-azs) * 2, count.index + length(var.vpc-azs))}"
  5. # availability_zone = "${var.vpc-azs[count.index]}"
  6. # tags = merge({ Name = "${var.vpc-name}-private-${element(var.vpc-azs, count.index)}" }, var.common-tags)
  7. #}
  8. #
  9. #resource "aws_eip" "private-nat-eip" {
  10. # count = "${length(var.vpc-azs)}"
  11. # vpc = true
  12. # tags = merge({ Name = "${var.vpc-name}-nat-eip-${count.index}" }, var.common-tags)
  13. # depends_on = ["aws_internet_gateway.vpc"]
  14. #}
  15. #
  16. #resource "aws_nat_gateway" "private" {
  17. # count = "${length(var.vpc-azs)}"
  18. # allocation_id = "${element(aws_eip.private-nat-eip.*.id, count.index)}"
  19. # subnet_id = "${element(aws_subnet.public.*.id, count.index)}"
  20. # depends_on = ["aws_internet_gateway.vpc"]
  21. # tags = merge({ Name = "${var.vpc-name}-private-${element(var.vpc-azs, count.index)}" }, var.common-tags)
  22. #}
  23. #
  24. #resource "aws_route" "nat_gateway" {
  25. # count = "${length(var.vpc-azs)}"
  26. # route_table_id = "${element(aws_route_table.private.*.id, count.index)}"
  27. # destination_cidr_block = "0.0.0.0/0"
  28. # nat_gateway_id = "${element(aws_nat_gateway.private.*.id, count.index)}"
  29. #}
  30. #
  31. #resource "aws_route_table" "private" {
  32. # count = "${length(var.vpc-azs)}"
  33. # vpc_id = "${aws_vpc.vpc.id}"
  34. # tags = merge({ Name = "${var.vpc-name}-private-${element(var.vpc-azs, count.index)}" }, var.common-tags)
  35. #}