Describe the bug
Calling InterfaceVpcEndpoint.fromInterfaceVpcEndpointAttributes with the minimum required parameters like below can return an endpoint object that seemingly works but if you try to use it to allow connections, nothing happens.
const endpoint = InterfaceVpcEndpoint.fromInterfaceVpcEndpointAttributes(
this,
"Endpoint",
{
vpcEndpointId: "correct-id",
port: 443,
}
);
fargateService.connections.allowTo(endpoint, Port.tcp(443));
cdk diff shows no changes and after the deploy the connection is not allowed. If you add the optional securityGroups parameter to InterfaceVpcEndpointAttributes parameter of the call, then the endpoint works.
Also if the vpcEndpointId is wrong, it works exactly the same as with the correct id with a call such as above.
Expected Behavior
If an endpoint cannot be found with the given parameters, CDK should give an error like when importing other existing resources.
Current Behavior
There is no error, endpoint object's connections object can be used but nothing happens.
Reproduction Steps
- There is an existing interface endpoint defined outside of CDK.
- Import it using
const endpoint = InterfaceVpcEndpoint.fromInterfaceVpcEndpointAttributes( this, "Endpoint", { vpcEndpointId: "correct-id", port: 443, } );
- Grant access to some other resource to the endpoint, for example like
fargateService.connections.allowTo(endpoint, Port.tcp(443));
- Check cdk diff output for the stack, there's no changes.
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.31.1
Framework Version
2.37.1
Node.js Version
v16.10.0
OS
Mac OS Monterey
Language
Typescript
Language Version
4.7.4
Other information
No response
Describe the bug
Calling InterfaceVpcEndpoint.fromInterfaceVpcEndpointAttributes with the minimum required parameters like below can return an endpoint object that seemingly works but if you try to use it to allow connections, nothing happens.
cdk diff shows no changes and after the deploy the connection is not allowed. If you add the optional securityGroups parameter to InterfaceVpcEndpointAttributes parameter of the call, then the endpoint works.
Also if the vpcEndpointId is wrong, it works exactly the same as with the correct id with a call such as above.
Expected Behavior
If an endpoint cannot be found with the given parameters, CDK should give an error like when importing other existing resources.
Current Behavior
There is no error, endpoint object's connections object can be used but nothing happens.
Reproduction Steps
const endpoint = InterfaceVpcEndpoint.fromInterfaceVpcEndpointAttributes( this, "Endpoint", { vpcEndpointId: "correct-id", port: 443, } );fargateService.connections.allowTo(endpoint, Port.tcp(443));Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.31.1
Framework Version
2.37.1
Node.js Version
v16.10.0
OS
Mac OS Monterey
Language
Typescript
Language Version
4.7.4
Other information
No response