Giter Site home page Giter Site logo

amazon-eks-saga-choreography-audit's Introduction

Introduction

This project implements the Audit microservice that participates in the saga pattern with Amazon Elastic Kubernetes Service (EKS).

Usage

Build

  1. Clone the repo.
git clone ${GIT_URL}/eks-saga-audit

Skip this step, if instructions to build images were followed in the eks-saga-aws repository. Else, follow the steps below to build and push the image to Amazon ECR.

  1. Build the Docker image and push to Docker repository.
cd eks-saga-audit/src

aws ecr get-login-password --region ${REGION_ID} | docker login --username AWS --password-stdin ${ACCOUNT_ID}.dkr.ecr.${REGION_ID}.amazonaws.com
IMAGE_URI=${ACCOUNT_ID}.dkr.ecr.${REGION_ID}.amazonaws.com/eks-saga/audit
docker build -t ${IMAGE_URI}:0.0.0 . && docker push ${IMAGE_URI}:0.0.0

Deploy

  1. Create ConfigMap running the command below from the yaml folder. Change Asia/Kolkata to appropriate timezone value in the sed command below. Then, run the following commands to create the ConfigMap.
cd eks-saga-audit/yaml
RDS_DB_ID=eks-saga-db
DB_ENDPOINT=`aws rds describe-db-instances --db-instance-identifier ${RDS_DB_ID} --query 'DBInstances[0].Endpoint.Address' --output text`
sed -e 's#timeZone#Asia/Kolkata#g' \
  -e 's/regionId/'"${REGION_ID}"'/g' \
  -e 's/accountId/'"${ACCOUNT_ID}"'/g' \
  -e 's/dbEndpoint/'"${DB_ENDPOINT}"'/g' \
  cfgmap.yaml | kubectl -n eks-saga create -f -
  1. Run the following command to deploy Audit microservice.
sed -e 's/regionId/'"${REGION_ID}"'/g' \
  -e 's/accountId/'"${ACCOUNT_ID}"'/g' \
  audit.yaml | kubectl -n eks-saga create -f -

Clean up

To remove objects of Audit microservice, run this command.

kubectl -n eks-saga delete delete deployment/eks-saga-audit configmap/eks-saga-audit

Inputs and outputs

The audit microservice subscribes to the following AWS SQS queue.

Topic Message
eks-saga-audit Subscribed to the success and failure topics of Order and Inventory topics.

amazon-eks-saga-choreography-audit's People

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.