This commit is contained in:
2025-11-18 03:20:27 +00:00
parent c50d803865
commit fadee048d7
49 changed files with 3243 additions and 0 deletions

View File

@ -0,0 +1,22 @@
resource "aws_eip" "nat-eip" {
lifecycle {
create_before_destroy = true
}
}
resource "aws_nat_gateway" "main" {
allocation_id = aws_eip.nat-eip.id
subnet_id = var.subnet_id
tags = {
Name = "${var.tag_name}-ngw"
}
# To ensure proper ordering, it is recommended to add an explicit dependency
# on the Internet Gateway for the VPC.
# depends_on = [aws_internet_gateway.example]
}
# resource "aws_nat_gateway" "example" {
# connectivity_type = "private"
# subnet_id = aws_subnet.example.id
# }

View File

@ -0,0 +1,4 @@
output "nat_id" {
value = aws_nat_gateway.main.id
}

View File

@ -0,0 +1,10 @@
variable "subnet_id" {
description = "subnet id"
type = string
}
variable "tag_name" {
description = "value"
type = string
}