robertosousa1 / lambda-without-framework

This is a simple example of how to make a lambda function available on AWS.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This is a simple example of how to make a lambda function available on AWS.

GitHub top language GitHub language count Codacy grade Repository size GitHub last commit Repository issues GitHub

Getting started   |    How to contribute   |    License

๐Ÿ†™ Getting started

  • Clone this repo

  • make create-policy to create a security role in aws

  • access logs/role.log and copied the policy arn generated in the arn variable in the Makefile file.

  • make upload-function to compress and upload the handler function in index.js for lambda aws
    Obs.: note that a record of the command return will be generated in logs/lambda-create.log.

  • make invoke-lambda to make a call to the lambda function
    Obs.: note that a record of the command return will be generated in logs/lambda-exec.log.

  • make update-function after making any changes, to compress and update the handler function in lambda aws
    Obs.: note that a record of the command return will be generated in logs/lambda-update.log.

  • make remove-lambda to remove the created lambda function

  • make remove-policy to remove the created policy

  • make clean to remove the logs and zipped function

General observations.:

  1. The lambda function created by default will use the name "test-cli", if you want to change, go to Makefile and change the name of the variable function_name.

  2. Make sure that you have installed the AWS CLI and configured your credentials for accessing your Amazon account. If you are unsure of how to do it, access the links below:
    Download AWS CLI
    How to configure AWS CLI

  3. The command used to zip the function in make upload-function and make update-function is a unix command, that is, it will only work on MacOS and Linux distributions, if using Windows it will need a small change.

โœ๏ธ How to contribute

  • Make a fork;
  • Create a branck with your feature: git checkout -b my-feature;
  • Commit changes: git commit -m 'feat: My new feature';
  • Make a push to your branch: git push origin my-feature.

After merging your receipt request to done, you can delete a branch from yours.

๐Ÿ“ License

This project is under the MIT license. See the LICENSE for more information.


Made with by Roberto Sousa ๐Ÿ‘‹ Get in touch!

About

This is a simple example of how to make a lambda function available on AWS.

License:MIT License


Languages

Language:Makefile 79.2%Language:JavaScript 20.8%