{"id":19232268,"url":"https://github.com/flexstack/nextjs-terraform","last_synced_at":"2026-02-16T15:01:15.949Z","repository":{"id":251110387,"uuid":"836362452","full_name":"flexstack/nextjs-terraform","owner":"flexstack","description":"An example for deploying a Next.js app to AWS Fargate with Terraform","archived":false,"fork":false,"pushed_at":"2024-07-31T20:21:10.000Z","size":384,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-04T16:48:04.865Z","etag":null,"topics":["api-gateway","aws-fargate","nextjs","nextjs-aws","nextjs-template","nextjs14","terraform","terraform-aws","terraform-example","terraform-examples","terraform-template"],"latest_commit_sha":null,"homepage":"https://flexstack.com/docs/languages-and-frameworks/how-to-deploy-next-js-to-aws","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flexstack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-31T17:25:54.000Z","updated_at":"2024-08-06T18:50:55.000Z","dependencies_parsed_at":"2024-08-01T00:38:19.310Z","dependency_job_id":null,"html_url":"https://github.com/flexstack/nextjs-terraform","commit_stats":null,"previous_names":["flexstack/nextjs-terraform"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/flexstack/nextjs-terraform","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flexstack%2Fnextjs-terraform","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flexstack%2Fnextjs-terraform/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flexstack%2Fnextjs-terraform/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flexstack%2Fnextjs-terraform/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flexstack","download_url":"https://codeload.github.com/flexstack/nextjs-terraform/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flexstack%2Fnextjs-terraform/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29510518,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-16T09:05:14.864Z","status":"ssl_error","status_checked_at":"2026-02-16T08:55:59.364Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["api-gateway","aws-fargate","nextjs","nextjs-aws","nextjs-template","nextjs14","terraform","terraform-aws","terraform-example","terraform-examples","terraform-template"],"created_at":"2024-11-09T16:05:49.479Z","updated_at":"2026-02-16T15:01:15.930Z","avatar_url":"https://github.com/flexstack.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Next.js on AWS Fargate with Terraform\n \n![Preview](./.readme/cloudfront-nextjs.png)\n\n## Architecture\n\nSee the [Terraform code](./infra/main.tf) for the full architecture.\n\n- A VPC with public, private, private isolated subnets\n- An ECS cluster with a Fargate service\n- A Route 53 private hosted zone for the ECS service (AWS CloudMap/Service Discovery)\n- API Gateway w/ VPC Link Integration to the ECS service using the private DNS name\n- An ECS task definition with a container that runs the Next.js app\n- A CloudFront distribution with an API Gateway origin\n\n## Deploy to AWS with Terraform\n\nFirst, you need to install Terraform. You can download it from [here](https://www.terraform.io/downloads.html). You'll\nalso need Docker and the AWS CLI installed and configured with your AWS credentials.\n\n\n```bash\ncd infra\n# Initialize the Terraform providers\nterraform init\n# See the changes that will be applied\nterraform plan\n# Apply the changes to your default AWS profile\nterraform apply\n```\n\nYou can also use a different AWS profile by setting the `TF_VAR_AWS_PROFILE` environment variable.\n\n```bash\nTF_VAR_AWS_PROFILE=my-profile terraform apply\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflexstack%2Fnextjs-terraform","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflexstack%2Fnextjs-terraform","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflexstack%2Fnextjs-terraform/lists"}