Skip to content

hwslabs/bar-service-infrastructure

Repository files navigation

Bar Service Infrastructure

Overview

Bar Service Infrastructure using AWS and CDK. For details, see the project on github.

AWS CDK Infrastructure package that creates:

  1. An ECS cluster in a multi-AZ VPC
  2. An application load balanced Fargate web-service that runs on the above ECS Cluster
  3. A CodeBuild spec that builds the web-service sources from Github and pushes to ECR repo
  4. A CodePipeline pipeline with stages to build and deploy changes to the web-service

File organization

The infra sources are organized into the following files:

Set up and deploy the resources from macOS

  • Install Homebrew

    Download and install Homebrew:

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  • Install nvm

    Install latest version of nvm:

    brew install nvm
  • Install any version of Node

    Install latest version of node:

    nvm install node

    or any specific version of node:

    nvm install 14.17.6
  • Install CDK

    Follow the instructions from AWS CDK Getting Started to configure your AWS account and install CDK

  • Run a clean build

    Run a custom clean build command (installing dependencies is handled part of the command)

    npm run clean-build
  • Deploy ECR Repo

    Deploy ECR repo to hold the containers for Bar Service Server

    cdk deploy repo
  • Deploy Bar Server

    Note: Between the above step and this step, a valid server container image should be pushed to the ECR repository that was deployed above. Otherwise, there would be nothing to deploy on ECS.

    Deploy the bar service server to an ECS cluster Fargate Service backed by an Application Load Balancer.

    cdk deploy service

About

AWS CDK Infrastructure to deploy the bar service server

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published