-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Populate listener_arn for aws_alb_listener_rule #1303
Populate listener_arn for aws_alb_listener_rule #1303
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, this looks reasonable, I just left you one comment there.
// arn:aws:elasticloadbalancing:us-east-1:012345678912:listener/app/name/0123456789abcdef/abcdef0123456789/456789abcedf1234 | ||
listenerArn = listenerArn[0:strings.LastIndex(listenerArn, "/")] | ||
// arn:aws:elasticloadbalancing:us-east-1:012345678912:listener/app/name/0123456789abcdef/abcdef0123456789 | ||
d.Set("listener_arn", listenerArn) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems functionally ok, but do you mind decoupling this new logic into a function and adding a test for it?
a0686ae
to
58a292a
Compare
@radeksimko thanks for the feedback! Sorry, I was away for a few days. I've extracted that logic into a little function and added some testing modelled after the alb target group cloudwatch suffix tests. I also switched to using a regexp because it wasn't handling the empty case gracefully. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks.
…ule-listener-arn Populate listener_arn for aws_alb_listener_rule
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! |
Importing a listener rule currently doesn't populate the listener_arn so the next plan attempts to recreate the rule. The AWS API doesn't return the listener arn when describing listener rules. But the listener arn can be inferred from the listener rule arn.
Closes #779