Skip to content

An full example of setting up the infrastructure and project for a Serverless function that connects to RDS and the internet.

Notifications You must be signed in to change notification settings

metapep/serverless-rds-aws-structure

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

An full example of setting up the infrastructure and project for a Serverless function that connects to RDS and the internet.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HCL 77.4%
  • JavaScript 19.2%
  • Smarty 1.9%
  • Shell 1.5%