Closed TheToddLuci0 closed 11 months ago
The error message is just a jsii quirk - the issue is that it expects an InterfaceVpcEndpoint
, and you're passing an IInterfaceVpcEndpoint
. In other words, this doesn't work with imported endpoints.
Yes, that's correct, thanks @gshpychka
I should note that the underlying code requires that it's not imported, so this wouldn't work by design. https://github.com/aws/aws-cdk/blob/2abc59a9a145123458197d792772f3472167a736/packages/aws-cdk-lib/aws-route53-targets/lib/interface-vpc-endpoint-target.ts#L11
With the current contract, it's probably going to be easiest to use escape hatches to modify the ARecord
's default child's aliasTarget
property
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.
Another solution, perhaps a little less hacky, is to use CfnRecordSet:
route53.CfnRecordSet(self, "ARecord",
hosted_zone_id=<target_hosted_zone_id>,
type="A",
name=<record_name>,
alias_target=route53.CfnRecordSet.AliasTargetProperty(
dns_name=<vpce_dns_name>,
hosted_zone_id=<vpce_hosted_zone_id>,
),
)
You will need different properties from the VPCE (HostedZoneId and DNSName), which you can get using the AWS CLI command describe-vpc-endpoints.
Describe the bug
When calling
aws_ec2.InterfaceVpcEndpoint.from_interface_vpc_endpoint_attributes
the returned object is of typejsii._reference_map.InterfaceDynamicProxy
, while the doccumented return type isaws_ec2.IInterfaceVpcEndpoint
Expected Behavior
The return type should be
IInterfaceVpcEndpoint
Current Behavior
Reproduction Steps
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.102.0 (build 2abc59a)
Framework Version
No response
Node.js Version
v20.2.0
OS
Debian linux
Language
Python
Language Version
Python (3.11.5)
Other information
https://docs.aws.amazon.com/cdk/api/v2/python/aws_cdk.aws_ec2/InterfaceVpcEndpoint.html#aws_cdk.aws_ec2.InterfaceVpcEndpoint.from_interface_vpc_endpoint_attributes