Skip to content
This repository has been archived by the owner on Jun 23, 2023. It is now read-only.

padok-team/terraform-aws-network

Repository files navigation

REPOSITORY ARCHIVED

This repository will no longer be maintained.

Please, use the module in the starter instead.

AWS Network Terraform module

Terraform module which creates VPC resources on AWS. This module is an abstraction of the AWS VPC Terraform.

User Stories for this module

  • AAOps I can I can deploy an HA VPC on multiple AZ easily
  • AAOps I can deploy public, private & intra subnets in my VPC
  • AAOps My route tables and NACLs are preconfigured
  • AAOps I can retrieve subnets & vpc ids as outputs of the module

Schema

Schema

Usage

module "simple_vpc" {
  source = "git@github.com:padok-team/terraform-aws-network.git"

  vpc_name = "Simple_VPC"
  tags = {
    "Scope"      = "Global Tag",
    "Terraform"  = "True",
    "ModuleName" = "simple_vpc"
  }

  public_subnet_tags = {
    "Scope" = "Public Subnet Tag"
  }

  vpc_availability_zone = ["eu-west-3a"]

  vpc_cidr            = "172.16.0.0/24"
  private_subnet_cidr = ["172.16.0.0/25"]
  public_subnet_cidr  = ["172.16.0.128/25"]
  intra_subnet_cidr   = []
}

Examples

Modules

Name Source Version
this terraform-aws-modules/vpc/aws 3.10.0

Inputs

Name Description Type Default Required
tags Tags for all your ressources map(string) n/a yes
vpc_availability_zone List of AZ Names or IDs in your region list(string) n/a yes
vpc_cidr CIDR block of your VPC string n/a yes
vpc_name Name of your VPC string n/a yes
create_igw Controls if an Internet Gateway is created for public subnets and the related routes that connect them. bool true no
enable_nat_gateway Should be true if you want to provision NAT Gateways for each of your private networks bool true no
intra_acl_tags Additional tags for your intra acl map(string) {} no
intra_dedicated_network_acl Whether or not to use a dedicated network ACL (not default) and custom rules for intra subnets bool false no
intra_inbound_acl_rules Intra subnets inbound network ACLs list(map(string)) [] no
intra_outbound_acl_rules Intra subnets inbound network ACLs list(map(string)) [] no
intra_subnet_cidr List of intra CIDRs to deploy in your VPC list(string) [] no
intra_subnet_suffix Suffix for your public subnets string "intra" no
intra_subnet_tags Additional tags for your intra subnets map(string) {} no
map_public_ip_on_launch Associate public IP to instances by default bool false no
private_acl_tags Additional tags for your private ACLs map(string) {} no
private_dedicated_network_acl Whether or not to use a dedicated network ACL (not default) and custom rules for private subnets bool false no
private_inbound_acl_rules Private subnets inbound network ACLs list(map(string)) [] no
private_outbound_acl_rules Private subnets inbound network ACLs list(map(string)) [] no
private_subnet_cidr List of Private CIDRs to deploy in your VPC list(string) [] no
private_subnet_suffix Suffix for your public subnets string "private" no
private_subnet_tags Additional tags for your private subnets map(string) {} no
public_acl_tags Additional tags for your private acl map(string) {} no
public_dedicated_network_acl Whether or not to use a dedicated network ACL (not default) and custom rules for public subnets bool false no
public_inbound_acl_rules Public subnets inbound network ACLs list(map(string)) [] no
public_outbound_acl_rules Public subnets inbound network ACLs list(map(string)) [] no
public_subnet_cidr List of public CIDRs to deploy in your VPC list(string) [] no
public_subnet_suffix Suffix for your public subnets string "public" no
public_subnet_tags Additional tags for your public subnets map(string) {} no
single_nat_gateway Should be true if you want to provision a single shared NAT Gateway across all of your private networks. Set to false for production environment bool true no
vpc_tags Additional Tags for your VPC map(string) {} no

Outputs

Name Description
intra_subnets_ids List of IDs of intra subnets
nat_gateway_ips List of Nat Gateway External IPs
private_subnets_ids List of IDs of private subnets
public_subnets_ids List of IDs of public subnets
vpc_id The ID of the VPC

License

License

See LICENSE for full details.

Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

  https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.