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

Populate listener_arn for aws_alb_listener_rule #1303

Merged

Conversation

sj26
Copy link
Contributor

@sj26 sj26 commented Aug 2, 2017

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

@radeksimko radeksimko added the bug Addresses a defect in current functionality. label Aug 2, 2017
Copy link
Member

@radeksimko radeksimko left a 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)
Copy link
Member

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?

@radeksimko radeksimko added the waiting-response Maintainers are waiting on response from community or contributor. label Aug 14, 2017
@sj26 sj26 force-pushed the import-aws-alb-listener-rule-listener-arn branch from a0686ae to 58a292a Compare August 24, 2017 03:52
@sj26
Copy link
Contributor Author

sj26 commented Aug 24, 2017

@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.

@radeksimko radeksimko removed the waiting-response Maintainers are waiting on response from community or contributor. label Aug 29, 2017
Copy link
Member

@radeksimko radeksimko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks.

@radeksimko radeksimko merged commit 9b41983 into hashicorp:master Aug 29, 2017
@radeksimko radeksimko added enhancement Requests to existing resources that expand the functionality or scope. and removed bug Addresses a defect in current functionality. labels Aug 29, 2017
nbaztec pushed a commit to nbaztec/terraform-provider-aws that referenced this pull request Sep 26, 2017
…ule-listener-arn

Populate listener_arn for aws_alb_listener_rule
@ghost
Copy link

ghost commented Apr 11, 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 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

aws_alb_listener_rule doesn't import listener arn
2 participants