Code Monkey home page Code Monkey logo

terraform-aws-free-tier's Introduction

Terraform AWS Free Tier

Getting started with the Terraform for managing a base free-tier AWS resources.

License: MIT

Project description

This is a Terraform project for managing AWS resources.

It can build the next infrastructure:

  • VPC
  • Public Subnet in the VPC
  • IGW to enable access to or from the Internet for VPC
  • Route Table to associate IGW, VPC and Subnet
  • EC2 Instance in the public Subnet with the HTTP(s) & SSH access

Pre steps

  1. Install Terraform
  2. Create AWS account
  3. If the file ~/.aws/credentials does't exist, create it and add you Terraform profile to the file. For example:
    [terraform]
    aws_access_key_id = Your access key
    aws_secret_access_key = Your secret access key 
    
  4. Create S3 bucket to store Terraform state
  5. Create config file ./src/free-tier/backend/config.tf that will contain information how to store state in a given bucket. See example.
  6. Create SSH key pair to connect to EC2 instance:
    cd ./src/free-tier/provision/access
    
    # it creates "free-tier-ec2-key" private key and "free-tier-ec2-key.pub" public key
    ssh-keygen -f free-tier-ec2-key

Build infrastructure

  1. cd ./src/free-tier
  2. terraform init -backend-config="./backend/config.tf"
  3. terraform plan
  4. terraform apply

Post steps

After building the infrastructure you can try to connect to you EC2 instance via SSH:

  1. cd ./src/free-tier
  2. ssh -i ./provision/access/free-tier-ec2-key ubuntu@[EC2 public IP]

To check HTTP access you can install apache2 on your EC2 instance:

  1. sudo apt update && sudo apt install apache2 (on EC2 machine)
  2. sudo service apache2 start (on EC2 machine)
  3. Check in browser: http://[EC2 public IP]/. You can see Apache2 Default Page (something like this)

To destroy infrastructure:

  1. cd ./src/free-tier
  2. terraform destroy

Similar projects

terraform-aws-free-tier's People

Contributors

jenciso avatar pvarentsov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

terraform-aws-free-tier's Issues

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.