alanajs

A free, open source npm package that makes it easy to create and deploy Lambda functions, incorporate microservices in your application, and build on API gateway.

Usage no npm install needed!

<script type="module">
  import alanajs from 'https://cdn.skypack.dev/alanajs';
</script>

README

alanajs

AWS Lambda and API Gateway, simplified for JavaScript

Issues MIT License

About alanajs

Make setting up Lambda microservices easier than ever. alanajs is a free, open-source npm package that consolidates functionality provided by AWS SDK and AWS CLI, automating deployment and configuration tasks by making intelligent assumptions about the deployment sequence according to best practices. alanajs makes it easy to deploy Lambda functions with dependencies and layers, and it also simplifies creating routes, APIs, and integrations with Lambda on AWS API Gateway.

Here is a medium article describing the story behind alanajs.

You can also visit us here.

Table of Contents

Table of Contents
  1. About alanajs
  2. Getting Started
  3. Enhancement and Improvements
  4. Reporting Issues
  5. Contributors
  6. License

(back to top)

Getting Started

This section describes the instructions for end users who would like to download the package and connect their AWS account. For developers who would like to contribute to the open-source project, follow these instructions.

Installation and Setup

  1. Install alanajs as a package dependency.

    npm install alanajs
    
  2. Update the .env file in the project root directory with the necessary credentials OR see Step 3 to init through the command line.

    AWS_ACCESS_KEY_ID=
    AWS_SECRET_ACCESS_KEY=
    AWS_REGION=
    ROLENAME=
    S3BUCKETNAME=
    AWS_ACCOUNT=
    FOLDER=
    
  3. Run the follow through the command line to update .env file or create one if it does not exist. Replace the parameters with user's details. Refer to documentation for more details. The DIRECTORY is the main folder to store files, dependencies, and directories as Lambda functions and layers.

    alana init <AWS_ACCESS_KEY_ID> <AWS_SECRET_ACCESS_KEY> [AWS_ACCOUNT] [AWS_REGION] -r [ROLENAME] -b [S3BUCKETNAME] -d [DIRECTORY]
    
  4. Import the package to start using alana methods.

    import 'alana' from 'alanajs';
    
  5. That's it! You are ready to start running code through the command line or by running node [fileName] to execute the functions.

(back to top)

Figure 1: Create and Update Lambda Function


Figure 2: Create and Update Lambda Layers


Figure 3: Create, Update and Delete Alias


Figure 4: Create, Update and Delete API Gateway


Figure 5: Create, Update and Delete Routes


(back to top)

Enhancement and Improvements

This section describes the instructions for developers who would like to contribute to the open-source project. For users who would like to download the package and connect their AWS account, follow these instructions instead.

Built With

The alanajs application was built using the following:

  1. Fork the project.

  2. Create a feature branch.

    git checkout -b feature/featureName
    
  3. Install package dependencies.

    npm install
    
  4. Update the .env file in the project root directory with the necessary credentials OR init through the command line.

    AWS_ACCESS_KEY_ID=
    AWS_SECRET_ACCESS_KEY=
    AWS_REGION=
    ROLENAME=
    S3BUCKETNAME=
    AWS_ACCOUNT=
    FOLDER=
    
    alana init <AWS_ACCESS_KEY_ID> <AWS_SECRET_ACCESS_KEY> [AWS_ACCOUNT] [AWS_REGION] -r [ROLENAME] -b [S3BUCKETNAME] -d [DIRECTORY]
    
  5. Add and commit your changes.

    git add ...
    git commit -m 'Add some feature functionality'
    
  6. Push to the branch.

    git push origin feature/featureName
    
  7. Open a Pull Request here.

(back to top)

Reporting Issues

Bugs are tracked through GitHub issues. Create an issue on our repository and provide the following information based on this template:

  • Descriptive title: Provide a descriptive title for your issue.
  • Describe the issue: Describe the steps you took leading up to the issue. Try to provide code or screenshots.
  • Expected behavior: Describe the expected behavior.

(back to top)

Contributors

Project Links: Github | Linkedin | Medium | Visit Us

(back to top)

License

Distributed under the MIT License. See the LICENSE for details