Created
August 5, 2021 14:54
-
-
Save unbelauscht/19cd20ade518a8e7fe907fb91b83007c to your computer and use it in GitHub Desktop.
Redirect URL on AWS LB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lb_listener_rule#path_pattern | |
resource "aws_lb_listener_rule" "redirect" { | |
listener_arn = aws_lb_listener.listener.arn | |
action { | |
type = "redirect" | |
redirect { | |
port = "443" | |
protocol = "HTTPS" | |
path = "/new_url" | |
status_code = "HTTP_302" | |
} | |
} | |
condition { | |
path_pattern { | |
values = ["/old_url"] | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment