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): alb dualstack without public ipv4 #30248

Merged
merged 19 commits into from
Sep 13, 2024

Conversation

mazyu36
Copy link
Contributor

@mazyu36 mazyu36 commented May 17, 2024

Issue # (if applicable)

Closes #30256.

Reason for this change

ALB supported a new dual-stack ALB without public IPv4.

https://aws.amazon.com/jp/about-aws/whats-new/2024/05/application-load-balancer-ipv6-internet-clients/

Description of changes

Add IpAddressType.DUAL_STACK_WITHOUT_PUBLIC_IPV4

Description of how you validated changes

Add unit tests & 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 May 17, 2024 01:26
@github-actions github-actions bot added p2 valued-contributor [Pilot] contributed between 6-12 PRs to the CDK labels May 17, 2024
@mazyu36 mazyu36 marked this pull request as ready for review May 17, 2024 04:11
@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 May 17, 2024
@watany-dev
Copy link
Contributor

To cdkteam, why not keep the IpAddressType.DUAL_STACK_WITHOUT_PUBLIC_IPV4 identifier but add the IpAddressType.IPV6 alias? This is essentially easy to understand.

@go-to-k go-to-k mentioned this pull request May 17, 2024
2 tasks
@@ -186,6 +186,11 @@ export class ApplicationLoadBalancer extends BaseLoadBalancer implements IApplic
});

this.ipAddressType = props.ipAddressType ?? IpAddressType.IPV4;

if (props.ipAddressType === IpAddressType.DUAL_STACK_WITHOUT_PUBLIC_IPV4 && !props.internetFacing) {
throw new Error('dual-stack without public IPv4 address can only be used with internet-facing scheme.');
Copy link
Contributor

Choose a reason for hiding this comment

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

do you have the link of the document about this restriction?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@pahud
Thank you for your comment.
That restriction is not mentioned in the documentation, but it is stated on the management console.

image

If the internal scheme is selected, the "Dual-stack without public IPv4" option disappears and cannot be configured.

image

Copy link
Contributor

Choose a reason for hiding this comment

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

Awesome!

Copy link
Contributor

@pahud pahud left a comment

Choose a reason for hiding this comment

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

DUAL_STACK_WITHOUT_PUBLIC_IPV4 supports ALB only, should we have a check that if the elbv2 with that ipAddressType is not ALB we should throw the error?

Should we add this in base-load-balancer.ts?

    // DUAL_STACK_WITHOUT_PUBLIC_IPV4 only available for ALB
    if (additionalProps.ipAddressType === IpAddressType.DUAL_STACK_WITHOUT_PUBLIC_IPV4 &&
      additionalProps.type !== cxschema.LoadBalancerType.APPLICATION) {
      throw new Error(`'ipAddressType' DUAL_STACK_WITHOUT_PUBLIC_IPV4 can only be used with ALB, got ${additionalProps.type}`);
    }

@pahud
Copy link
Contributor

pahud commented May 17, 2024

To cdkteam, why not keep the IpAddressType.DUAL_STACK_WITHOUT_PUBLIC_IPV4 identifier but add the IpAddressType.IPV6 alias? This is essentially easy to understand.

At this moment, CFN does not have ipv6 in its IpAddressType. I would avoid using that because it could mean something else when CFN adds that in the future.

@mazyu36
Copy link
Contributor Author

mazyu36 commented May 17, 2024

DUAL_STACK_WITHOUT_PUBLIC_IPV4 supports ALB only, should we have a check that if the elbv2 with that ipAddressType is not ALB we should throw the error?

Should we add this in base-load-balancer.ts?

    // DUAL_STACK_WITHOUT_PUBLIC_IPV4 only available for ALB
    if (additionalProps.ipAddressType === IpAddressType.DUAL_STACK_WITHOUT_PUBLIC_IPV4 &&
      additionalProps.type !== cxschema.LoadBalancerType.APPLICATION) {
      throw new Error(`'ipAddressType' DUAL_STACK_WITHOUT_PUBLIC_IPV4 can only be used with ALB, got ${additionalProps.type}`);
    }

DUAL_STACK_WITHOUT_PUBLIC_IPV4 supports ALB only, should we have a check that if the elbv2 with that ipAddressType is not ALB we should throw the error?

Should we add this in base-load-balancer.ts?

    // DUAL_STACK_WITHOUT_PUBLIC_IPV4 only available for ALB
    if (additionalProps.ipAddressType === IpAddressType.DUAL_STACK_WITHOUT_PUBLIC_IPV4 &&
      additionalProps.type !== cxschema.LoadBalancerType.APPLICATION) {
      throw new Error(`'ipAddressType' DUAL_STACK_WITHOUT_PUBLIC_IPV4 can only be used with ALB, got ${additionalProps.type}`);
    }

@pahud
Thank you. I also thought it would be better to have validation.
I have added the validation and a unit test.

@urda
Copy link

urda commented May 20, 2024

Featured in the weekly roundup, adding this quickly will help teams drive lower costs.

@github-actions github-actions bot added effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. labels May 21, 2024
@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Jun 21, 2024
…balancingv2/test/integ.alb.dualstack-without-public-ipv4.ts

Co-authored-by: Calvin Combs <66279577+comcalvi@users.noreply.github.com>
@mazyu36
Copy link
Contributor Author

mazyu36 commented Jun 21, 2024

@comcalvi
Thank you for the review!
I've updated.

@mazyu36 mazyu36 requested a review from comcalvi June 21, 2024 19:04
@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

Copy link
Contributor

mergify bot commented Sep 11, 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-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Sep 11, 2024
Copy link
Contributor

mergify bot commented Sep 11, 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).

@mazyu36
Copy link
Contributor Author

mazyu36 commented Sep 11, 2024

@Mergifyio update

Copy link
Contributor

mergify bot commented Sep 11, 2024

update

❌ Mergify doesn't have permission to update

For security reasons, Mergify can't update this pull request. Try updating locally.
GitHub response: refusing to allow a GitHub App to create or update workflow .github/workflows/github-merit-badger.yml without workflows permission

@mazyu36
Copy link
Contributor Author

mazyu36 commented Sep 11, 2024

@Mergifyio refresh

Copy link
Contributor

mergify bot commented Sep 11, 2024

refresh

✅ Pull request refreshed

@mazyu36
Copy link
Contributor Author

mazyu36 commented Sep 11, 2024

@Mergifyio requeue

Copy link
Contributor

mergify bot commented Sep 11, 2024

requeue

❌ Command disallowed due to command restrictions in the Mergify configuration.

  • sender-permission>=write

@mazyu36
Copy link
Contributor Author

mazyu36 commented Sep 13, 2024

@Mergifyio update

Copy link
Contributor

mergify bot commented Sep 13, 2024

update

✅ Branch has been successfully updated

@mazyu36
Copy link
Contributor Author

mazyu36 commented Sep 13, 2024

@Mergifyio refresh

Copy link
Contributor

mergify bot commented Sep 13, 2024

refresh

✅ Pull request refreshed

Copy link
Contributor

mergify bot commented Sep 13, 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: 7da04b1
  • 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 4068af3 into aws:main Sep 13, 2024
9 checks passed
Copy link
Contributor

mergify bot commented Sep 13, 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).

Copy link

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 13, 2024
@mazyu36 mazyu36 deleted the alb-ipv6 branch September 13, 2024 06:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2 valued-contributor [Pilot] contributed between 6-12 PRs to the CDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

elbv2: IPv6 only support
6 participants