cowork
This commit is contained in:
24
modules/nat-gateway/main.tf
Normal file
24
modules/nat-gateway/main.tf
Normal 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
|
||||
# }
|
4
modules/nat-gateway/outputs.tf
Normal file
4
modules/nat-gateway/outputs.tf
Normal file
@ -0,0 +1,4 @@
|
||||
output "nat_id" {
|
||||
value = aws_nat_gateway.example.id
|
||||
|
||||
}
|
5
modules/nat-gateway/variables.tf
Normal file
5
modules/nat-gateway/variables.tf
Normal file
@ -0,0 +1,5 @@
|
||||
variable "subnet_id" {
|
||||
description = "subnet id"
|
||||
type = string
|
||||
|
||||
}
|
Reference in New Issue
Block a user