Giter VIP home page Giter VIP logo

terraform-aws-bastion's Introduction

Terraform bastion module

Module to create a bastion host (or stepping stone). The module let you enable this host once needed. Be default the host is not created.

Terraform version

  • Terraform 0.12: Pin module to ~> 2+, submit pull request to branch develop
  • Terraform 0.11: Pin module to ~> 1.x, submit pull request to branch terrafomr011

Example usages:

See also the full examples.


module "vpc" {
  source = "git::https://github.com/philips-software/terraform-aws-vpc?ref=2.0.0"

  environment = var.environment
  aws_region  = var.aws_region
}

# Default bastion
module "bastion" {
  source = "git::https://github.com/philips-software/terraform-aws-bastion?ref=2.0.0"
  enable_bastion = true

  environment = var.environment
  project     = var.project

  aws_region = var.aws_region
  key_name   = aws_key_pair.bastion_key[0].key_name
  subnet_id  = element(module.vpc.public_subnets, 0)
  vpc_id     = module.vpc.vpc_id

  // add additional tags
  tags = {
    my-tag = "my-new-tag"
  }
}

Inputs

Name Description Type Default Required
admin_cidr CIDR pattern to access the bastion host string "0.0.0.0/0" no
amazon_optimized_amis Map from region to AMI. By default the latest Amazon Linux is used. map(string) <map> no
aws_region The Amazon region. string n/a yes
ebs_optimized If true, the launched EC2 instance will be EBS-optimized. bool "false" no
enable_bastion If true the bastion will be created. Be default the bastion host is not running, needs explicit set to true. bool "false" no
environment Logical name of the environment. string n/a yes
instance_type EC2 instance type. string "t2.micro" no
key_name SSH key name for the environment. string n/a yes
project Name of the project. string n/a yes
subnet_id Subnet in which the basion needs to be deployed. string n/a yes
tags Map of tags to apply on the resources map(string) <map> no
user_data Used data for bastion EC2 instance string "" no
vpc_id The VPC to launch the instance in (e.g. vpc-66ecaa02). string n/a yes

Outputs

Name Description
instance_id Id of the created instance.
public_ip Public ip of the created instance.

Automated checks

Currently the automated checks are limited. In CI the following checks are done for the root and each example.

  • lint: terraform validate and terraform fmt
  • basic init / get check: terraform init -get -backend=false -input=false

Generation variable documentation

A markdown table for variables can be generated as follow. Generation requires awk and terraform-docs installed.

 .ci/bin/terraform-docs.sh markdown .

Philips Forest

This module is part of the Philips Forest.

                                                     ___                   _
                                                    / __\__  _ __ ___  ___| |_
                                                   / _\/ _ \| '__/ _ \/ __| __|
                                                  / / | (_) | | |  __/\__ \ |_
                                                  \/   \___/|_|  \___||___/\__|  

                                                                 Infrastructure

Talk to the forestkeepers in the forest-channel on Slack.

Slack

terraform-aws-bastion's People

Contributors

npalm avatar koendelaat avatar jeroenknoops avatar bartgolsteijn avatar sjose1x avatar

Watchers

James Cloos 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.