Skip to content

Commit

Permalink
fix(route53-targets): InterfaceVpcEndpointTarget incorrectly accepts …
Browse files Browse the repository at this point in the history
…an imported endpoint (aws#21523)

The `InterfaceVpcEndpointTarget` currently accepts an imported endpoint
`IInterfaceVpcEndpoint`, but the actual implementation requires access
to the `CfnVPCEndpoint` resource which is only available from the
`InterfaceVpcEndpoint`.

This appears as breaking, but I don't think it should be considered as
breaking since you can currently _only_ pass a `InterfaceVpcEndpoint`.

I thought about adding support for `IInterfaceVpcEndpoint`, but that
would require updating the `fromxxx` method to take the route53 zone and
the DNS name for the endpoint. If you need to know those values to use
this construct then you might as well just create a normal Route53
record.

closes aws#10432


----

### All Submissions:

* [ ] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)?
	* [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)?

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
corymhall authored and josephedward committed Aug 30, 2022
1 parent afd0c48 commit e485d80
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions allowed-breaking-changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ removed:@aws-cdk/aws-lambda-event-sources.SelfManagedKafkaEventSourceProps.onFai
# removed kubernetes version from EKS
removed:@aws-cdk/aws-eks.KubernetesVersion.V1_22

# change the type of vpcEndpoint from ec2.IInterfaceVpcEndpoint to ec2.InterfaceVpcEndpoint.
# even though it accepted IInterfaceVpcEndpoint, the actual implementation required a
# managed construct ec2.InterfaceVpcEndpoint
incompatible-argument:@aws-cdk/aws-route53-targets.InterfaceVpcEndpointTarget.<initializer>
# changed the type of requiresBootstrapStackVersion to Optional<number> (formerly number)
# to allow the CLI to skip validating the bootstrap stack when the stack is not needed
changed-type:@aws-cdk/cx-api.AssetManifestArtifact.requiresBootstrapStackVersion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import * as cdk from '@aws-cdk/core';
*/
export class InterfaceVpcEndpointTarget implements route53.IAliasRecordTarget {
private readonly cfnVpcEndpoint: ec2.CfnVPCEndpoint;
constructor(private readonly vpcEndpoint: ec2.IInterfaceVpcEndpoint) {
constructor(private readonly vpcEndpoint: ec2.InterfaceVpcEndpoint) {
this.cfnVpcEndpoint = this.vpcEndpoint.node.findChild('Resource') as ec2.CfnVPCEndpoint;
}

Expand Down

0 comments on commit e485d80

Please sign in to comment.