mirror of
https://codeberg.org/scottslowe/learning-tools.git
synced 2026-03-11 09:04:37 +00:00
added NAT GW resource
This commit is contained in:
parent
8d7cf1304b
commit
b6e221fe77
2 changed files with 26 additions and 0 deletions
20
terraform/aws/new-natgw/main.tf
Normal file
20
terraform/aws/new-natgw/main.tf
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
// Create a Elastic IP for NAT GW
|
||||
resource "aws_eip" "demo_gw_eip" {
|
||||
vpc = true
|
||||
tags = {
|
||||
tool = "terraform"
|
||||
}
|
||||
}
|
||||
|
||||
// Create a NAT GW in public1 and public2 subnets
|
||||
resource "aws_nat_gateway" "ease_prod_vpc_nat_gws" {
|
||||
count = length(var.ease_prod_vpc_public_subnets)
|
||||
allocation_id = aws_eip.demo_gw_eip.id
|
||||
# feed coreos_subnet public subnet ID
|
||||
subnet_id = var.coreos_subnet_id
|
||||
|
||||
tags = {
|
||||
tool = "terraform"
|
||||
}
|
||||
depends_on = [aws_eip.demo_gw_eip]
|
||||
}
|
||||
6
terraform/aws/new-natgw/variables.tf
Normal file
6
terraform/aws/new-natgw/variables.tf
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
// note: this variable will be fed with coreos_subnet subnet ID which can be found at terraform/aws/new-vpc/main.tf
|
||||
variable "coreos_subnet_id" {
|
||||
type = "string"
|
||||
default = ""
|
||||
description = "AWS coreos_vpc subnet ID"
|
||||
}
|
||||
Loading…
Reference in a new issue