/terraform-aws-network

Highly opinionated management of AWS network resources

Primary LanguageHCLMIT LicenseMIT

terraform-aws-network

Introduction

This module manages network resources in AWS.

Usage

Instantiate the module by calling it from Terraform like this:

module "aws-eks" {
  source = "dodevops/network/aws"
  version = "<version>"
  
  (...)
}

Requirements

The following requirements are needed by this module:

  • terraform (>=1.0.0)

  • aws (>=3.33.0)

Providers

The following providers are used by this module:

  • aws (>=3.33.0)

Modules

No modules.

Resources

The following resources are used by this module:

Required Inputs

The following input variables are required:

cidr_block

Description: CIDR block for the VPC

Type: string

private_subnets

Description: A map of private subnets, the key is used as a name suffix for the subnet. Each object has the following items:

  • cidr_block: CIDR block used in subnet
  • availablity_zone: availability zone to use
  • tags: A map of tags to set

Type:

map(object({
    cidr_block : string,
    availability_zone : string,
    tags : map(string),
  }))

project

Description: Project this configuration is for

Type: string

public_subnets

Description: A list of public subnets, the key i used as a name suffi for the subnet. Each subnet has the following items:

  • cidr_block: CIDR block used in subnet
  • availablity_zone: availability zone to use
  • tags: A map of tags to set

Type:

map(object({
    cidr_block : string,
    availability_zone : string,
    tags : map(string),
  }))

region

Description: Name of the region

Type: string

stage

Description: Name of the stage

Type: string

suffix

Description: Suffix of the VPC name

Type: string

Optional Inputs

The following input variables are optional (have default values):

tags

Description: Additional tags to set

Type: map(string)

Default: {}

Outputs

The following outputs are exported:

arn

Description: ARN of the managed VPC

id

Description: ID of the managed VPC

private_subnet_cidrs

Description: CIDR blocks of the managed private subnets

private_subnet_ids

Description: IDs of the managed private subnets

public_subnet_cidrs

Description: CIDR blocks of the managed public subnets

public_subnet_ids

Description: IDs of the managed public subnets

security_group_id

Description: The id of the managed security group

vpce_endpoint_id_s3

Description: ID of the VPC gateway endpoint

Development

Use the terraform module tools to check and generate the documentation by running

docker run -v "$PWD":/terraform ghcr.io/dodevops/terraform-module-tools:latest