Skip to content

Commit

Permalink
feat(ec2): vpc endpoint for aws keyspaces (#16306)
Browse files Browse the repository at this point in the history
Adds a static instance of InterfaceVpcEndpointAwsService for the AWS
Keyspaces service so that users do not need to define it manually.
Keyspaces uses a custom TCP port (9142), so this avoids confusion.


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
dchenbec authored Sep 3, 2021
1 parent 1d94646 commit ad425d0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/@aws-cdk/aws-ec2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,14 @@ new InterfaceVpcEndpoint(stack, 'VPC Endpoint', {
});
```

Pre-defined AWS services are defined in the [InterfaceVpcEndpointAwsService](lib/vpc-endpoint.ts) class, and can be used to
create VPC endpoints without having to configure name, ports, etc. For example, a Keyspaces endpoint can be created for
use in your VPC:

``` ts
new InterfaceVpcEndpoint(stack, 'VPC Endpoint', { vpc, service: InterfaceVpcEndpointAwsService.KEYSPACES });
```

#### Security groups for interface VPC endpoints

By default, interface VPC endpoints create a new security group and traffic is **not**
Expand Down
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-ec2/lib/vpc-endpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ export class InterfaceVpcEndpointAwsService implements IInterfaceVpcEndpointServ
public static readonly CODECOMMIT_GIT = new InterfaceVpcEndpointAwsService('git-codecommit');
public static readonly CODECOMMIT_GIT_FIPS = new InterfaceVpcEndpointAwsService('git-codecommit-fips');
public static readonly GLUE = new InterfaceVpcEndpointAwsService('glue');
public static readonly KEYSPACES = new InterfaceVpcEndpointAwsService('cassandra', '', 9142);
public static readonly KINESIS_STREAMS = new InterfaceVpcEndpointAwsService('kinesis-streams');
public static readonly KINESIS_FIREHOSE = new InterfaceVpcEndpointAwsService('kinesis-firehose');
public static readonly KMS = new InterfaceVpcEndpointAwsService('kms');
Expand Down
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-ec2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@
"docs-public-apis:@aws-cdk/aws-ec2.InterfaceVpcEndpointAwsService.ELASTIC_INFERENCE_RUNTIME",
"docs-public-apis:@aws-cdk/aws-ec2.InterfaceVpcEndpointAwsService.ELASTIC_LOAD_BALANCING",
"docs-public-apis:@aws-cdk/aws-ec2.InterfaceVpcEndpointAwsService.GLUE",
"docs-public-apis:@aws-cdk/aws-ec2.InterfaceVpcEndpointAwsService.KEYSPACES",
"docs-public-apis:@aws-cdk/aws-ec2.InterfaceVpcEndpointAwsService.KINESIS_STREAMS",
"docs-public-apis:@aws-cdk/aws-ec2.InterfaceVpcEndpointAwsService.KINESIS_FIREHOSE",
"docs-public-apis:@aws-cdk/aws-ec2.InterfaceVpcEndpointAwsService.KMS",
Expand Down

0 comments on commit ad425d0

Please sign in to comment.