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

aws-ec2: InterfaceVpcEndpoint does not allow private DNS disabling #2556

Closed
strax opened this issue May 16, 2019 · 0 comments · Fixed by #2596 or MechanicalRock/tech-radar#14 · May be fixed by MechanicalRock/cdk-constructs#5, MechanicalRock/cdk-constructs#6 or MechanicalRock/cdk-constructs#7
Labels
bug This issue is a bug.

Comments

@strax
Copy link
Contributor

strax commented May 16, 2019

Describe the bug

The construct @aws-cdk/aws-ec2.InterfaceVpcEndpoint cannot be used to connect to endpoint services that do not support private DNS due to a logic bug.

The issue is at https://github.com/awslabs/aws-cdk/blob/master/packages/%40aws-cdk/aws-ec2/lib/vpc-endpoint.ts#L398 – if the user passes privateDnsEnabled: false to the construct props, the expression at the aforementioned line expands to false || true which always evaluates to true.

To Reproduce

Synthesize this:

 new InterfaceVpcEndpoint(this, "MyTestEndpoint", {
      service,
      vpc,
      privateDnsEnabled: false
})

The resulting template has property PrivateDnsEnabled: true in the endpoint resource definition.

Expected behavior

PrivateDnsEnabled is set to false iff it is missing (undefined) in props.

Version:

  • OS: MacOS 10.14.4
  • Programming Language: TypeScript
  • CDK Version: 0.31.0
@strax strax added the bug This issue is a bug. label May 16, 2019
CaerusKaru added a commit to CaerusKaru/aws-cdk that referenced this issue May 20, 2019
This was referenced Dec 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment