Code Monkey home page Code Monkey logo

nat-instance's Introduction

NAT Instance

Running on Amazon Linux 2023.

Everything else in this repository besides the NAT directory should be ignored and is described in this post:

https://pabis.eu/blog/2024-03-01-NAT-Instance-Update-Amazon-Linux-2023-CodeBuild-Terratest.html

Import the module like this:

module "nat" {
  source          = "git::github.com/ppabis/nat-instance.git//NAT?ref=v2.0.4"
  vpc             = var.vpc_id
  public_subnet   = var.public_subnet
  private_subnet  = [var.private_subnet_a, var.private_subnet_b, var.private_subnet_c]
  route_tables    = [var.private_route_table_abc]
  elastic_ip      = true
  additional_cidr = [var.extra_cidr]
  additional_sg   = [var.extra_security_group]
}

Parameters

  • vpc (string, required) - VPC ID
  • name_tag (string) - How to tag all resources created by this module. Default is NAT-Instance.
  • public_subnet (string, required) - Public subnet ID to place the instance in
  • private_subnet (list, required) - List of private subnet IDs to route traffic through the NAT instance
  • route_tables (list, required) - List of route table IDs associated with the above private subnets
  • elastic_ip (bool) - Whether to associate an Elastic IP with the NAT instance. You can rely on AWS assigned IP but then no public IP will be associated if you ever stop the instance. Default is false.
  • security_group (string) (Optional) - Security group ID to use for the NAT instance. Otherwise a new one will be created.
  • additional_cidr (list) (Optional) - List of CIDR blocks to allow traffic from. Ignored if security_group is set.
  • additional_sg (list) (Optional) - List of security group IDs to allow traffic from. Ignored if security_group is set.
  • create_ssm_role (bool) (Optional) - Use it only for debugging. Whether to create an IAM role for SSM access. Default is false.
  • iam_profile (string) (Optional) - IAM instance profile name to use. Alternative to create_ssm_role. If not SSM, you probably don't need this.

Outputs

  • public-nat-ip - Public IP of the NAT instance
  • security_group_id - Security group ID of the NAT instance. If you provided security_group parameter, this will be the same ID. Otherwise attach this security group to your instances that need to access the internet if you didn't add them with additional_cidr or additional_sg.

nat-instance's People

Contributors

ppabis 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.