-
Notifications
You must be signed in to change notification settings - Fork 9.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support ALB advanced request routing #8126
Comments
It looks like we need to add blocks to the resource "aws_lb_listener_rule" "foo" {
condition {
host_header_config {
}
}
condition {
http_header_config {
}
}
condition {
http_request_method_config {
}
}
condition {
path_pattern_config {
}
}
condition {
query_string_config {
}
}
condition {
source_ip_config {
}
}
} |
Below is my take. DescriptionApplication Load Balancers now have additional routing options as of 3/27/2019. Conditions fields:
Additionally, each condition can now accept multiple values. New or Affected Resource(s)
Potential Terraform Configurationresource "aws_lb_listener_rule" "advanced_routing" {
listener_arn = "${aws_lb_listener.front_end.arn}"
priority = 99
action {
type = "forward"
target_group_arn = "${aws_lb_target_group.static.arn}"
}
# Condition field: host-header
condition {
field = "host-header"
values = ["*.example.com"]
}
# Condition field: path-pattern
condition {
field = "path-pattern"
values = ["/img/*"]
}
# New condition field: http-header
condition {
field = "http-header"
http_header_name = "User-Agent"
# Multiple values now acceptable
values = [
"*Chrome*",
"*Safari*",
]
}
# New condition field: http-request-method
condition {
field = "http-request-method"
values = [
"GET",
"POST"
]
}
# New condition field: query-string
condition {
field = "query-string"
values = [
{
key = "version"
value = "v1"
},
{
value = "example"
}
]
}
# New condition field: source-ip
condition {
field = "source-ip"
values = [
"192.0.2.0/24",
"198.51.100.10/32",
]
}
} References
The # Common structure specifies a list of strings
[
{
"Field": "host-header",
"HostHeaderConfig": {
"Values": ["*.example.com"]
}
}
]
# Query string specifies a list of maps
[
{
"Field": "query-string",
"QueryStringConfig": {
"Values": [
{
"Key": "version",
"Value": "v1"
},
{
"Value": "example"
}
]
}
}
]
# HTTP header introduces an additional field for header name
[
{
"Field": "http-header",
"HttpHeaderConfig": {
"HttpHeaderName": "User-Agent",
"Values": ["*Chrome*", "*Safari*"]
}
}
]
|
@ewbankkit Is this feature added. |
@bharat109puri We are still waiting on #8268 to be reviewed and merged. |
Was this (or will it be) back-ported to 0.11.x? Not ready to goto 0.12.x just yet. |
@jim-leary AWS provider v2 is compatible with both TF 0.11 and 0.12 |
I'd like to suggest that we model our implementation after the Currently, to get around this shortcoming, I create a simple
For more info, see:
...
|
Is there an ETA for a release of this feature to Terraform? |
@aeschright Can we have an update for this one too please ? All these ALB features are absolutely necessary for many of us, and as I said on another ALB related issue, being this late in implementing pretty basic features on widely used resources like ALBs could really become a huge negative point of Terraform. |
While in general, the AWS provider plugin is updated very promptly with new features as they become available in AWS (like QLDB), this one is a big outlier. Is there any explanation why this is the case? Just trying to get a better idea for future features.. |
The feedback loop with TF aws provider maintainers has been really slow. It's also my first attempt at a change of this size, so the first code was not great 😅 . Probably explains some of their disinterest in the PR. The first official reviewer was a new hire also and didn't know the code base. There was a bit of back-and-forth with requests for changes that are simply impossible in terraform. Wasted a lot of my time and murdered motivation. By the time he was happy with the PR he had lost commit permissions to the provider repo. A new reviewer has asked for more changes, some of which are regressions to earlier versions. I just need to find the time and motivation to do the work. Any changes to the code base requires updating a lot of tests. Which is slow and painful due to needing to generate the set hashes. Running the ALB rules test suite is very time consuming. |
Can I send you $$$ for motivation? |
@dpiddockcmp can you provide some sort of estimate how much work is left to completion or even a time estimate? We're pretty desperately waiting for this feature since we just dropped the serverless framework and API Gateway. We just totally didn't expect this not to be already available in the provider plugin - and yes, I should've checked first :( |
Unfortunately it's impossible to give a time estimate. I've made changes from the last round of review so now it's back to the maintainers. |
This has been released in version 2.42.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Community Note
Add support for AWS Application Load Balancer advanced request routing.
The text was updated successfully, but these errors were encountered: