AWS Serverless Infrastructure for Static Website based on Hugo
Creates a static website Infrastructure on a domain hosted on S3 and delivered by CloudFront over HTTPS with Route53 managing DNS.
Terraform Registry: https://registry.terraform.io/modules/dannylinden/website-serverless/aws/
-
Redirects the following to
https://www.example.com
https://example.com
http://www.example.com
http://example.com
-
Push to CodeCommit Repository on
master
branch triggers a CodePipeline / CodeBuild run
To validate the SSL certificate you need to be able to recieve Emails to:
Email-Adress
variable "aws_access_key" {}
variable "aws_secret_key" {}
provider "aws" {
access_key = "${var.aws_access_key}"
secret_key = "${var.aws_secret_key}"
region = "eu-central-1"
}
provider "aws" {
access_key = "${var.aws_access_key}"
secret_key = "${var.aws_secret_key}"
region = "us-east-1"
alias = "us-east-1"
}
module "hugo-site" {
source = "dannylinden/website-serverless/aws"
www_domain = "www.example.com" /* Your domain here */
root_domain = "example.com" /* Your root domain here */
ssl-validation = "EMAIL" /* How to validate */
ssh_pub_key = "~/.ssh/id_rsa.pub" /* Path to the SSH Pub key for CodeCommit authentification */
bucket_prefix = "" /* Prefix for S3 Buckets */
}
output "nameservers" {
value = "${module.hugo-site.nameservers}"
}
output "git_remote_url" {
value = "${module.hugo-site.git_remote_url}"
}
The Output if the Module contains:
- Git remote URL of the Repository to push the website code
- Nameserver for the Domain
Module managed by Danny Linden.
MIT License. See LICENSE for full details.