{"id":20704895,"url":"https://github.com/nmcostello/terraform_website","last_synced_at":"2026-01-28T05:57:50.312Z","repository":{"id":65287294,"uuid":"585726947","full_name":"nmcostello/terraform_website","owner":"nmcostello","description":"IaC for a highly-available web server deployment into AWS","archived":false,"fork":false,"pushed_at":"2023-02-25T18:34:45.000Z","size":467,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"development","last_synced_at":"2025-05-31T11:32:04.891Z","etag":null,"topics":[],"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/nmcostello.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-01-05T23:06:44.000Z","updated_at":"2024-10-28T20:40:14.000Z","dependencies_parsed_at":"2023-10-12T15:22:35.257Z","dependency_job_id":null,"html_url":"https://github.com/nmcostello/terraform_website","commit_stats":null,"previous_names":["nmcostello/terraform_website"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nmcostello/terraform_website","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmcostello%2Fterraform_website","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmcostello%2Fterraform_website/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmcostello%2Fterraform_website/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmcostello%2Fterraform_website/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nmcostello","download_url":"https://codeload.github.com/nmcostello/terraform_website/tar.gz/refs/heads/development","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nmcostello%2Fterraform_website/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28840256,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T05:50:12.573Z","status":"ssl_error","status_checked_at":"2026-01-28T05:49:54.528Z","response_time":57,"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":[],"created_at":"2024-11-17T01:15:04.897Z","updated_at":"2026-01-28T05:57:50.295Z","avatar_url":"https://github.com/nmcostello.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deploy a highly-available webserver\n\n#### Table of Contents\n[Overview](#overview)  \n[Directory layout](#directory-layout)  \n[How to use](#how-to-use)  \n[Architecture](#architecture)  \n\n## Overview\n\nThis project uses Packer and Terraform to create and configure a highly-available website. The project has the following components:\n- `GitHub Actions`: the workflows are used to validate, test, and deploy the Packer, Terraform, and documentation code.\n- `Packer`: creates an Ubuntu AMI and installs and configures NGINX on the image that is later used in the Terraform step.\n- `Terraform`: IaC used to deploy resources to AWS:\n  - `Route53`: DNS and CNAME records.\n  - `ACM`: SSL Cert for HTTPS.\n  - `Application Load Balancer`: balances load to webservers, redirects HTTP -\u003e HTTPS.\n  - `Autoscaling Group` using `Packer` AMI for the NGINX webservers.\n\n## Directory layout  \n  - [.github/workflows](.github/workflows): hosts all the files relating to GitHub Actions.\n    - [deployment.yaml](.github/workflows/deployment.yaml): contains the code for the job that deploys Terraform.\n    - [docs.yaml](.github/workflows/docs.yaml): contains the code for the job that builds the Terraform docs.\n    - [image.yaml](.github/workflows/image.yaml): contains the job code that runs Packer.\n  - [packer](packer): hosts all the files related to Packer and the image that it builds.\n    - [index.html](packer/index.html): index page for the webserver.\n    - [website](packer/website): NGINX server configuration.\n    - [webserver.pkr.hcl](packer/webserver.pkr.hcl): Packer configuration to build the AMI.\n  - [terraform](terraform): contains all of the Terraform IAC.\n    - [README.md](terraform/README.md): README generated by Terraform docs job in pipeline.\n    - [main.tf](terraform/main.tf): main Terraform file.\n    - [dns.tf](terraform/dns.tf): contains code related to DNS, certificates, and CNAME associtation.\n    - [loadbalancer.tf](terraform/loadbalancer.tf): contains code relating to the load balancer.\n    - [variables.tf](terraform/variables.tf): variables files.\n    - [webserver.tf](terraform/webserver.tf): contains code that deploys server, autoscaling group, and launch config\n    - [outputs.tf](terraform/outputs.tf): outputs from Terraform deployment.\n  - [test](test): test directory\n    - [validate.py](test/validate.py): Python script to validate webserver configuration.\n    \n## How to use\n#### Prerequisites\n- Github Account\n- AWS Account\n- A registered doamin\n- If you want to run this locally you will also need:\n  - AWS CLI\n  - Terraform CLI\n  - Packer CLI\n\n#### Steps\n1. Fork the repo into your own GitHub Account\n2. Add the following secrets to your GitHub secrets:  \n    - or to a local `terraform.tfvars` file if you are running locally.\n \n  | Secret                 | Description                                       |  \n  | ---------------------- | ------------------------------------------------- |  \n  | AWS_ACCESS_KEY_ID      | Access key for IAM user in your account.          |  \n  | AWS_SECRET_ACCESS_KEY  | Secret access key for IAM user in your account.   |  \n  | DOMAIN          | Domain name that you own and want to deploy to.   |  \n  | VPC_ID                 | VPC ID to deploy to.                              |  \n3. Push a commit, and the pipeline will run. \n4. You will have a new site on `https://challenge.${domain}`\n\n## Architecture\n![Architecture](arch.excalidraw.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnmcostello%2Fterraform_website","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnmcostello%2Fterraform_website","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnmcostello%2Fterraform_website/lists"}