Skip to content

jonasduarte/bidnamic-tf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bidnamic Technical Challenge

Deploy the minimal flask app using Infrastructure as Code (IAC) technologies.

Minimal Flask app -> https://flask.palletsprojects.com/en/1.1.x/quickstart/#a-minimal-application

  1. Getting Started
    1. Prerequisites
      1. Terraform
      2. Ansbile
    2. Deploy
      1. Download Source Code
      2. Install pip3 packages
      3. AWS Credentials
      4. Deploy Application
      5. Usage

Getting Started

The procedure described here assumes you are running it on a fresh installation of Ubuntu 20.04.

Prerequisites

Terraform

# Reference -> https://www.terraform.io/docs/cli/install/apt.html
# Repository Configuration
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -
sudo apt-add-repository "deb [arch=$(dpkg --print-architecture)] https://apt.releases.hashicorp.com $(lsb_release -cs) main"

# Terraform installation
sudo apt install terraform

Ansible

# Reference -> https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#installing-ansible-on-ubuntu
sudo apt update
sudo apt install software-properties-common
sudo add-apt-repository --yes --update ppa:ansible/ansible
sudo apt install ansible

# Ansible aws_ec2 Plugin
# Reference -> https://docs.ansible.com/ansible/latest/collections/amazon/aws/aws_ec2_inventory.html
sudo ansible-galaxy collection install amazon.aws

Deploy

Download Source Code

git clone --recursive https://github.com/jonasduarte/bidnamic-tf.git

Install pip3 packages

sudo apt install python3-pip
pip3 install awscli boto3

AWS Credentials

Terraform will use the aws profile "default". however you may use a different one. See -> Usage

Deploy Application

Inside the application root folder, execute the following command:

python3 deploy-bd.py --aws-secret-key SECRET-KEY --aws-access-key ACCESS-KEY

Usage

For more info run it with the -h flag

usage: deploy-bd.py [-h] [--version VERSION] [--profile PROFILE] --secret SECRET --access ACCESS

optional arguments:
  -h, --help         show this help message and exit
  --version VERSION  Input code version. (Default: latest)
  --profile PROFILE  Input AWS Profile. (Default: default)
  --secret SECRET    Input AWS Secret Key.
  --access ACCESS    Input AWS Access Key.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published