HTTP Load Balancer Static Website
This Terraform Module deploys a HTTP Load Balancer that routes requests to a Google Cloud Storage bucket for static content hosting. Internally the module uses the terraform-google-load-balancer http-load-balancer -module.
- It allows you to configure SSL with a custom domain name.
- Cloud Load Balancing is integrated with Google Cloud CDN for optimal application and content delivery
- Cloud Load Balancing will automatically scale without pre-warming as your users and traffic grow
- See the http-load-balancer-website example for working sample code.
- Check out variables.tf for all parameters you can set for this module.
How do I test my website?
This module outputs the IP address of your load balancer website using the
load_balancer_ip_address output variable.
If you set
var.create_dns_entry to true, then this module will create a DNS A record in Google Domains
for your load balancer with the domain name in
var.website_domain_name, and you will
be able to use that custom domain name to access your bucket instead of the IP address.
How do I control access to my website?
By default, the module makes your website publicly accessible by setting the website bucket default object ACL to
"READER:allUsers". For more fine-grained access control, you can set ACLs
website_acls variable. For example setting to
access to only users in the group
You can read more about access control in the official documentation.
How do I configure HTTPS (SSL)?
To enable serving your content through a custom domain over SSL, you can use the
input variables. You will also have to pass a link to an SSL certificate with
ssl_certificate input variable.
How do I encrypt the buckets?
Cloud Storage always encrypts your data on the server side, before it is written to disk, at no additional charge. See https://cloud.google.com/storage/docs/encryption/.