GithubHelp home page GithubHelp logo

bocan / toolbox-ec2 Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 36 KB

A bit of Terraform to create a support EC2 instnace in your VPC

License: MIT License

HCL 86.17% Shell 13.83%
aws aws-ec2 jumpbox terraform

toolbox-ec2's Introduction

tfsec

toolbox-ec2

A bit of Terraform to create a support AWS EC2 instance in your VPC with a public address. You can use this as a temporary jump box to perhaps run a query against your database, connect to a non-public EKS cluster, etc.

A word of warning: This thing is quite safe as you can only connect via your local ip, and of course it requires the key anyway - however, if you're building it in your company's AWS account, please ensure you have permission to create entities with public addresses on the public subnets.

Instructions

  1. It's assumed you're a Terraform user already, so how you connect to AWS is your problem. I use 'awsp', choose a profile, do a aws sso login and then you run terraform apply.
  2. This saves state locally. There's no need for anything else as it's not assumed you're collaborating on it with anyone else, and you just want a temporary EC2 instance to use as a jump box.
  3. Edit the locals.tf file. Change 'name' to whatever you want your resources called, your_ip to your ip, the vpc and a public subnet_id to one in your existing VPC, and add anything you want installed into the user_data. You should also tweak the tags unless your name is the same as mine.

Customizations

  • If you have network access to whichever AWS network you're building this in, you could just choose a private subnet.

  • If you really want ssh access from anywhere, you could tell it your address is 0.0.0.0 - but, the network prefix is purposely hardcoded to /32. You'd need to change that too.

Terraform Version Support

This was built and tested with Terraform 1.0.11 - as that was the version I supported at the time and Terraform 1.2.4 - as that was the latest stable version..

toolbox-ec2's People

Contributors

bocan avatar

Stargazers

 avatar  avatar

Watchers

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