Set up and tear down these resources in AWS via Terraform:
- DynamoDB tables
- Lambda functions
- API Gateways
- IAM roles and policies
After creating all the resources you end up with these endpoints:
/login
POST
takes your password and returns a JSON Web Token
/feeds
GET
gets all feedsPUT
upserts a feedDELETE
deletes a feed
/entries?url=[FEED_URL]
GET
gets a feed's entries
/last-access
PUT
upserts a timestamp of the last time the application was accessed
See lambda function handler code for the exact interfaces.
Assumes a Unix-like system (e.g. Linux, macOS) with make and zip installed.
- Terraform CLI
- Terraform Cloud account
- AWS account with access keys created
- Change the Terraform Cloud organization in
main.tf
to yours (this value is not possible to declare as a variable) terraform login
- Generate a password to use for authenticating client requests in the application
- Create a
terraform.tfvars
file from theterraform-example.tfvars
file - Add your generated password and AWS access keys to the
terraform.tfvars
file make init
make create
to create the resource creation plan and apply itmake delete
to create the resource deletion plan and apply it
All resources have generous limits within the AWS Free Tier.
In most cases it costs nothing to run this infrastructure.
Use your own discretion when evaluating costs. It goes without saying, but I am not responsible for any unintended costs incurred by your use of these templates.
- Terraform always updates the lambda functions despite the hash of the output files not changing. It's a known issue that's not worth fixing at this scale.
- Terraform sometimes throws a concurrent modification error when creating routes. It looks like this:
Error: creating API Gateway v2 route: ConflictException: Unable to complete operation due to concurrent modification. Please try again later
. Re-runmake create
and the routes not created from the last run will be created. This only happens when all routes are created at once so it doesn't happen enough to make it worth fixing. - Terraform sometimes doesn't pick up certain changes when diffing, such as DyanmoDB attributes. Run
make destroy
andmake create
to have them applied. This will erase all database items, so beware. Also doesn't happen enough to make it worth fixing.