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(elasticloadbalancingv2): application load balancer attributes #29586

Merged
merged 12 commits into from
Apr 8, 2024

Conversation

badmintoncryer
Copy link
Contributor

Issue # (if applicable)

Closes #29585.

Reason for this change

ALB supports some attributes that is not configurable from CDK

  • routing.http.preserve_host_header.enabled
  • routing.http.x_amzn_tls_version_and_cipher_suite.enabled
  • routing.http.xff_client_port.enabled
  • routing.http.xff_header_processing.mode
  • waf.fail_open.enabled

Description of changes

Added some props to ApplicationLoadBalancerProps.

  • preserveHostHeader
  • xAmznTlsVersionAndCipherSuiteHeaders
  • preserveXffClientPort
  • xffHeaderProcessingMode
  • wafFailOpen

Description of how you validated changes

Added both unit and integ tests.

Checklist


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

@aws-cdk-automation aws-cdk-automation requested a review from a team March 23, 2024 02:22
@github-actions github-actions bot added star-contributor [Pilot] contributed between 25-49 PRs to the CDK feature-request A feature should be added or improved. p2 labels Mar 23, 2024
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

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

The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.

A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.

@@ -65,6 +65,66 @@ export interface ApplicationLoadBalancerProps extends BaseLoadBalancerProps {
* @default - Duration.seconds(3600)
*/
readonly clientKeepAlive?: Duration;

/**
* Indicates whether the Application Load Balancer should preserve the Host header in the HTTP request and send it to the target without any change.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: can you shorten these descriptions and put them on newlines?

@aws-cdk-automation aws-cdk-automation dismissed their stale review March 25, 2024 05:41

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Mar 25, 2024
/**
* Application Load Balancer removes the X-Forwarded-For header in the HTTP request before it sends it to targets.
*/
REMOVE = 'remove',
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: can you shorten these docs and move to multiple lines?

*
* @default false
*/
readonly xAmznTlsVersionAndCipherSuiteHeaders?: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

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

can you add @see values with links to AWS docs?

Copy link
Contributor

Choose a reason for hiding this comment

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

@badmintoncryer Since the urls are the same, I think it'd make more sense to add the @see one time under Properties for defining an Application Load Balancer ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@msambol I was unable to retrieve links for each attribute and ended up entering the same URL...
I made the revisions just as you suggested!

*
* @default false
*/
readonly preserveXffClientPort?: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

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

likewise for this and below, can you add @see ?

@badmintoncryer
Copy link
Contributor Author

@msambol Thank you for your review! I have updated comments.

denyAllIgwTraffic: false
denyAllIgwTraffic: false,

// Whether to preserve Host header in the request to the target
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: lowercase host

@@ -68,6 +70,74 @@ export interface ApplicationLoadBalancerProps extends BaseLoadBalancerProps {
* @default - Duration.seconds(3600)
*/
readonly clientKeepAlive?: Duration;

/**
* Indicates whether the Application Load Balancer should preserve the Host header in the HTTP request
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: host

Copy link
Contributor

@msambol msambol left a comment

Choose a reason for hiding this comment

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

Two small nits. Looks great 👍🏼

@badmintoncryer
Copy link
Contributor Author

@msambol Thank you very much!

@aws-cdk-automation aws-cdk-automation added pr/needs-maintainer-review This PR needs a review from a Core Team Member and removed pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. labels Apr 1, 2024
Copy link
Contributor

@GavinZZ GavinZZ left a comment

Choose a reason for hiding this comment

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

LGTM, thank you both for reviewing the PR and working on the PR!

Copy link
Contributor

mergify bot commented Apr 8, 2024

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

@aws-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Apr 8, 2024
Copy link
Contributor

mergify bot commented Apr 8, 2024

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

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: ca94a94
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@mergify mergify bot merged commit 067c4a5 into aws:main Apr 8, 2024
9 checks passed
Copy link
Contributor

mergify bot commented Apr 8, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved. p2 star-contributor [Pilot] contributed between 25-49 PRs to the CDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

elasticloadbalancingv2: support ALB attributes
4 participants