{"id":17983523,"url":"https://github.com/techjacker/terraform-aws-s3website","last_synced_at":"2025-03-25T19:32:39.716Z","repository":{"id":51819960,"uuid":"87981646","full_name":"techjacker/terraform-aws-s3website","owner":"techjacker","description":"Terraform modules to create a static website hosted on AWS S3 and set up MX records","archived":false,"fork":false,"pushed_at":"2022-08-02T20:53:34.000Z","size":40,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-11T20:36:53.088Z","etag":null,"topics":["mx","s3-website","terraform","terraform-modules"],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/techjacker.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":"2017-04-11T21:37:22.000Z","updated_at":"2023-08-14T09:32:58.000Z","dependencies_parsed_at":"2022-08-03T03:00:37.402Z","dependency_job_id":null,"html_url":"https://github.com/techjacker/terraform-aws-s3website","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techjacker%2Fterraform-aws-s3website","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techjacker%2Fterraform-aws-s3website/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techjacker%2Fterraform-aws-s3website/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techjacker%2Fterraform-aws-s3website/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/techjacker","download_url":"https://codeload.github.com/techjacker/terraform-aws-s3website/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222090823,"owners_count":16929472,"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":["mx","s3-website","terraform","terraform-modules"],"created_at":"2024-10-29T18:17:34.866Z","updated_at":"2024-10-29T18:17:36.491Z","avatar_url":"https://github.com/techjacker.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Terraform S3 Website \u0026 MX\nProvisions S3 website and MX records.\n\n## Usage Guide\n### 1. Update `terraform.tfvars` with domain\n```HCL\ndomain = \"example.com\"\n```\n### 2. Update `backend.tf`\nChange key to `\u003crepo-name\u003e/terraform.tfstate`, eg:\n```HCL\n  key = \"terraform-aws-s3website/terraform.tfstate\"\n```\n### 3. Push to github main branch to trigger terraform apply\nSee `.github/workflows/terraform.yml`\n\n### 4. Plug in Nameservers to domain registrar\nGo to namecheap.com or similar and plug these in to your domain.\n```\n$ terraform output\n```\n### 5. Update `terraform.tfvars` to enable S3 website provisioning\n```HCL\nenable_website = true\n```\n### 6. Push to github main branch to trigger terraform apply\n\n-------------------------------------------\n## Local Dev Setup\n### 1. Install Dependencies\nInstall and init [pre-commit](https://pre-commit.com/) and [tflint](https://github.com/terraform-linters/tflint).\n```\n$ pip install pre-commit\n$ brew install tflint\n```\n### 2. Initialise pre-commit hooks and tflint\n```\n$ tflint --init\n$ pre-commit install\n```\n### 3. Update Lockfiles\nAdd checksums for all platforms to [terraform lock files](https://www.terraform.io/language/files/dependency-lock#new-provider-package-checksums)\n```\n$ make lockfiles\n```\n### 4. Run lint on all files\n```\n$ pre-commit run --all-files\n```\n\n\n-------------------------------------------\n\n### Test\n```Shell\n$ curl -sI http://example.com | grep -E '(301|Server|Location|X-Cache|HTTP)'\n  HTTP/1.1 301 Moved Permanently\n  Server: CloudFront\n  Location: https://example.com/\n  X-Cache: Redirect from cloudfront\n\n$ curl -sI https://example.com | grep -E '(X-Cache|HTTP)'\n  HTTP/1.1 200 OK\n  X-Cache: Hit from cloudfront\n\n$ curl -sI http://www.example.com | grep -E '(301|Server|Location|X-Cache|HTTP)'\n  HTTP/1.1 301 Moved Permanently\n  Server: CloudFront\n  Location: https://www.example.com/\n  X-Cache: Redirect from cloudfront\n\n$ curl -sI https://www.example.com | grep -E '(301|Server|Location|HTTP)'\n  HTTP/1.1 301 Moved Permanently\n  Location: https://example.com/\n  Server: AmazonS3\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechjacker%2Fterraform-aws-s3website","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechjacker%2Fterraform-aws-s3website","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechjacker%2Fterraform-aws-s3website/lists"}