{"id":15775497,"url":"https://github.com/felipelaptrin/serverless-infra","last_synced_at":"2026-05-10T16:03:32.274Z","repository":{"id":211492637,"uuid":"698794972","full_name":"felipelaptrin/serverless-infra","owner":"felipelaptrin","description":"A serverless infrastructure to deploy a static website and serverless API using AWS","archived":false,"fork":false,"pushed_at":"2023-12-08T21:44:23.000Z","size":499,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-11T17:04:54.082Z","etag":null,"topics":["api-gateway","aws","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/felipelaptrin.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,"governance":null}},"created_at":"2023-10-01T01:52:32.000Z","updated_at":"2024-02-27T13:57:59.000Z","dependencies_parsed_at":"2023-12-08T22:42:47.625Z","dependency_job_id":null,"html_url":"https://github.com/felipelaptrin/serverless-infra","commit_stats":null,"previous_names":["felipelaptrin/serverless-infra"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felipelaptrin%2Fserverless-infra","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felipelaptrin%2Fserverless-infra/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felipelaptrin%2Fserverless-infra/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felipelaptrin%2Fserverless-infra/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/felipelaptrin","download_url":"https://codeload.github.com/felipelaptrin/serverless-infra/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246484273,"owners_count":20785046,"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","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":["api-gateway","aws","lambda","rds","serverless","terraform"],"created_at":"2024-10-04T17:01:12.816Z","updated_at":"2026-05-10T16:03:32.205Z","avatar_url":"https://github.com/felipelaptrin.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Serverless Architecture\n\nThe goal of this project is to create a serverless architecture in AWS, deploying a static website through CloudFront (using S3 as origin), an API in a Lambda, and a database using RDS (I'm not using Serverless Aurora because I plan to use this in a personal project and serverless aurora was gonna be more expensive than a RDS DB instance).\n\n## Architecture\n\n![Architecture](docs/architecture.png \"Architecture\")\n\n## How to run this project?\n\n### Pre-requisites\nSome configurations and resources are expected to be set before you run this project.\n\n1) Route53 should be properly configured\nIf you have a domain, make sure that this domain is being managed by Route53. So if you bought your domain from GoDaddy, NameCheap, or other registrars, you will need to allow Route53 to manage your domain.\n\n2) Create a S3 bucket to store the Terraform state file\nManually create an S3 bucket, we will use this bucket to store the state file of the Terraform.\n\n### Expected errors\nIt's expected to face some errors when trying to run the entire infra at first.\n\nThis module creates the S3 Bucket that will store the lambda function code and at the same time create the Lambda from a ZIP package of this Bucket. It's clear that once the bucket is created the bucket is empty. So you must run the CI (or manually push) that pushes the zipped code to S3 after the error. After that, you can rerun the terraform and everything is expected to work.\n\nRemember to also do the same for the S3 bucket that will store the static website! This one will not raise any errors but if you try to access the frontend without pushing the files to the bucket the website will not work.\n\n### Running the project\n\n1) Set the Terraform backend\nGo to the `versions.tf` file and change the backend configuration to point to the S3 Bucket that you created manually to store the terraform state.\n\n2) Create your `terraform.tfvars` file\nYou can read the `README_TERRAFORM.md` file to check all the variables accepted by the code.\n\nA possible example of the variables file:\n```ini\n## COMMON\naws_region = \"us-west-2\"\ndomain_name = \"felipetrindade.com\"\n\n## FRONTEND\nfrontend_bucket_name = \"static-frontend-flat\"\nfrontend_subdomain = \"admin\"\n\n## BACKEND\nbackend_subdomain = \"api\"\nbackend_s3_bucket_name = \"lambdas-code-flat\"\nbackend_s3_bucket_name_application = \"api-bucket-flat\"\n\nbackend_lambda_name = \"api\"\nbackend_lambda_s3_object = \"api.zip\"\nbackend_lambda_memory_in_MB = 512\nbackend_api_gateway_name = \"api-gateway\"\n\n## DATABASE\ndatabase_identifier = \"api-database\"\ndatabase_requested_storage_in_GiB = 20\ndatabase_max_storage_in_GiB = 30\ndatabase_name = \"app\"\ndatabase_engine_version = \"8.0\"\ndatabase_password = \"12341234\"\ndatabase_instance_class = \"db.t4g.micro\"\nbackend_lambda_environments_variables = {\n    USER = \"root\",\n    PASSWORD = \"12341234\",\n    BATABASE = \"app\"\n    LOGGER_LEVEL = \"DEBUG\"\n}\n```\n\n3) Create the infrastructure using Terraform\n```bash\nterraform init\nterraform apply -var-file=\"terraform.tfvars\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelipelaptrin%2Fserverless-infra","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffelipelaptrin%2Fserverless-infra","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelipelaptrin%2Fserverless-infra/lists"}