Skip to content

Rana-Salama/dnbtf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages