Skip to content
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

Unable to access 'load_balancer_arn' property from 'aws_lb_listener' data query #4315

Closed
bhales opened this issue Apr 23, 2018 · 4 comments · Fixed by #4317
Closed

Unable to access 'load_balancer_arn' property from 'aws_lb_listener' data query #4315

bhales opened this issue Apr 23, 2018 · 4 comments · Fixed by #4317
Labels
bug Addresses a defect in current functionality. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/elbv2 Issues and PRs that pertain to the elbv2 service.
Milestone

Comments

@bhales
Copy link

bhales commented Apr 23, 2018

Terraform Version

Terraform: v0.10.8
AWS Provider: v1.9-1.15

Affected Resource(s)

  • aws_lb_listener

Terraform Configuration Files

The terraform below was able to use a listener arn as input to get details about the associated load balancer. The worked until AWS provider v1.9 and is still an issue with the latest version at this time(v1.15). The result from v1.9 and up is an error saying 'load_balancer_arn' is not an attribute of the listener(see below).

data "aws_lb_listener" "selected" {
	arn = "${var.alb_listener_arn}"
}

data "aws_lb" "selected" {
	arn  = "${data.aws_lb_listener.selected.load_balancer_arn}"
}

Expected Behavior

I would expect the query to function as it previously did and return the load balancer arn. Similar to the AWS CLI command:
aws elbv2 describe-listeners --listener-arns <arn>

Actual Behavior

Error: Error running plan: 1 error(s) occurred:

* module.sts.data.aws_lb.selected: 1 error(s) occurred:

* module.sts.data.aws_lb.selected: Resource 'data.aws_lb_listener.selected' does not have attribute 'load_balancer_arn' for variable 'data.aws_lb_listener.selected.load_balancer_arn'

Steps to Reproduce

Have a simple terraform that queries for a listener and attempt to access the 'load_balancer_arn' attribute.

Important Factoids

This worked from v1.2 through v1.8. After a little digging this appears to be associated with the change to add another method of querying for a listener via load balancer name and port. Associated issues below.

References

These issues appear to be related but I'm not certain.

@bflad bflad added bug Addresses a defect in current functionality. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/elbv2 Issues and PRs that pertain to the elbv2 service. labels Apr 23, 2018
@bflad bflad added this to the v1.16.0 milestone Apr 23, 2018
@bflad
Copy link
Contributor

bflad commented Apr 23, 2018

Hi @bhales 👋 Thank you very much for this bug report. Indeed this was a regression that was introduced. @loivis and I quickly pushed through the fix for this in #4317, which will release in v1.16.0 of the AWS provider, likely in two days or so.

@bhales
Copy link
Author

bhales commented Apr 24, 2018

That's great. Thanks for the quick turnaround.

@bflad
Copy link
Contributor

bflad commented Apr 25, 2018

This has been released in version 1.16.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@ghost
Copy link

ghost commented Apr 6, 2020

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!

@ghost ghost locked and limited conversation to collaborators Apr 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/elbv2 Issues and PRs that pertain to the elbv2 service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants