Example code for
Assumes:
- General understanding of how to build and run AWS SAM applications
Prerequisites:
- Python 3.7
pip3
(orpip
aliased topip3
)make
aws-cli
Tested on:
- Linux
- MacOS
- Install dependencies:
make install-dependencies
-
Note:
- Depending on your local setup you might want to change
pip3
topip
. This makefile assumes the Python3 version. - Running
make install-dependencies
is a one-off task, feel free to install the required Python packages with your preferred tool)
- Depending on your local setup you might want to change
-
Change into
pipenv
-shell:
pipenv shell
- Configure AWS profile:
export AWS_PROFILE=[your profile name]
(or use the default profile if configured)
- Create artifact bucket:
- Edit
ARTIFACT_BUCKET
inMakefile
to become globally unique - E.g.
default-sg-remediation-artifacts-[your account id]
- Edit
make create-artifact-bucket
make deploy
- Change egress or ingress on the default security group
- Lambda gets invoked
- egress/ingress get revoked
- security group gets tagged