Giter Site home page Giter Site logo

emmy-github-webdev / ecs-cloudformation-fargat Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 11 KB

Deploys a Fargate cluster that is in a VPC with both public and private subnets. Containers can be deployed into either the public subnets or the private subnets.

cicd cloudformation ecs-cluster ecs-fargate ecs-task load-balancer

ecs-cloudformation-fargat's Introduction

Sample script to create the infrastructure and the serive

We can spin up the stacks using the AWS CLI with this Bash script:

` aws cloudformation create-stack
--stack-name reflectoring-network
--template-body file://network.yml
--capabilities CAPABILITY_IAM

aws cloudformation wait stack-create-complete --stack-name reflectoring-network

aws cloudformation create-stack
--stack-name reflectoring-service
--template-body file://service.yml
--parameters
ParameterKey=StackName,ParameterValue=reflectoring-network
ParameterKey=ServiceName,ParameterValue=reflectoring-hello-world
ParameterKey=ImageUrl,ParameterValue=docker.io/reflectoring/aws-hello-world:latest
ParameterKey=ContainerPort,ParameterValue=8080
ParameterKey=HealthCheckPath,ParameterValue=/hello
ParameterKey=HealthCheckIntervalSeconds,ParameterValue=90

aws cloudformation wait stack-create-complete --stack-name reflectoring-service

`

Updating a CloudFormation Stack

  1. AWS cloudformation ChangeSet: To create a changeset, we use the create-change-set command aws cloudformation create-change-set \ --change-set-name update-reflectoring-service \ --stack-name reflectoring-service \ --use-previous-template \ --parameters \ ParameterKey=ImageUrl,ParameterValue=docker.io/reflectoring/aws-hello-world:v4 \ ... more parameters After having created a changeset, we can review it in the AWS console or with this CLI command:

aws cloudformation describe-change-set \ --stack-name reflectoring-service \ --change-set-name update-reflectoring-service

When we’re happy with the changes, we can execute the changeset:

aws cloudformation execute-change-set \ --stack-name reflectoring-service \ --change-set-name update-reflectoring-service

Other options of updating cloudformation stack

  1. Updating the Service Stack

` aws cloudformation update-stack
--stack-name reflectoring-service
--use-previous-template
--parameters
ParameterKey=ImageUrl,ParameterValue=docker.io/reflectoring/aws-hello-world:v3
... more parameters

aws cloudformation wait stack-update-complete --stack-name reflectoring-service `

  1. Delete and Re-create a Granular Stack
  2. Update the ECS Service via the API

Thanks to Tom Hombergs

ecs-cloudformation-fargat's People

Contributors

emmy-github-webdev 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.