Skip to content

Latest commit

 

History

History
38 lines (25 loc) · 1.09 KB

README.md

File metadata and controls

38 lines (25 loc) · 1.09 KB

Serverless RDS with Lambda

This is the project repo for the blog post found here: https://fakeweblog.com/how-to-use-terraform-with-serverless-for-lambda-rds-and-internet-access-ba38b8a3579a

Perquisites

Deploying

First, deploy the infrastructure, which will write files need by serverless.yml. In the terraform directory run:

$ terraform init
$ terraform apply -var="stage=dev"

Then in the root of the project, deploy serverless by running:

$ npm run deploy

Finally, test it by running:

$ npm test

Destroying

Order is important because if you destroy the terraform infrastructure before serverless, it'll get stuck since the Security Groups and Subnet IDs are used by serverless. To make sure it's run in the correct order, in the root directory of the project, run:

$ npm run destroy