Skip to content

hamzabouissi/fissaa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

image

credits for houda maabrouk for the logo: https://www.linkedin.com/in/maabrouk-houda-065748202/

This project is an experiment of my knowledge, I'd be happy if anyone find it useful.

Introduction

Fissaa is a CLI that helped me deploy applications to AWS ECS without the headache of setting-up domain registration,TLS Certification, Load Balancing,Rolling Back and budget monitoring.

Fissaa is a Tunisian word meaning speed-up.

Prerequisite

AWS Policies

The policies may seem too open for some developers, but I didn't focus so much on giving just the required permission for each service.

you can open a pull request if you find it a problem and I will solve it.

Note: to add those policies you need root account.

AWS Managed Policies

Custom Permissions

here is a link for a list of custom permissions you need to add for you user

https://gist.github.com/hamzabouissi/f800a962502c43c1bcff1bee0be3c5db

Registered Domain

you need to register a domain, if the domain registrar is AWS Route53 it be easy, but in case of any other registrar you need to crate hosted zone with the CLI.

Note: I used to register my domain on NameCheap and route with custom dns to Route53 name servers.

Developer Environment

Fissaa is currently available on Linux and Windows.

Fissaa use heavily Docker to build,push images of your applications.

Containerized Application

your project folder must contain a Dockerfile and the project is running on port 80.

Installation

Installing is easy as running 2 commands:

Linux

wget https://fissaa-cli.s3.amazonaws.com/test/install.sh -o install.sh
sudo sh install.sh linux

Congratulation, Fissaa is ready.

Initialize AWS Credentials

Before deploying your application, you need to initialize your AWS creedentials on your projcet folder

to do this you can run the following command:

fissaa env
USAGE:
    fissaa env [OPTIONS] <COMMAND>

OPTIONS:
    -h, --help    Prints help information

COMMANDS:
    init <aws-secret-key> <aws-access-key>

Note: be sure this AWS credentials belongs to an user who have the required policies.

App Commands

fissaa-deployment-commands

Deploy

Fissaa provide a simple one command to deploy your containerized application:

fissaa infrastructure yourdomain.com deploy --help
USAGE:
    fissaa infrastructure deploy [OPTIONS]

OPTIONS:
    -h, --help               Prints help information                  
        --environment        Environment are: Dev, Prod                      
        --add-monitor        Add AWS X-Ray to track your user requests
        --dockerfile-path 

fissaa-deploy-demo

Update

updating your deployed application is the same way as deploying it, you just run the same command and it will update your code

fissaa infrastructure yourdomain.com deploy

Monitoring

Fissaa can integrate a monitoring service(AWS X-Ray) with your deployed application, you need to integrate AWS X-RAY sdk first in your application code.

to deploy and add monitoring, you can run the following command:

fissaa infrastructure yourdomain.com deploy --add-monitor

fissaa-deploy-add-monitor

Logging

you can see your application logs by running the following command :

fissaa infrastructure yourdomain.com logs --help
USAGE:
    fissaa infrastructure logs [OPTIONS]

OPTIONS:
    -h, --help          Prints help information     
        --start-date    format yyyy/MM/dd HH:mm:ss  
        --hour          hour must be between 0 and 5

fissaa-logs-display

Create 5xx Error Alert

fissaa infrastructure yourdomain.com add-alarm --email <email>

You will receive a subscription request on email, after accepting it, if your server hit 10 5xx request within 5 minute you will get an email like this one.

image

Rolling Back

List previous deployed versions

fissaa infrastructure yourdomain.com rollback list-image-tags --help
USAGE:
    fissaa infrastructure rollback list-image-tags [OPTIONS]

OPTIONS:
    -h, --help    Prints help information

Apply Rollback

fissaa infrastructure yourdomain.com rollback apply --help
USAGE:
    fissaa infrastructure rollback apply [OPTIONS]

OPTIONS:
    -h, --help             Prints help information                              
        --latest           rollback to version prior to the current version, if 
                           no version nothing happen                            
        --image-version    Image version for container registry

Budget

Create a Budget Alarm

If you want to keep track your budget and get notified when you exceed it, you can create an alarm using the following command:

fissaa budget <domain> create <budget-amount> <budget-amount-limit> <email>

List Application Cost

To list your application cost on a day to day basis, you can see with the following command:

fissaa budget <domain> cost-list

fissaa-budget-list

Ready-to-Deploy Template

I created a simple template for sake of simplicity, but I want to create more templates for different cases like :

  • ML
  • Gaming
  • IOT
  • ECommerce

Ghost Platform

One of the case I got while developing this CLI is I wanted to deploy a Ghost Platform without the headache of setting-up all the prerequisite that ghost need like (RDS, S3, Email Server).

So I created a simple command that can deploy ghost under your specific domain:

fissaa template use --help
USAGE:
    fissaa template use <template-name> <mail-provider> <mail-email> 
<mail-password> [OPTIONS]

ARGUMENTS:
    <template-name>    template name, available options are: ghost       
    <mail-provider>    mailing service, available options are: sendinblue
    <mail-email>                                                         
    <mail-password>                                                      

OPTIONS:
    -h, --help    Prints help information

fisssaa-template-ghost-deploy

AWS Storage Servies(RDS,S3)

AWS RDS

to initialize a database, you can run the following command:

Note: database is available to connect to from a deployed application.

fissaa storage db init --help
USAGE:
    fissaa storage db init <db-type> <db-username> <db-name> <db-password> [OPTIONS]

ARGUMENTS:
    <db-type>        different db type allowed values are:  mysql, mariadb, postgres
    <db-username>                                                                   
    <db-name>                                                                       
    <db-password>                                                                   

OPTIONS:
    -h, --help          Prints help information               
        --db-storage    your database size on GB minumum: 20G

/image

S3 Bucket

fissaa storage s3 --help
USAGE:
    fissaa storage s3 [OPTIONS] <COMMAND>

OPTIONS:
    -h, --help    Prints help information

COMMANDS:
    init <bucket-name>

Domain Functionalities

Link a Domain to Route53

if you're using a custom domain registrar, run the following to create Route53 hosted zone then copy paste the name server into your domain registrar custom dns .

here is an example: https://www.namecheap.com/support/knowledgebase/article.aspx/767/10/how-to-change-dns-for-a-domain/

fissaa domain <domain-name> create 

Add TLS Certification

if you have a domain and want to add a TLS Certification to it, you can just run following command

Note: domain must be registered on Route53 as Hosted Zone

fissaa domain <domain-name> add-https 

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages