{"id":17484702,"url":"https://github.com/ryanmcdermott/terraform-microservices-example","last_synced_at":"2025-04-22T15:20:46.669Z","repository":{"id":37883968,"uuid":"287813555","full_name":"ryanmcdermott/terraform-microservices-example","owner":"ryanmcdermott","description":"Using Terraform to deploy microservices that communicate with each other","archived":false,"fork":false,"pushed_at":"2022-06-15T04:44:19.000Z","size":92,"stargazers_count":23,"open_issues_count":1,"forks_count":13,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-21T21:07:52.420Z","etag":null,"topics":["docker","ecr","ecs","microservices","terraform"],"latest_commit_sha":null,"homepage":"","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/ryanmcdermott.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}},"created_at":"2020-08-15T19:41:01.000Z","updated_at":"2024-08-30T13:40:24.000Z","dependencies_parsed_at":"2022-08-19T15:10:36.464Z","dependency_job_id":null,"html_url":"https://github.com/ryanmcdermott/terraform-microservices-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanmcdermott%2Fterraform-microservices-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanmcdermott%2Fterraform-microservices-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanmcdermott%2Fterraform-microservices-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanmcdermott%2Fterraform-microservices-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ryanmcdermott","download_url":"https://codeload.github.com/ryanmcdermott/terraform-microservices-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250264931,"owners_count":21402005,"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":["docker","ecr","ecs","microservices","terraform"],"created_at":"2024-10-19T01:05:20.887Z","updated_at":"2025-04-22T15:20:45.260Z","avatar_url":"https://github.com/ryanmcdermott.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# terraform-microservices-example\n\nThis project is a simple example of using Terraform to deploy two microservices to AWS (GCP coming soon!) that can communicate with each other via service discovery. The two microservices are a frontend webserver (using Next.js) and a backend API server (using Flask). You can use any framework/libraries you want for these microservices, what's provided here is just a starting point!\n\n## Installation\n\n### AWS\n\n- Ensure you have installed: Terraform, Docker, and Docker Compose.\n- Clone this repo.\n- Sign up for AWS if you haven't already.\n- Create a repository called `fe` in ECR repository console: `https://[YOUR-REGION].console.aws.amazon.com/ecr/create-repository`\n- Create a repository called `api` in ECR repository console: `https://[YOUR-REGION].console.aws.amazon.com/ecr/create-repository`\n- Copy repository hostname: `[YOUR_DOCKER_REPO_ID].dkr.ecr.[YOUR-REGION].amazonaws.com`\n- Set the copied repository hostname to `TF_VAR_docker_repo` in your terminal.\n- In your terminal, run: `export TF_VAR_docker_repo=[YOUR_DOCKER_REPO_ID]`\n- In your terminal, run: `aws ecr get-login-password --region [YOUR-REGION] | docker login --username AWS --password-stdin [YOUR_DOCKER_REPO_ID].dkr.ecr.us-west-2.amazonaws.com`\n\n## Usage\n\n### Deploy\n\n`./deploy.sh`\n\nTerraform will show you a load balancer URL when it has finished deploying. **Wait about 60 seconds** before visiting this as it can take time for all of the resources to come online. When it does, you should see \"`Data from API server route /api/foo: bar`\" in your browser.\n\n### Undeploy\n\n`./destroy.sh`\n\n### Local Development\n\n`./dev.sh`\n\nVisit `http://localhost:3000` to see the frontend server running!\n\n## Architecture Diagram\n\nComing soon!\n\n## Credits\n\nBasic Terraform setup:\nhttps://github.com/bradford-hamilton/terraform-ecs-fargate\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanmcdermott%2Fterraform-microservices-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryanmcdermott%2Fterraform-microservices-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanmcdermott%2Fterraform-microservices-example/lists"}