Giter VIP home page Giter VIP logo

tree-schema-ecs-example's Introduction

tree-schema-ecs-example

This repo contains the code, templates and other development resources that along with the Tree Schema articles for creating a complete ECS deployment

Note - to run these commands you will need to have the AWS SAM CLI installed.

Article 1 - VPC deployment

In the first article the following VPC is deployed, which generally contains the following resources:

VPC Resources

The VPC can be deployed by running this command from the root directory (change my-vpc to the name of the stack you would like):

sam deploy \
--template templates/vpc-template.yaml \
--stack-name my-vpc \
--capabilities CAPABILITY_AUTO_EXPAND

Article 2 - ECS Cluster, CloudFront Distribution & S3 Buckets

In the second article the following CloudFormation, ECS resources are deployed in line with the following deployment:

ECS Deployment Resources

The ECS resources, including the ECS cluster, required roles, CloudFront distribution, and S3 buckets can be deployed by running this command from the root directory (change my-cluster-resources to the name of the stack you would like and your-user-id to your user's user ID):

sam deploy \
--template templates/ecs-cluster-template.yaml \
--stack-name my-cluster-resources \
--capabilities CAPABILITY_AUTO_EXPAND CAPABILITY_NAMED_IAM \
--parameter-overrides "ParameterKey=YourUserId,ParameterValue=your-user-id"

Article 3 - Creating the Django & Celery Application

In the third article the Django & Celery app are created.

The application can be found under the app directory and generally has the following general flow:

ECS Deployment Resources

This repo can be cloned and the app can be run locally. Redis must be running locally on port 6379. Execute the following command in the app directory to start Django:

python manage.py runserver 0.0.0.0:8000

And in a second terminal, but the same directory, run the following to start Celery:

celery -A ecs_example worker -l info 

Article 4 - Deploying the App to ECS

In the fourth article the app is deployed to ECS.

Assuming that you have been following along with the other walkthroughs, you will only need to update a few parameters in the mapping section of the template. The template can be found here:

./templates/django-app.yaml

The containers can be built with the following command from this directory:

sh build.sh

And can be deployed with

sam deploy -t templates/django-app.yaml \
--stack-name django-ecs-app \
--capabilities CAPABILITY_IAM  

Article 5 - Getting Ready for Prod

In the fifth and final article the finishing touches are put in place to use the app in production. Emails are sent with SES, autoscaling is put in place and Route53 sends traffic from our domain to the app.

With the new updates, the containers will need to be rebuilt with the following command from this directory:

sh build.sh

And the services will need to be updated / redeployed with the same command.

sam deploy -t templates/django-app.yaml \
--stack-name django-ecs-app \
--capabilities CAPABILITY_IAM  

tree-schema-ecs-example's People

Contributors

sewardgw-cf avatar sewardgw avatar christianmarzahl avatar

Watchers

James Cloos avatar

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.