GithubHelp home page GithubHelp logo

beardimonr / aws_deployment Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 2.0 40 KB

Scripts for creating simple infrastructure on AWS Free Tier with free domain name and SSL

Dockerfile 0.79% Python 17.44% Shell 28.49% HCL 53.27%
aws aws-ec2 flask flask-sqlalchemy rds-mysql shell shell-script terraform

aws_deployment's Introduction

AWS deployment

Repository for AWS deployment with domain name and SSL

Prerequisite

  1. Register new AWS account with this guide. You need email, telephone, and credit card (create and use a virtual one).

  2. Install aws cli. To validate: aws --version

  3. Install terraform. To validate: terraform --version

TO deploy infrastructure

Configure AWS

  1. Go to the aws console

  2. Go to the User > Settings and change Default Region to us-east-2

  3. Change region to your default (and use it further)

  4. Follow this guide to create user with administrator access and get credentials for aws cli.

  5. Download them as .csv file and open file.

  6. Get AccessKeyId and SecretAccessKey from this file (splited by commas)

  7. Open terminal and run aws configure

  8. Paste AccessKeyId, SecretAccessKey. Default region: us-east-2, enter. Default output: text, enter.

  9. Delete .csv file for security

Creating key for EC2 access

  1. Go to the aws console.

  2. Go to the Key pairs service.

  3. Create key pair with some name (lets call it key_name).

  4. Move downloaded key_name.pem to the project root folder.

  5. Open infrastructure/main.tf and change variable key_name default to the name of your key.

Creating domain name

  1. Go to the site

  2. Enter domain you want and check it

  3. Find domain with "Get it now" button, copy it and paste in the search and check it again (search with extension like domain.tk)

  4. You should see checkout button, click it

  5. Select period and click Continue

  6. Enter email (can use fake one) and follow link in the email.

  7. Use fake address generator for country where your ip located to generate address (example).

  8. Enter data and complete order. If all is fine you won't get Technical error.

  9. Log in to the site and go to Services > MyDomain > Manage Domain > Management Tools > Nameservers. Select use custom nameservers

  10. Open infrastructure/main.tf and change variable key_name default to the name of your domain.

  11. Do not close this site, here you will enter aws nameservers from the generated infrastructure (from .nameservers file).

Deploying infrastructure

  1. Go to the infrastructure/main.tf and check if variables and data comfortable for you.

  2. Open terminal in root project folder.

  3. Enter cd infrastructure and run sh deploy_infrastructure.sh

  4. Wait for infrastructure to be deployed (if needed, confirm)

  5. After ending, check .infrastructure_output file. There will be stored all necessary variables for deployment.

  6. Also, check .nameservers file. Here you will see nameservers, which can be used to fill in nameservers for your domain.

  7. To destroy created infrastructure run terraform destroy

Deploying project (Optionally)

  1. Create .env file and copy content from .infrastructure_output

  2. Add variables DOMAIN_NAME (which you created before) and DOMAIN_EMAIL (which will be used by certbot for maintenance), so the keys of .env is equal to the .env.example

  3. Be sure that you can access your ec2 instance with the domain

  4. Open terminal in root project folder.

  5. Run deploy.sh

  6. Access it with your domain, you should see text message.

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.