Code Monkey home page Code Monkey logo

dnbtf's Introduction

Overview

Terraform that can be used to provision resources for a web server running apache in a private subnet and a bastian host in public subent fronted by IGW in a single VPC.

Contents

Requirements

  • An AWS Account

Prerequisites

  • Terraform istalled on the control machine where you are running the code. Verify by running terraform --version
  • Ensure you have full aws access to the account via IAM credentils stored in "~/.aws/credentials" or override the file in the aws provider in main.tf.
  • Backend S3 bucket to store the state file.
  • EC2 Key used to ssh.
  • Location for the public key to store and use.

Variables

Name Type Description
aws_region string aws region where the app will be deployed
role string Can only be dev or test
project string project name that will be used as a part of the team bucket name
owner_email string Email to contact owner
aws_keypair string EC2 key pair name to access the hosts
public_key_location string path to public key on the control machine

Modules

S3 Module

Resources:

Outputs:

Name Type Description
keystore_bucket string Name of the keystore bucket
team_project_bucket string Name of the team bucket

VPC Module

Resources:


Server Module

Resources:

Outputs:

Name Type Description
bastion_public_dns string Bastian DNS name
server_address string Apache server ip address
bastion_instance_profile string Bastian instance profile
server_rw_instance_profile string Apache server read write instance profile
server_read_instance_profile string Apache server read instance profile

Usage

Prepare code

  1. Edit terraform.auto.tfvars for the vaules refernced in Variables above.
  2. Edit main.tf in the root directory, remove the comment and add the bucket name under [ backend "s3"] to store the state file.

Using the control machine running terraform to run the below from the root directory

  1. terraform init
  2. terraform apply -auto-approve
  3. You can view the outputs running terraform output

Clean up

  1. terraform destroy

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.