europ / aws-simple-web-server

Deploy simple web server provided by nginx in debian 10 to amazon elastic compute cloud using terraform.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Amazon Web Services - Simple Web Server

Deploy simple web server provided by nginx in debian 10 to amazon elastic compute cloud using terraform.

Deployed Infrastructure

infrastructure.png

Dependency Graph

graph.svg

Setup

  1. prerequisites installation

    1. create AWS Account
      • generate access key
    2. install AWS CLI
    3. install Terraform
  2. environment configuration

    mkdir -p ~/.aws
    
    cat <<EOS > ~/.aws/config
    [default]
    region = us-east-1
    EOS
    
    cat <<EOS > ~/.aws/credentials
    [default]
    aws_access_key_id = <your AWS access key ID>
    aws_secret_access_key = <your AWS secret access key>
    EOS
    
    # secure the files
    chmod 0600 ~/.aws/config ~/.aws/credentials
  3. clone this repository and cd into it

  4. create SSH key pair

    ssh-keygen -t rsa -b 4096 -C "terraform" -f ./ssh/key
  5. configure terraform variables (set your custom values)

    # create variable file
    cp .terraform.tfvars.example terraform.tfvars
    
    # set custom variable values
    vi terraform.tfvars
  6. deployment

    # download module(s)
    terraform init
    
    # deploy
    terraform apply

About

Deploy simple web server provided by nginx in debian 10 to amazon elastic compute cloud using terraform.


Languages

Language:HCL 100.0%