Code Monkey home page Code Monkey logo

yatavm's Introduction

Table of Contents


Description

Yet Another Terraform AWS VPC module (yatavm).

Motivation

  • Most Terraform AWS modules use count to create resources. Sometimes this can cause issues and force to recreate resources when adding or changing vpc elements like nat gateways or routes.
  • To avoid this, terraform can use for_each statement, which creates keys instead of indexes to define resources.
  • This terraform module only uses for_each statement to create conditional multielement resources.

Usage

VPC deployment example
module "vpc" {
  name   = "myvpc"
  source = "../"

  aws_region      = "us-west-2" # AWS region where the VPC will be deployed.
  cidr            = "10.0.0.0/16" # cidr of the vpc
  private_subnets = ["10.0.0.0/23", "10.0.2.0/23", "10.0.4.0/23"] # Private Subnets cidr
  public_subnets  = ["10.0.100.0/23", "10.0.102.0/23", "10.0.104.0/23"] # Public Subnets cidr

  # public_inbound_acl_rules   = local.network_acls["public_inbound"] # Optional
  # public_outbound_acl_rules  = local.network_acls["public_outbound"] # Optional
  # private_inbound_acl_rules  = local.network_acls["private_inbound"] # Optional
  # private_outbound_acl_rules = local.network_acls["private_outbound"] # Optional
}

Subnets

  • This module allows creating up to 1 subnet per each availability zone in the AWS region.
  • For example, if you deploy a VPC in an AWS region which has 3 AZ, you can define a cidr list between 1 and 3 elements.
  • The module automatically creates the subnets in different AZ and validates that the number of defined subnets are available in the AWS Region.

Future Work

  • Add variable to allow shared or single NAT per private subnet.
  • Add extended functionality and option.
  • README updates.

yatavm's People

Contributors

marcportabellaclotet-mt avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.