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

feat(ec2): expose interface endpoint service shortname #20965

Merged
merged 2 commits into from
Jul 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion packages/@aws-cdk/aws-ec2/lib/vpc-endpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,10 +316,15 @@ export class InterfaceVpcEndpointAwsService implements IInterfaceVpcEndpointServ
public static readonly XRAY = new InterfaceVpcEndpointAwsService('xray');

/**
* The name of the service.
* The name of the service. e.g. com.amazonaws.us-east-1.ecs
*/
public readonly name: string;

/**
* The short name of the service. e.g. ecs
*/
public readonly shortName: string;

/**
* The port of the service.
*/
Expand Down Expand Up @@ -348,6 +353,7 @@ export class InterfaceVpcEndpointAwsService implements IInterfaceVpcEndpointServ
});

this.name = `${prefix || defaultEndpointPrefix}.${region}.${name}${defaultEndpointSuffix}`;
this.shortName = name;
this.port = port || 443;
}

Expand Down
7 changes: 7 additions & 0 deletions packages/@aws-cdk/aws-ec2/test/vpc-endpoint.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,13 @@ describe('vpc endpoint', () => {

});

describe('interface endpoint retains service name in shortName property', () => {
test('shortName property', () => {
expect(InterfaceVpcEndpointAwsService.ECS.shortName).toBe('ecs');
expect(InterfaceVpcEndpointAwsService.ECR_DOCKER.shortName).toBe('ecr.dkr');
});
});

describe('add interface endpoint to looked-up VPC', () => {
test('initial run', () => {
// GIVEN
Expand Down