{"id":22754607,"url":"https://github.com/marvincaspar/serverless-static-website","last_synced_at":"2026-05-05T05:34:27.998Z","repository":{"id":150204941,"uuid":"161392601","full_name":"marvincaspar/serverless-static-website","owner":"marvincaspar","description":"Setup a serverless infrastructure for static website hosting on aws using S3, CloudFront, Route53 and Certificate Manager","archived":false,"fork":false,"pushed_at":"2018-12-11T21:06:52.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-05T09:45:50.205Z","etag":null,"topics":["aws","aws-cloudfront","aws-route53","aws-s3","https","ipv6","serverless","static-site","terraform"],"latest_commit_sha":null,"homepage":null,"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/marvincaspar.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":"2018-12-11T20:55:23.000Z","updated_at":"2019-01-29T08:28:09.000Z","dependencies_parsed_at":"2023-04-10T07:28:57.298Z","dependency_job_id":null,"html_url":"https://github.com/marvincaspar/serverless-static-website","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/marvincaspar%2Fserverless-static-website","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marvincaspar%2Fserverless-static-website/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marvincaspar%2Fserverless-static-website/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marvincaspar%2Fserverless-static-website/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marvincaspar","download_url":"https://codeload.github.com/marvincaspar/serverless-static-website/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246289732,"owners_count":20753657,"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":["aws","aws-cloudfront","aws-route53","aws-s3","https","ipv6","serverless","static-site","terraform"],"created_at":"2024-12-11T06:18:05.675Z","updated_at":"2026-05-05T05:34:22.978Z","avatar_url":"https://github.com/marvincaspar.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Serverless static website\n\nThis is a terraform script to setup a serverless infrastructure for static website hosting on aws using S3, CloudFront, Route53 and Certificate Manager.\n\n## Setup\n\nFirst terraform must be installed:\n\n```sh\n# unix\nsudo apt-get install unzip\nwget https://releases.hashicorp.com/terraform/0.11.10/terraform_0.11.10_linux_amd64.zip\nunzip terraform_0.11.10_linux_amd64.zip\nsudo mv terraform /usr/local/bin/\n\n# macOS\nbrew install terraform\n```\n\n### AWS account\n\nCreate an aws account and get the access and security key for the user. Then add the keys to the environment variables.\n\n```sh\nexport TF_VAR_access_key=\"\u003cyour-access-key\u003e\"\nexport TF_VAR_secret_key=\"\u003cyour-secret-key\u003e\"\n```\n\nTo have the variables always available, add the two lines to the `~/.bashrc` file and run `source ~/.bashrc` to reload the file.\n\nNext set the preferred aws [region](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html#concepts-available-regions) (default is eu-central-1)and the domain without a protocol and without www. in the `variables.tf` file.\n\n### E-Mail\n\nThe domain verification for the SSL certificate is done via email. Make sure that you have access to at least one of the following e-mail accounts:\n\n```\nadministrator@\u003cyour-domain\u003e\nhostmaster@\u003cyour-domain\u003e\npostmaster@\u003cyour-domain\u003e\nwebmaster@\u003cyour-domain\u003e\nadmin@\u003cyour-domain\u003e\n```\n\n## Usage\n\nAfter completing the setup section check the terraform script:\n\n```sh\nterraform plan\n```\n\nThe output shows which actions terraform will perform. If this is ok, start the creation for the infrastructure.\n\n```sh\nterraform apply\n```\n\nWhile terraform creates all components, amazon will send an e-mail for the domain verification. Check your e-mails and verify the domain, otherwise terraform will run into a timeout after a few minutes.\n\n## Rework\n\nAfter terraform is complete there are a few manual steps.\n\n### Setup nameserver\n\nLogin into the aws account, go to Route53 service and view the hosting zones. Select the new domain and find the nameserver from aws. Go to your domain provider and change the nameserver. This can take up to 48 hour until the new nameserver is set.\n\n### Upload website\n\nGo to the aws S3 service and select the bucket with the domainname. Upload the `index.html` and all required files for the website.\n\n## Verification\n\nIf the nameserver change is completed the website is available for the given domain, with and without `www` prefix. The website also supports IPv4 and IPv6 and uses force redirect from http to https.\n\nCheck IPv6: http://ipv6-test.com/validate.php\n\nCheck SSL setting: https://www.ssllabs.com/ssltest/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarvincaspar%2Fserverless-static-website","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarvincaspar%2Fserverless-static-website","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarvincaspar%2Fserverless-static-website/lists"}