generated from storyprotocol/repo-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
97 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module "vpc" { | ||
source = "./vpc" | ||
|
||
env = var.env | ||
region = var.region | ||
name = var.name | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
variable "region" { | ||
description = "The region where the resources will be created" | ||
type = string | ||
} | ||
|
||
variable "env" { | ||
description = "The environment name" | ||
type = string | ||
} | ||
|
||
variable "name" { | ||
description = "The name of the VPC" | ||
type = string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Filter out local zones not currently supported | ||
# with managed node groups | ||
data "aws_availability_zones" "available" { | ||
filter { | ||
name = "opt-in-status" | ||
values = ["opt-in-not-required"] | ||
} | ||
} | ||
|
||
locals { | ||
region = var.region | ||
vpc_cidr = "10.0.0.0/16" | ||
} | ||
|
||
module "iac-max-vpc" { | ||
source = "terraform-aws-modules/vpc/aws" | ||
version = "5.8.1" | ||
|
||
name = "iac-max-vpc" | ||
|
||
cidr = local.vpc_cidr | ||
azs = slice(data.aws_availability_zones.available.names, 0, 3) | ||
|
||
private_subnets = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"] | ||
public_subnets = ["10.0.4.0/24", "10.0.5.0/24", "10.0.6.0/24"] | ||
|
||
enable_nat_gateway = true | ||
single_nat_gateway = true | ||
enable_dns_hostnames = true | ||
enable_dns_support = true | ||
|
||
tags = { | ||
Terraform = "true" | ||
Environment = var.env | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
output "vpc_id" { | ||
value = module.iac-max-vpc.vpc_id | ||
description = "The ID of the VPC created." | ||
} | ||
|
||
output "public_subnet_ids" { | ||
value = module.iac-max-vpc.public_subnets | ||
description = "List of IDs of public subnets." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
variable "region" { | ||
description = "Region where the VPC will be created" | ||
type = string | ||
} | ||
variable "name" { | ||
description = "Name of the VPC" | ||
type = string | ||
} | ||
|
||
variable "env" { | ||
description = "Environment" | ||
type = string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,13 @@ | ||
variable "region" { | ||
description = "Region where the VPC will be created" | ||
type = string | ||
} | ||
variable "name" { | ||
description = "Name of the VPC" | ||
type = string | ||
} | ||
|
||
variable "cidr" { | ||
description = "CIDR block for the VPC" | ||
variable "env" { | ||
description = "Environment" | ||
type = string | ||
} | ||
|
||
variable "azs" { | ||
description = "Availability Zones to use for the subnets" | ||
type = list(string) | ||
} | ||
|
||
variable "private_subnets" { | ||
description = "List of private subnet CIDRs" | ||
type = list(string) | ||
} | ||
|
||
variable "public_subnets" { | ||
description = "List of public subnet CIDRs" | ||
type = list(string) | ||
} | ||
|
||
variable "enable_nat_gateway" { | ||
description = "Should be true if NAT gateway should be created" | ||
type = bool | ||
} | ||
|
||
variable "enable_vpn_gateway" { | ||
description = "Should be true if VPN gateway should be created" | ||
type = bool | ||
} |