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:
/loginPOSTtakes your password and returns a JSON Web Token
/feedsGETgets all feedsPUTupserts a feedDELETEdeletes a feed
/entries?url=[FEED_URL]GETgets a feed's entries
/last-accessPUTupserts 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.tfto 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.tfvarsfile from theterraform-example.tfvarsfile - Add your generated password and AWS access keys to the
terraform.tfvarsfile make init
make createto create the resource creation plan and apply itmake deleteto 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 createand 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 destroyandmake createto have them applied. This will erase all database items, so beware. Also doesn't happen enough to make it worth fixing.