Code Monkey home page Code Monkey logo

nodejs-typescript-fargate-starter's Introduction

nodejs-typescript-fargate-starter

This repo deploys a dockerized nodejs app using cdk.

It uses ECS fargate and deploys 2 environments - one prod and one staging.

It also sets up a pipeline with a codedeploy job to deploy code to ECR and then trigger a new ECS deployment.

Promotion to prod is manual but you can change that in the pipeline.ts file.

If you change the underlying image and want to trigger manual deployment

aws ecs update-service --cluster MyApp-Infrastructure-MyAppclusterstagingClusterstagingDDA3CFDA-7wINQdbGlXCQ --service MyApp-Infrastructure-MyAppclusterstagingServicestagingService12E2202D-o7iUxNS5nN0D --force-new-deployment --region us-east-2

This will deploy the original image of your nodejs app, whatever you created the ecs cluster with, if you didn't do it with swolebrain/node-web-app:latest

If you left that unchanged, then the above command will wipe out your application and replace it with my hello world app

Setup

  1. Follow the steps to get started with cdk (installing pre-requisites and boostrapping). You should probably read this whole thing.
  2. Fork this repo into your github account
  3. Create a connection from AWS CodeStar to Github or BitBucket (I haven't tested Bitbucket) following (these instructions)[https://docs.aws.amazon.com/dtconsole/latest/userguide/connections-create.html].
  4. Decide on a name for your app. Let's say you decide to call it KratosService. Put that name in cdk/configuration.ts
  5. Choose a region for your service. Choose whatever's closest to you or your customers.
  6. Create a hosted zone in route 53 for your domain name.
  7. Take the nameservers from your hosted zone in route53 and go to your domain registrar and override your registrar's nameservers with the ones from route 53. This makes AWS the start of authority over your domain.
  8. Go to cdk/configuration.ts and update whatever you need to update in there. You have to at least update ACCOUNT_ID, HOSTED_ZONE_ID and HOSTED_ZONE_NAME. You should consider updating APP_NAME too, and if you didn't end up using us-east-2 then you need to update RESOURCE_DEPLOYMENT_REGION.
  9. Run cdk deploy
  10. ????????
  11. Profit

nodejs-typescript-fargate-starter's People

Contributors

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