Demonstrates infrastructure for building, running and deploying a simple API in AWS using GNU Make and the AWS CDK.
- Provision local resources using localstack.
make local
- Run the API locally.
make local-api
- In another window, run the smoke tests against your local API.
make local-smoke
- Tear down the local resources.
make local-destroy
Environment variable configuration is managed using .env
files in the root of the repository. As these are parsed using make
, standard Makefile substitution syntax can be used to compose variables.
Each individual environment is managed using a file named .env.(name)
, e.g. .env.dev
for the dev
environment.
The top-level .env
file (without a suffix) provides default values that will be used in all environments. These can be overridden for a specific environment using that environments .env.(name)
file.
All Makefile variables are exported automatically and available to child processes (e.g. the CDK).
AWS resource tags can be supplied using the tags/tags.env
file. Any make
variables in the file will be resolved automatically and the tags will be applied to each stack, propagating down to individual resources where possible.
- Update the
HOSTED_ZONE_NAME
value in the default environment file (.env
) with a Route 53 hosted zone configured in your account.
HOSTED_ZONE_NAME=mydomain.example.com
- Run the default target to lint, test, build, deploy and run smoke tests.
make
- Tear down the deployed resources.
make destroy
Print all available commands.
make help