Skip to content

Terraform module to create a web redirect using S3 and Route 53

Notifications You must be signed in to change notification settings

santiagon610/terraform-aws-web-redirect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Terraform module to create a web redirect using S3 and Route 53

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages