This URL hosts a Git repository (ie. git clone https://steady.supply/git/λ-demo
will work). For your convenience,
the file README.md
from this repository is rendered below.
aws/env
file containing AWS IAM and MFA ARNs (example in aws/env-example
).Offers a CLI for calling Pythong modules that deploy AWS CloudFormation templates and package/publish artifacts for AWS Lambda functions.
Establish the prerequisites mentioned above and run make -C aws guest
in the
repo root to spin up the container (see aws/Dockerfile
). Give an OTP and you’ll
be dumped onto an Amazon-authenticated shell in the container. From there you
can call the publish
and deploy
commands.
From the guest, call eg.
# publish version-tracker v0.0.42
Update aws/yaml/parameters.yml
with the version mentioned above (this is the
part that will be taken care of by the version tracker service/macro for other
packages). From the guest again, call eg.
# deploy version-tracker test
The test
argument is the stage, not currently used.
An OTP is requested on the host (see aws/scripts/developer/aws-sts-assume-role
)
for the MFA device specified in aws/env
. Still on the host, an IAM session is
created for the IAM role specified in aws/env
. This session is passed to the
guest (see aws/Makefile
) via an environment variable. The guest is a Docker
container that holds required packages and Python libraries for interacting
with AWS along with gubbins for using the session it is passed.
On the guest, there are entrypoint scripts (see scripts/bin
) which invoke
Click commands, which in turn call
Python modules (see aws/script/function
) to carry out the work. The pattern is
designed so these Python modules can be reused, eg. for more specialised
entrypoints.