Skip to content

Commit

Permalink
refactor(ecs): rename serviceDiscovery to cloudMap (#2979)
Browse files Browse the repository at this point in the history
Streamline the term "service discovery" to "AWS CloudMap" so that they are consistent.

Closes #2978.

BREAKING CHANGES:

* **ecs**: `serviceDiscovery` has been replaced with `cloudMap` in all methods and types.
  • Loading branch information
hencrice authored and rix0rrr committed Jun 21, 2019
1 parent 0535d36 commit db981bf
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
12 changes: 6 additions & 6 deletions packages/@aws-cdk/aws-ecs/lib/base/base-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export interface BaseServiceProps {
*
* @default - AWS Cloud Map service discovery is not enabled.
*/
readonly serviceDiscoveryOptions?: ServiceDiscoveryOptions;
readonly cloudMapOptions?: CloudMapOptions;

/**
* Whether the new long ARN format has been enabled on ECS services.
Expand Down Expand Up @@ -178,8 +178,8 @@ export abstract class BaseService extends Resource

this.cluster = props.cluster;

if (props.serviceDiscoveryOptions) {
this.enableServiceDiscovery(props.serviceDiscoveryOptions);
if (props.cloudMapOptions) {
this.enableCloudMap(props.cloudMapOptions);
}
}

Expand Down Expand Up @@ -333,7 +333,7 @@ export abstract class BaseService extends Resource
/**
* Enable CloudMap service discovery for the service
*/
private enableServiceDiscovery(options: ServiceDiscoveryOptions): cloudmap.Service {
private enableCloudMap(options: CloudMapOptions): cloudmap.Service {
const sdNamespace = this.cluster.defaultNamespace;
if (sdNamespace === undefined) {
throw new Error("Cannot enable service discovery if a Cloudmap Namespace has not been created in the cluster.");
Expand Down Expand Up @@ -409,9 +409,9 @@ export abstract class BaseService extends Resource
const EPHEMERAL_PORT_RANGE = ec2.Port.tcpRange(32768, 65535);

/**
* Options for enabling service discovery on an ECS service
* Options for enabling CloudMap on an ECS service
*/
export interface ServiceDiscoveryOptions {
export interface CloudMapOptions {
/**
* Name of the cloudmap service to attach to the ECS Service
*
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-ecs/test/ec2/integ.sd-awsvpc-nw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ frontend.addPortMappings({
new ecs.Ec2Service(stack, "FrontendService", {
cluster,
taskDefinition: frontendTD,
serviceDiscoveryOptions: {
cloudMapOptions: {
name: "frontend"
}
});
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-ecs/test/ec2/integ.sd-bridge-nw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ frontend.addPortMappings({
new ecs.Ec2Service(stack, "FrontendService", {
cluster,
taskDefinition: frontendTD,
serviceDiscoveryOptions: {
cloudMapOptions: {
name: "frontend"
}
});
Expand Down
14 changes: 7 additions & 7 deletions packages/@aws-cdk/aws-ecs/test/ec2/test.ec2-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ export = {
new ecs.Ec2Service(stack, 'Service', {
cluster,
taskDefinition,
serviceDiscoveryOptions: {
cloudMapOptions: {
name: 'myApp',
}
});
Expand Down Expand Up @@ -663,7 +663,7 @@ export = {
new ecs.Ec2Service(stack, 'Service', {
cluster,
taskDefinition,
serviceDiscoveryOptions: {
cloudMapOptions: {
name: 'myApp',
}
});
Expand Down Expand Up @@ -696,7 +696,7 @@ export = {
new ecs.Ec2Service(stack, 'Service', {
cluster,
taskDefinition,
serviceDiscoveryOptions: {
cloudMapOptions: {
name: 'myApp',
}
});
Expand Down Expand Up @@ -773,7 +773,7 @@ export = {
new ecs.Ec2Service(stack, 'Service', {
cluster,
taskDefinition,
serviceDiscoveryOptions: {
cloudMapOptions: {
name: 'myApp',
}
});
Expand Down Expand Up @@ -849,7 +849,7 @@ export = {
new ecs.Ec2Service(stack, 'Service', {
cluster,
taskDefinition,
serviceDiscoveryOptions: {
cloudMapOptions: {
name: 'myApp',
dnsRecordType: cloudmap.DnsRecordType.A
}
Expand Down Expand Up @@ -884,7 +884,7 @@ export = {
new ecs.Ec2Service(stack, 'Service', {
cluster,
taskDefinition,
serviceDiscoveryOptions: {
cloudMapOptions: {
name: 'myApp',
}
});
Expand Down Expand Up @@ -959,7 +959,7 @@ export = {
new ecs.Ec2Service(stack, 'Service', {
cluster,
taskDefinition,
serviceDiscoveryOptions: {
cloudMapOptions: {
name: 'myApp',
dnsRecordType: cloudmap.DnsRecordType.SRV
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ export = {
new ecs.FargateService(stack, 'Service', {
cluster,
taskDefinition,
serviceDiscoveryOptions: {
cloudMapOptions: {
name: 'myApp',
}
});
Expand Down Expand Up @@ -373,7 +373,7 @@ export = {
new ecs.FargateService(stack, 'Service', {
cluster,
taskDefinition,
serviceDiscoveryOptions: {
cloudMapOptions: {
name: 'myApp'
}
});
Expand Down Expand Up @@ -433,7 +433,7 @@ export = {
new ecs.FargateService(stack, 'Service', {
cluster,
taskDefinition,
serviceDiscoveryOptions: {
cloudMapOptions: {
name: 'myApp',
dnsRecordType: cloudmap.DnsRecordType.SRV
}
Expand Down

0 comments on commit db981bf

Please sign in to comment.