A Terraform module for Google Cloud Platform that simplifies the creation & configuration domain redirect for Cloud DNS.
Google Cloud DNS does not have built-in support for 30x redirects. There has been an open feature request since 2017 with no ETA. This module provides this functionality through the use of a Cloud Storage bucket, a managed certificate, a global IP address, and url mappings.
- Terraform 0.14 or higher.
google
provider 3.67.0 or higher.google-beta
provider 3.67.0 or higher.
module "www_example" {
source = "simplycubed/domain-redirect/google"
hostname = "www.${var.base_domain}"
host_redirect = var.base_domain
}
Name | Description | Type |
---|---|---|
hostname | The name of the website and the Cloud Storage bucket to create (e.g. static.foo.com). | string |
host_redirect | The name of the target domain to redirect | string |
https_redirect | Issue TLS certificate and enable HTTPS | bool |
strip_query | Strip URL query parameters | bool |
In addition to the inputs documented above, the following values are available as outputs:
Name | Description | Type |
---|---|---|
load_balancer_ip_address | IP address of the HTTP Cloud Load Balancer. | string |
- 1.0.0
- Release stable version.
Issues containing possible future enhancements can be found here.