This commit is contained in:
2023-01-11 01:31:56 +09:00
parent f0402956e2
commit c96cac92b9
42 changed files with 746 additions and 265 deletions

View File

@ -0,0 +1,24 @@
resource "aws_eip" "nat-eip" {
vpc = true
lifecycle {
create_before_destroy = true
}
}
resource "aws_nat_gateway" "example" {
allocation_id = aws_eip.nat-eip.id
subnet_id = var.subnet_id
tags = {
Name = "gw NAT"
}
# 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.example.id
}

View File

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