-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
[Bug]: [ERROR] Invalid Attribute Combination Only one of "default_action[0].target_group_arn" or "default_action[0].forward" can be specified. #35621
Comments
Community NoteVoting for Prioritization
Volunteering to Work on This Issue
|
Thanks for submitting this, @Paola1899. The restriction was added as part of fixing some bugs related to Technically, if there is a single If it is possible to fix the bugs listed above and still allow both |
Hi @gdavison, I'm having the same problem here. If my understanding of the explanation given is correct, does the configuration described below stop working? ContextI'm using an ALB Error Log
Configurationresource "aws_lb_listener_rule" "listener_rule_application" {
listener_arn = aws_lb_listener.main.arn
action {
type = "forward"
forward {
target_group {
arn = aws_lb_target_group.main["blue"].arn
weight = 100
}
target_group {
arn = aws_lb_target_group.main["green"].arn
weight = 0
}
}
}
lifecycle {
ignore_changes = [
action
]
}
} What would be the correct procedure for this? |
@mvallim No, that configuration should not be affected by this change, since there is no |
A little more context resource "aws_lb_listener" "main" {
load_balancer_arn = var.load_balancer_arn
certificate_arn = var.certificate_arn
protocol = var.protocol
port = var.port
default_action {
type = "fixed-response"
fixed_response {
content_type = "application/json"
status_code = "400"
message_body = jsonencode({
message = "Bad Request"
})
}
}
lifecycle {
ignore_changes = [
default_action
]
}
} So why am I getting this error? |
Hi
|
Hi @gabmuniz1995, I'm not sure I understand what you're suggesting. You can specify from 1 to 5 This is supported: resource "aws_lb_listener" "example" {
...
default_action {
type = "forward"
target_group_arn = <arn>
}
} This is also supported: resource "aws_lb_listener" "example" {
...
default_action {
type = "forward"
forward {
target_group {
arn = <arn1>
}
target_group {
arn = <arn2>
}
}
}
} This is not supported: resource "aws_lb_listener" "example" {
...
default_action {
type = "forward"
target_group_arn = <arn>
forward {
target_group {
arn = <arn>
}
}
}
} |
Hi @Paola1899 and @mvallim. I've noticed that you're using |
I am having the same problem with listener managed by ECS/codedeploy, hence the attributes mutates outside of terraform causing the new issue. We use "initial" values to get first version running, marked as ignore so it does not trigger a plan change. resource "aws_alb_listener" "_" {
load_balancer_arn = var.load_balancer_arn
port = var.port
certificate_arn = var.certificate_arn
protocol = var.protocol
default_action {
type = "forward"
target_group_arn = var.default_target_group_arns[0]
}
lifecycle {
ignore_changes = [
default_action.0.target_group_arn, default_action.0.forward # managed by CodeDeploy
]
}
}
|
@gdavison
|
@gdavison |
Thanks for the clarifications, @project0 and @bay73. In short, |
This functionality has been released in v5.36.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. Thank you! |
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. |
Terraform Core Version
1.5.1
AWS Provider Version
v5.35.0
Affected Resource(s)
aws_lb_listener
Expected Behavior
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.35.0"
}
}
Actual Behavior
I encountered an error while executing Terraform AWS version 5.35.0, specifically related to the default_action attribute of a load balancer listener. The error message, `[ERROR] provider.terraform-provider-aws_v5.35.0_x5: Response contains error diagnostic: tf_rpc=PlanResourceChange @caller=github.com/hashicorp/terraform-plugin-go@v0.20.0/tfprotov5/internal/diag/diagnostics.go:62 tf_resource_type=aws_lb_listener diagnostic_summary="Invalid Attribute Combination," prompted me to investigate a solution. After troubleshooting, I found that downgrading the AWS provider to version 5.34.0 resolved the issue. The corrected Terraform configuration includes the following snippet:
required_providers {
aws = {
source = "hashicorp/aws"
version = "5.34.0"
}
}
This adjustment ensured compatibility and allowed for successful execution without encountering the previously mentioned error.
Relevant Error/Panic Output Snippet
Terraform Configuration Files
Steps to Reproduce
Run Terraform Plan
Debug Output
No response
Panic Output
No response
Important Factoids
No response
References
No response
Would you like to implement a fix?
None
The text was updated successfully, but these errors were encountered: