GithubHelp home page GithubHelp logo

fargate-skeleton's Introduction

fargate-skeleton

Fargateなwebアプリの環境のサンドボックスを作るためのスケルトン構成です

  • ECS(Fargate)サービスおよびALBに必要なリソース一式を構築するためのterraformファイル
  • コンテナデプロイのためのecspresso設定
  • サンプル用のミニマルなDockerイメージ

が含まれます。ECSまわりでちょっと実験をしたいけど、既存環境を使うのはちょっと...というときに新規お砂場をサクッと作ります。

使い方

AWSインフラ

infraディレクトリでterraform applyする。

下記terraform variableが必要。環境変数で入れる※

  • TF_VAR_name 環境の名前。これをユニークにすると、同一AWSアカウント内に複数環境つくれる
  • TF_VAR_use_alb 1にするとALB(とALBリスナー)が生成される。地味に費用が発生するので、デフォルトではOFF

※TF_VAR_nameはecspressoでも参照するため、環境変数で渡すようにしている

appコンテナ

appディレクトリでdocker buildし、terraformで生成されたECRリポジトリにpushしておく

ecspresso

ecspressoディレクトリでecspresso deployしたりする

片付け

全リソースを消す場合

  • terraform管理でないリソースを消す
    • ECSサービス(ecspresso deleteで消せる。これを消さないとECS Clusterが消せない)
    • ECRリポジトリに登録された全イメージ(手動で消す。これを消さないとリポジトリが消せない)
    • ECSタスク定義(消さなくても問題はない)
  • terraform destroyでterraform配下のリソースを消す

一時的に料金発生を止める

次の週末にまた遊ぶ場合など、全ては消さずに料金だけ抑えたいとき

  • TF_VAR_use_albを指定せずにapplyする(ALBが消える)
  • ecspresso scale --tasks=0でコンテナを止める

fargate-skeleton's People

Contributors

cumet04 avatar

Watchers

 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.