/aws-lambda-vagrant-ansible

Environment to allow for easy deployment of python 3.6 lambda functions to AWS via Ansible

Primary LanguageShellMIT LicenseMIT

Welcome

This will (hopefully) make it easy to deploy a python 3.6 lambda to AWS.

Initial Setup

# build
vagrant up

# move into machine
vagrant ssh

# set up ssh
ssh-keygen -t rsa -b 2048

# set up ansible
ansible-playbook /vagrant/playbooks/ssh-addkey.yml --ask-pass

AWS

Credentials

You need to specify a region as well

file: .aws/credentials

[default]
aws_access_key_id=
aws_secret_access_key=
region=

Lambda

You will need to edit:

  1. LAMBDA_ARN here
  2. name here
  3. description here

Installing packages

When deploying,AWS-Lambda requires that all packages are in the same dir as the .py files.

pip3 install package -t /home/vagrant/app/ 

Deploy

Calls an ansible playbook to zip and send up to aws

deploy