Giter Site home page Giter Site logo

visini / terragrunt-github-actions-aws-ecs Goto Github PK

View Code? Open in Web Editor NEW
52.0 2.0 11.0 35 KB

Adopt Terraform to auto-provision infrastructure, and GitHub Flow to continuously test and deploy code – See full article

Home Page: https://camillovisini.com/coding/terragrunt-github-actions-aws-ecs

Makefile 6.14% Dockerfile 2.62% Python 3.65% JavaScript 3.51% Shell 10.77% HCL 73.31%
aws-ecs terragrunt terraform terraform-module github-actions

terragrunt-github-actions-aws-ecs's Introduction

terragrunt-github-actions-aws-ecs

This project leverages Terragrunt, Terraform, and GitHub Actions to deploy a basic web app (dockerized JS frontend and dockerized Python API) to AWS ECS.

See this article for more information: https://camillovisini.com/article/terragrunt-github-actions-aws-ecs/

GitHub Secrets

Ensure the following secrets are provided in the repository settings:

AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
AWS_REGION

Makefile Targets

~/terragrunt-ecs$ make

Usage:
  make

Development
  dev              Run docker-compose
  git-hooks        Set git hooks path to ./hooks

Manual Terragrunt Operations
  init             Run terragrunt init
  apply            Run terragrunt apply
  destroy          Run terragrunt destroy
  push-images      Build and push images to ECR

Helpers
  help             Display this help

Workflow

Development

# make git-hooks
make dev

Initialization

make init
make push-images

Subsequent push to branch will trigger deployment via GitHub Actions:

  • Branch dev will deploy to stage environment
  • Branch main will deploy to prod environment

Manual apply / destroy

Besides GitHub Actions, deployments can be managed manually. Configure additional Makefile targets to manually manage deployments as your application scales across environments, regions, accounts, or includes additional services or data providers. For this repository, common targets are listed below.

Change infrastructure:

# after changes in ./terraform/*
make apply

Change codebase and deploy to infrastructure:

# after changes in ./containers/*
make push-images
make apply

Destroy infrastructure:

# after infrastructure is no longer required
make destroy

terragrunt-github-actions-aws-ecs's People

Contributors

visini avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.