Skip to content

Conversation

@badmintoncryer
Copy link
Contributor

Issue # (if applicable)

None

Reason for this change

Cloudformation supports for configuring client route enforcement feature for client VPN endpoint.

Description of changes

  • Add enableClientRouteEnforcement prop to ClientVpnEndpointProps

Describe any new or updated permissions being added

None

Description of how you validated changes

Add 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

@github-actions github-actions bot added the p2 label May 9, 2025
@aws-cdk-automation aws-cdk-automation requested a review from a team May 9, 2025 13:42
@github-actions github-actions bot added the distinguished-contributor [Pilot] contributed 50+ PRs to the CDK label May 9, 2025
@badmintoncryer badmintoncryer marked this pull request as ready for review May 9, 2025 13:48
@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 9, 2025
Copy link
Contributor

@mazyu36 mazyu36 left a comment

Choose a reason for hiding this comment

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

Thank you for the contribution.
I've added a nit comment.

@badmintoncryer
Copy link
Contributor Author

@mazyu36 Thank you for your review! I've reflected your suggestions.

@mazyu36
Copy link
Contributor

mazyu36 commented Jun 11, 2025

LGTM.
But something went wrong...

@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 12, 2025
Copy link
Contributor

@mazyu36 mazyu36 left a comment

Choose a reason for hiding this comment

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

Thanks!

@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Jun 12, 2025
@badmintoncryer
Copy link
Contributor Author

@mazyu36 Thanks always!

@kumsmrit kumsmrit self-assigned this Jun 12, 2025
Copy link
Contributor

@kumsmrit kumsmrit left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution; I have added few comments.


Use the `connections` object of the endpoint to allow traffic to other security groups.

To enable [client route enforcement](https://docs.aws.amazon.com/vpn/latest/clientvpn-admin/cvpn-working-cre.html), set the `clientRouteEnforcement` prop to `true`:
Copy link
Contributor

Choose a reason for hiding this comment

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

Property name should be enableClientRouteEnforcement.

*
* @default undefined - AWS Client VPN default setting is false
*/
readonly enableClientRouteEnforcement?: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

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

The AWS Client VPN docs note that Client Route Enforcement only works in full-tunnel mode, and will silently have no effect if split-tunnel is enabled (see: https://docs.aws.amazon.com/vpn/latest/clientvpn-admin/cvpn-working-cre.html). To prevent users from creating such configurations that won't work as expected, we could add a validation check:

if (props.enableClientRouteEnforcement && props.splitTunnel) {
  throw new ValidationError(
    'Client Route Enforcement cannot be enabled when splitTunnel is true',
    this
  );
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! I have not realized this restriction.

* @see https://docs.aws.amazon.com/vpn/latest/clientvpn-admin/cvpn-working-cre.html
*
* @default undefined - AWS Client VPN default setting is false
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

For future extensibility, we can consider using an interface approach instead of direct boolean flag:

interface ClientRouteEnforcementOptions {
 readonly enforced: boolean;
}
readonly clientRouteEnforcementOptions?: ClientRouteEnforcementOptions;

This would align with CFN structure (see: aws-properties-ec2-clientvpnendpoint-clientrouteenforcementoptions and would be forward compatible if more properties are added to ClientRouteEnforcementOptions. Moving from a boolean flag to an interface later would be a breaking change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure. I've updated my implementation to define ClientRouteEnforcemnetOptions.

@aws-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Jun 17, 2025
@mergify mergify bot dismissed kumsmrit’s stale review June 18, 2025 13:00

Pull request has been modified.

@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Jun 18, 2025
@mergify
Copy link
Contributor

mergify bot commented Jun 23, 2025

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: 5deb544
  • 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 Jun 23, 2025

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

@mergify mergify bot merged commit 063f4e7 into aws:main Jun 23, 2025
17 checks passed
@github-actions
Copy link
Contributor

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 Jun 23, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

distinguished-contributor [Pilot] contributed 50+ PRs to the CDK p2 pr/needs-maintainer-review This PR needs a review from a Core Team Member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants