Want to use AWS S3 to simply and (theoretically) cheaply redirect queries from one FQDN to another? Let S3, CloudFront, ACM, and Route 53 do the magic for you with this module.
Based on this article by Chris Mendez.
- S3 bucket
- Access control list (
public-read
) (can be disabled withskip_acl
variable set to true) - Website configuration with redirect policy
- Access control list (
- Route 53 record
I've tested this on 1.2, so I imagine anything from there on up should be fine. If you find an issue, feel free to raise an issue.
# Production Website
module "webmail_redirect" {
# Pick the latest v0.0.x release from the registry
source = "santiagon610/web-redirect/aws"
version = "~> 0.0"
# Redirect from http://mail.example.com
redirect_hostname = "mail"
redirect_domain = "example.com"
redirect_route53_zone_id = aws_route53_zone.example_com.zone_id
# Redirect to https://example-com.awsapps.com/mail
destination_protocol = "https"
destination_hostname = "example-com.awsapps.com"
destination_suffix = "mail"
skip_acl = false
}
- This module does not generate any outputs