Code Monkey home page Code Monkey logo

aws-lambda-demo's Introduction

Deploy AWS Lambda functions with Razorops CI/CD

If you have forked this repo, then connect with Razorops to create your demo pipeline by following the below button

Connect

This is an example code to demonstrate how to deploy serverless functions on AWS lambda using pipeline on Razorops.

It contains simple functions written in Python runtime and includes steps to deploy on AWS lambda service.

Automating deployment

We've provided two functions defined in (python-1)[./python-1] and (python-2)[./python-2] directories based on Python runtime supported by Lambda service and automation to deploy them based on AWS.

Creating AWS credentials for deployment

Before deploying your changes via CI/CD pipeline, you need to create AWS credentials to enable access from the pipeline. You will most likely have a IAM user having the following policy linked to you lambda functions -

lambda:GetFunctionConfiguration
lambda:UpdateFunctionConfiguration
lambda:UpdateFunctionCode
lambda:PublishVersion

We have included terraform script to help you create a IAM role that can be used for deployment in pipeline.

After creating the IAM user, you can set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY in pipeline's variables in the dashboard.

Commit code

You can now simply change your code and commit to your main/master branch to trigger the deployment process. It would detect the folders in which you've made the changes and only deploy them if code for a function is changed.

git commit -a -m <mesage>
git push

CI/CD pipeline

If you're new to Razorops, feel free to fork this repository and use it to create a project.

.razorops.yaml contains the pipeline code to build and execute the tests for this project. To know more about how to write and customize, refer to the documentation. Here is the link of the pipeline workflows page.

License

Copyright (c) 2024 Razorops LLC

Distributed under the MIT License. See the file LICENSE.md.

aws-lambda-demo's People

Contributors

kshyam avatar dsyoi 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.