Giter Site home page Giter Site logo

aws-microservice-data-fetcher's Introduction

Weather data fetcher

weather_monitor drawio

This repo is the "data fetcher" part of the weather monitor. It is comprised of a Lambda function and EventBridge. The Lambda function pulls weather data from api.openweathermap.org and sends the retrieved data to EventBridge.

Deploying to multi-accounts on AWS

The lambda function is developed and tested on local machine. Once commited to GitHub, GitHub actions will deploy to AWS using SAM. SAM will also create an EventBridge schedule and necessary IAM role to trigger Lambda periodically.

SAM will push to multiple AWS accounts using assume role. Screen Shot 2023-09-03 at 5 41 12 pm

For Tools Account to be able to assume role, the IAM role needs to give permission to Tools Account. Screen Shot 2023-09-03 at 5 43 15 pm

I also created two environments on GitHub to store credentials. So when SAM deploys, it will grab necessary credentials depending on which environment it is in. Screen Shot 2023-09-03 at 6 05 59 pm

.github/workflows/production.yml

Specifying prod environment, GitHub actions will pull credentials from prod. Screen Shot 2023-09-03 at 6 08 56 pm

.github/workflows/staging.yml

Specifying staging environment, GitHub actions will pull credentials from staging. Screen Shot 2023-09-03 at 6 09 44 pm

Next SAM will assume role to deploy to prod and staging. Screen Shot 2023-09-03 at 6 14 56 pm

SAM template

template.yaml

Let's go through the important part in SAM template.

This part creates a Lambda function and gives it permission to push events to EventBridge. Screen Shot 2023-09-03 at 6 19 20 pm

This part creates an EventBridge scheduler and gives it necessary permission to invoke Lambda. Screen Shot 2023-09-03 at 6 21 40 pm

aws-microservice-data-fetcher's People

Contributors

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