{"id":21010592,"url":"https://github.com/geoffdutton/serverless-rds-aws-structure","last_synced_at":"2025-09-06T02:39:17.116Z","repository":{"id":56574460,"uuid":"308460434","full_name":"geoffdutton/serverless-rds-aws-structure","owner":"geoffdutton","description":"An full example of setting up the infrastructure and project for a Serverless function that connects to RDS and the internet.","archived":false,"fork":false,"pushed_at":"2020-10-30T22:37:36.000Z","size":104,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-15T02:37:20.770Z","etag":null,"topics":["lambda","rds","serverless","terraform"],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/geoffdutton.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-29T22:04:21.000Z","updated_at":"2023-10-25T02:12:17.000Z","dependencies_parsed_at":"2022-08-15T21:10:49.835Z","dependency_job_id":null,"html_url":"https://github.com/geoffdutton/serverless-rds-aws-structure","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/geoffdutton/serverless-rds-aws-structure","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geoffdutton%2Fserverless-rds-aws-structure","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geoffdutton%2Fserverless-rds-aws-structure/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geoffdutton%2Fserverless-rds-aws-structure/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geoffdutton%2Fserverless-rds-aws-structure/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/geoffdutton","download_url":"https://codeload.github.com/geoffdutton/serverless-rds-aws-structure/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geoffdutton%2Fserverless-rds-aws-structure/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273849899,"owners_count":25179243,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-06T02:00:13.247Z","response_time":2576,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lambda","rds","serverless","terraform"],"created_at":"2024-11-19T09:21:34.328Z","updated_at":"2025-09-06T02:39:17.060Z","avatar_url":"https://github.com/geoffdutton.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Serverless RDS with Lambda\n\nThis 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\n\n## Perquisites\n\n- AWS name profile set up: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html\n- Terraform v0.13.x installed globally (I used [tfenv](https://github.com/tfutils/tfenv))\n- Serverless v2.x globally installed: `npm i -g serverless`\n\n## Deploying\n\nFirst, deploy the infrastructure, which will write files need by `serverless.yml`. In the `terraform` directory run:\n\n```bash\n$ terraform init\n$ terraform apply -var=\"stage=dev\"\n```\n\nThen in the root of the project, deploy serverless by running:\n\n```bash\n$ npm run deploy\n```\n\nFinally, test it by running:\n\n```bash\n$ npm test\n```\n\n## Destroying\n\nOrder 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:\n\n```bash\n$ npm run destroy\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeoffdutton%2Fserverless-rds-aws-structure","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeoffdutton%2Fserverless-rds-aws-structure","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeoffdutton%2Fserverless-rds-aws-structure/lists"}