alb-redirect

Flaconi/alb-redirect/aws

Terraform Module HCL AWS

HTTP 301 and 302 redirects made simple utilising an ALB and listener rules.

Install
module "alb-redirect" {
source = "Flaconi/alb-redirect/aws"
version = "3.0.0"
}
plain text: /constructs/tfmod-flaconi-alb-redirect-aws/install.txt
⭐ Source on GitHub 📦 Registry page
README

Terraform AWS ALB Redirect ![lint](https://github.com/Flaconi/terraform-aws-alb-redirect/actions?query=workflow%3Alint) ![test](https://github.com/Flaconi/terraform-aws-alb-redirect/actions?query=workflow%3Atest) ![Tag](https://github.com/Flaconi/terraform-aws-alb-redirect/releases) ![License](https://opensource.org/licenses/MIT) This Terraform module can create HTTP 301 and 302 redirects using the AWS Application Load Balancer Usage alb_redirect module ``hcl module "alb_redirect" { source = "../../" name = "redirect-service" # This can be left to its default # cidr = "172.30.0.0/16" # extra tags to be applied to the resources tags = { Terraform = "generated" } # do we enable the https listener https_enabled = true # certificate_arn sets the certificate arn for the https listener (optional

Inputs (15)
NameTypeDescriptionDefault
namestringThe name used to interpolate into the resources created required
response_message_bodystringThe default response message body in case no rules have been met"Not found"
ssl_policystringSecurity policy used for front-end connections."ELBSecurityPolicy-FS-1-2-Res-2020-10"
extra_ssl_certsmap(string)Map of extra ssl certificates arns applied to the SSL Listener{}
lb_ip_address_typestringThe `ip_address_type` of the LB, either 'ipv4' or 'dualstack' in case ipv6 needs"ipv4"
tagsmap(string)Extra tags to be applied to the resources{}
response_codestringThe default status code to return when no rules have been met"404"
redirect_protocolstringThe protocol to redirect to."HTTPS"
redirect_status_codestringThe HTTP redirect code to use."HTTP_301"
https_enabledboolDo we enable httpsfalse
redirect_ruleslist(map(string))A list with maps populated with redirect rules[]
ipv6_networking_enabledboolDo we configure IPv6 routing and ingress in the VPCfalse
redirect_portstringThe port to redirect to."443"
cidrstringThe cidr used for the network"172.30.0.0/16"
certificate_arnstringThe arn of the certificate""
Outputs (2)
dns_name — Application Load Balancer fqdn
zone_id — Application Load Balancer Route53 Zone ID
Resources (11)
aws_internet_gatewayaws_lbaws_lb_listeneraws_lb_listener_certificateaws_lb_listener_ruleaws_routeaws_route_tableaws_route_table_associationaws_security_groupaws_subnetaws_vpc
Details
FrameworkTerraform Module
LanguageHCL
Version3.0.0
Cloud AWS
★ Stars7
Forks3
Total downloads5.1k
Inputs15
Outputs2
Resources11
Examples1
LicenseMIT
NamespaceFlaconi
Updated