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

elbv2: LoadBalancer.fromLookup() #6803

Closed
realharry opened this issue Mar 19, 2020 · 8 comments
Closed

elbv2: LoadBalancer.fromLookup() #6803

realharry opened this issue Mar 19, 2020 · 8 comments
Labels
@aws-cdk/aws-elasticloadbalancing Related to Amazon Elastic Load Balancing @aws-cdk/aws-route53 Related to Amazon Route 53 closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2

Comments

@realharry
Copy link

In order to be able to create an Alias record on Route53 with an ALB target, one needs to use the ILoadBalancerV2 interface. However, currently all fields of ILoadBalancerV2 are required, which makes it difficult to use.

Reproduction Steps

  1. Create a public hosted zone on Route53.
  2. Try to add an ARecord targeting an existing application load balancer (e.g., with dns name something like abc.region.elb.amazonaws.com).
  3. The ARecord constructor requires target field of type RecordTarget.
  4. The RecordTarget constructor takes a field, aliasTarget, of type IAliasRecordTarget.
  5. The constructor of LoadBalancerTarget, which implements IAliasRecordTarget, requires an argument of type, ILoadBalancerV2.
  6. There is no easy way to construct an ``ILoadBalancerV2object withloadBalancerCanonicalHostedZoneId` or `loadBalancerDnsName`.

Error Log

N/A

Environment

  • CLI Version - 1.30.0 (build 4f54ff7) :
  • Framework Version: 1.30.0 ;
  • OS Ubuntu 18:
  • Language Typescript:

Other

This is needed, among other things, to support naked domains (zone apex record) pointing to the application load balancer.


This is 🐛 Bug Report

@realharry realharry added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Mar 19, 2020
@SomayaB SomayaB added @aws-cdk/aws-route53 Related to Amazon Route 53 @aws-cdk/aws-elasticloadbalancing Related to Amazon Elastic Load Balancing and removed @aws-cdk/aws-route53 Related to Amazon Route 53 labels Mar 19, 2020
@SomayaB SomayaB added the @aws-cdk/aws-route53 Related to Amazon Route 53 label Mar 19, 2020
@rix0rrr
Copy link
Contributor

rix0rrr commented Mar 20, 2020

Hey! It looks like you're describing a solution rather than a problem.

Please describe your situation, what you're trying to achieve, and why you are having trouble achieving what you'd like to achieve. We then we will decide how to best solve the problem considering your use case and other use cases we'd like to enable.

This could be using the solution you suggested, but it could also be another solution altogether. For example, what if you didn't have to implement the interface at all, but we provided a class for you that did what you needed it to? Would you still care that its properties are required?

@rix0rrr rix0rrr added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Mar 20, 2020
@rix0rrr
Copy link
Contributor

rix0rrr commented Mar 20, 2020

In this particular case, by the way, these is no way around specifying the two pieces of information we need, because that's simply what route53 requires and there's no way to derive them.

The alias target needs the hosted zone ID and the hosted zone name, which you are expected to supply when calling ApplicationLoadBalancer.fromLoadBalancerAttributes().

I will interpret this as a request for a LoadBalancer.fromLookup().

@rix0rrr rix0rrr changed the title (All) Fields of ILoadBalancerV2 should be made optional elbv2: LoadBalancer.fromLookup() Mar 20, 2020
@rix0rrr rix0rrr added effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. and removed bug This issue is a bug. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. labels Mar 20, 2020
@realharry
Copy link
Author

Hi @rix0rrr good morning. thanks for the reply.

yes, the particular scenario/steps I'm describing may or may not be a bug. my goal is, "to create an Alias record on Route53 with an ALB target". (it seems) the api clearly provides a way to do this, e.g., using ILoadBalancerV2. but, at the end of the day, (at least for me) it was not possible. that was why I called it a bug.

it can be achieved in many different ways. but, in my view, the original api designer intended to use this particular apis for this particular purpose. that's why, I think, he/she introduced all these elaborate constructs like IAliasRecordTarget and LoadBalancerTarget, etc. (Obviously, I can only guess at this point.)

Again, I'm not insisting on a solution. The possible solution/steps I provided was based on my (limited) understanding of the api. I would probably consult with the original designer/implementer as to why he/she defined LoadBalancerTarget, etc. if nobody can really use it.

Thanks!

@SomayaB SomayaB removed the needs-triage This issue or PR still needs to be triaged. label May 19, 2020
@rix0rrr rix0rrr added the p2 label Aug 12, 2020
@SomayaB SomayaB assigned njlynch and unassigned rix0rrr Aug 20, 2020
@gagan1510
Copy link

Any update on this? Facing the same issue.

@gagan1510
Copy link

@realharry were you able to do this using any work around? Would be of great help.

@gagan1510
Copy link

Any update on this?

@abramcav
Copy link

This does seem like a bug. If I look up a load balancer using any method, I should get a consistent load balancer object that I can use in any way a load balancer can be used. I'm sure there is much more to it under the hood, but from a user perspective, this is a bug.

@github-actions
Copy link

This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Apr 29, 2023
@github-actions github-actions bot added the closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. label May 4, 2023
@github-actions github-actions bot closed this as completed May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-elasticloadbalancing Related to Amazon Elastic Load Balancing @aws-cdk/aws-route53 Related to Amazon Route 53 closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

No branches or pull requests

6 participants