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

feat: convenience method for ALB redirects #9913

Merged
merged 3 commits into from
Sep 1, 2020
Merged

feat: convenience method for ALB redirects #9913

merged 3 commits into from
Sep 1, 2020

Conversation

hoegertn
Copy link
Contributor

After the feedback I received for my latest addition of the redirect method to the ÀpplicationLoadBalancerFargateService` I propose a convenience method for the ALB to create redirects.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@hoegertn
Copy link
Contributor Author

hoegertn commented Sep 1, 2020

@njlynch Is this something you consider merging? I will then fix the tests. I think the change to jest broke this PR

@njlynch
Copy link
Contributor

njlynch commented Sep 1, 2020

Yes, this looks like a nice convenience method. Sorry about the churn with the nodeunit -> jest migration.

/**
* Add a redirection listener to this load balancer
*/
public addRedirect(props?: ApplicationLoadBalancerRedirectConfig): ApplicationListener {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is the preferred convention for cases like this; it will also simplify some of the props?.foo accessors below.

Suggested change
public addRedirect(props?: ApplicationLoadBalancerRedirectConfig): ApplicationListener {
public addRedirect(props: ApplicationLoadBalancerRedirectConfig = {}): ApplicationListener {

});

// WHEN
lb.addRedirect({});
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Slightly more idiomatic usage:

Suggested change
lb.addRedirect({});
lb.addRedirect();

@hoegertn
Copy link
Contributor Author

hoegertn commented Sep 1, 2020

@njlynch I fixed the tests and changed the code according to your feedback

Copy link
Contributor

@njlynch njlynch left a comment

Choose a reason for hiding this comment

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

Looks great!

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 9986d68
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify
Copy link
Contributor

mergify bot commented Sep 1, 2020

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit 5bed08a into aws:master Sep 1, 2020
@hoegertn hoegertn deleted the alb-redirect branch July 17, 2021 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants