Skip to main content

###Requirements

  • Python 3.6
  • Pip

Install Dependencies

  • pipenv
pip install pipenv
  • awscli
pip install awscli

Install aws-lambda-api-builder

Install from pip:

pip install aws-lambda-api-builder

Install from Github

git clone https://github.com/zmiler91/aws-lambda-api-builder
cd aws-lambda-api-builder
pipenv install
python setup.py sdist bdist_wheel
pipenv install -e .

If you've installed aws-lambda-api-builder from Github then you will need to use pipenv shell in order for your zlab to be recognized.

pipenv shell
zlab --help

> usage: api_builder [sub-command] [options]
> 
> This is a CLI to build, package, and release AWS APIs using API Gateway and
> Lambda.
> 
> positional arguments:
>  {lambda}
> 
> optional arguments:
>   -h, --help

Setup

Since aws-lambda-api builder uses boto3 to interact with AWS, you will need to install and configure the AWS CLI. If you have not already installed the AWS CLI, please refer to the "Install Dependencies" section of this README.

Creating an S3 bucket

aws-lambda-api-builder will upload a zipped archive of your application to S3 so it can be used in your Lambda functions. You can use the AWS console to create an S3 bucket; for the purposes of this README I've created a bucket called my-example-api.

Creating an IAM Policy

We will be creating an IAM User for aws-lambda-api-builder in the next section, but before we do so we will need to create an IAM Policy so we can limit the user's permissions and only allow them to read out of the bucket created in the previous section.

You can create this policy using the Visual Editor or you can copy the JSON document below replacing my-example-api with the name of your S3 bucket:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": "s3:PutObject",
            "Resource": [
                "arn:aws:s3:::my-example-api/*"
            ]
        }
    ]
}

Once you've defined your policy you will need to give your policy a name, for the purposes of this README I've name my policy aws-lambda-api-builder-s3. You can also give your policy an optional description. If you want to grant access to multiple buckets, then you just need to add the bucket to the Resource array in the policy document.

Creating an IAM User

aws-lambda-api-builder needs access to some resources in your AWS account so it can upload S3 files that contain your zipped archive. To do this, you'll want to create an IAM user in the AWS console.

User name: aws-api-lambda-builder
Access type: Programmatic access

After you've defined the name and access type, you will be asked to set a permission. You can use the "Attach existing policies directly" option and find and select the policy created in the previous section.

Once the user has been created you will be provided an "Access key ID" and a "Secret access key", you will want to remember both of these. Your credentials will only be provided to you once, so you will not be able to recover them if you do not write them down.

Configure AWS

Once you've created your IAM user you will need to configure the AWS CLI.

aws configure
> AWS Access Key ID [None]: {access key from the previous section}
> AWS Secret Access Key [None]: {secret access key from the previous section}
> Default region name [None]: {the aws region you're using, mine is us-east-1}
> Default output format [None]:

Your configuration and access keys will be saved to the .aws directory in your home directory. If you've already configured your AWS CLI with another user, then you can attach the IAM Policy created in the previous section to this user.

Development Environment

Integrate the pipenv environment by following the instructions here: https://www.jetbrains.com/help/pycharm/pipenv.html

Usage Examples

$ zlab lambda --help

Metadata

Release files for aws-lambda-api-builder 0.0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aws-lambda-api-builder 0.0.8
File Size Uploaded Provenance
aws-lambda-api-builder-0.0.8.tar.gz 8.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for aws-lambda-api-builder 0.0.8
File Interpreter ABI Platform
aws_lambda_api_builder-0.0.8-py3-none-any.whl Python 3 none any Details

Total release size: 20.1 kB

Release files / aws-lambda-api-builder-0.0.8.tar.gz

Download URL aws-lambda-api-builder-0.0.8.tar.gz
Size 8.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c5f274daf1dd91bdeb99c5ed831c3ed6502fb958345334ca043655ee8276c153
BLAKE2b-256 checksum
How to use checksums
9e14a0f9393b59dee2e2bf1914403ea7afc63747284b94d50b61a443dfbe8ff1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.6

Release files / aws_lambda_api_builder-0.0.8-py3-none-any.whl

Download URL aws_lambda_api_builder-0.0.8-py3-none-any.whl
Size 11.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
797eafb210677e3cafbba5772a44df2d0b087642b9e67d3b618f117055ebee86
BLAKE2b-256 checksum
How to use checksums
bc5f7f0bd6773923e07483dd94b5907842fa56d577b59c2fa3eed6cc2af24ac4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.6

Security for aws-lambda-api-builder 0.0.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page