Skip to content

Commit

Permalink
Merge pull request #16 from LeadingEDJE/task/12-package-lambda
Browse files Browse the repository at this point in the history
#12 - Add build-lambda functionality using aws-lambda-builders
  • Loading branch information
andrewdmay committed Jul 7, 2020
2 parents 2e6f9e1 + 37b4bf4 commit e289c1b
Show file tree
Hide file tree
Showing 30 changed files with 1,591 additions and 25 deletions.
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ pyyaml = "*"
tabulate = "*"
click = "*"
jinja2 = "*"
aws-lambda-builders = "*"

[requires]
python_version = "3"
30 changes: 23 additions & 7 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 25 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ Utility to manage CloudFormation stacks based upon a Template (either local or i
Uses ChangeSets to create or update CloudFormation stacks, allowing the ChangeSets to either be automatically
applied or applied later (e.g. during a later phase of a build pipeline after review of the ChangeSet).

> There are also some utility methods for building a lambda file zip and uploading files to S3.
> These are to provide some of the AWS SAM CLI functionality while fitting into the workflow and configuration
> style of stackmanager.
## Configuration

The configuration file can either be a single YAML document containing the configuration for a stack
Expand Down Expand Up @@ -100,6 +104,7 @@ Stackmanager has the following commands:
* `apply` - Apply a previously created ChangeSet
* `delete` - Delete an existing CloudFormation stack
* `upload` - Uploads a local file to S3. Utility method to prevent the need to use the AWS CLI or other tools.
* `build-lambda` - Build a Lambda zip file using aws-lambda-builders.

### deploy

Expand All @@ -109,16 +114,12 @@ Usage: stackmanager deploy [OPTIONS]
Create or update a CloudFormation stack using ChangeSets.

Options:
-p, --profile TEXT AWS Profile, will use default or environment
variables if not specified

-p, --profile TEXT AWS Profile, will use default or environment variables if not specified
-c, --config TEXT YAML Configuration file [required]
-e, --environment TEXT Environment to deploy [required]
-r, --region TEXT AWS Region to deploy [required]
-t, --template TEXT Override template
--parameter TEXT... Override a parameter, can be specified multiple
times

--parameter TEXT... Override a parameter, can be specified multiple times
--change-set-name TEXT Custom ChangeSet name
--auto-apply Automatically apply created ChangeSet
--help Show this message and exit.
Expand All @@ -133,9 +134,7 @@ Usage: stackmanager apply [OPTIONS]
stack.

Options:
-p, --profile TEXT AWS Profile, will use default or environment
variables if not specified

-p, --profile TEXT AWS Profile, will use default or environment variables if not specified
-c, --config TEXT YAML Configuration file [required]
-e, --environment TEXT Environment to deploy [required]
-r, --region TEXT AWS Region to deploy [required]
Expand All @@ -151,9 +150,7 @@ Usage: stackmanager delete [OPTIONS]
Delete a CloudFormation stack.

Options:
-p, --profile TEXT AWS Profile, will use default or environment
variables if not specified

-p, --profile TEXT AWS Profile, will use default or environment variables if not specified
-c, --config TEXT YAML Configuration file [required]
-e, --environment TEXT Environment to deploy [required]
-r, --region TEXT AWS Region to deploy [required]
Expand All @@ -170,16 +167,29 @@ Usage: stackmanager upload [OPTIONS]
Lambda zip file

Options:
-p, --profile TEXT AWS Profile, will use default or environment variables
if not specified

-p, --profile TEXT AWS Profile, will use default or environment variables if not specified
-r, --region TEXT AWS Region to upload to [required]
-f, --filename TEXT File to upload [required]
-b, --bucket TEXT Bucket to upload to [required]
-k, --key TEXT Key to upload to [required]
--help Show this message and exit.
```
### Build Lambda
```
Usage: stackmanager build-lambda [OPTIONS]

Build a Lambda function zip file.

Options:
-s, --source-dir TEXT Source directory [required]
-o, --output-dir TEXT Output directory [required]
--runtime TEXT Lambda Runtime [required]
--archive-name TEXT Override archive name (defaults to source directory name)
--help Show this message and exit.
```
## CI/CD Pipeline support
### Azure DevOps
Expand Down
5 changes: 5 additions & 0 deletions integration/functions/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Functions

Hello World Lambda functions generated using `sam init` to test `stackmanager build-lambda`.

Only the main source code and manifest (e.g. `requirements.txt`, `packages.json`) have been retained.
Loading

0 comments on commit e289c1b

Please sign in to comment.