Skip to content

Commit

Permalink
Merge branch 'main' into epolon/cdk8s-v2
Browse files Browse the repository at this point in the history
  • Loading branch information
iliapolo committed Jul 6, 2022
2 parents 68d7193 + ebfbf54 commit e99edac
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
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

0 comments on commit e99edac

Please sign in to comment.