Terraform module to create a web redirect using S3 and Route 53
Find a file
2023-05-28 19:38:53 -04:00
main.tf initial release (#1) 2022-12-16 17:39:40 -05:00
README.md chore: add skip_acl variable (#4) 2023-05-28 19:38:53 -04:00
resources.tf chore: add skip_acl variable (#4) 2023-05-28 19:38:53 -04:00
variables.tf chore: add skip_acl variable (#4) 2023-05-28 19:38:53 -04:00

AWS Web Redirect

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.

Features

  • S3 bucket
    • Access control list (public-read) (can be disabled with skip_acl variable set to true)
    • Website configuration with redirect policy
  • Route 53 record

Terraform versions

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.

Example Usage

# 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
}

Providers

Outputs

  • This module does not generate any outputs

Authors

License

CC0 1.0 Universal