Skip to content

Commit d60d673

Browse files
authored
fix: make capitalization of Ip/Az consistent (#3202)
Fix short miscapitalizations of an abbreviation with a lowercase suffix; they would not get properly translated into Python. BREAKING CHANGE: in all identifiers, renamed `IPv4` => `Ipv4`, `IPv6` => `Ipv6`, `AZs` => `Azs`.
1 parent 6a79180 commit d60d673

File tree

51 files changed

+93
-87
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+93
-87
lines changed

allowed-breaking-changes.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
removed:@aws-cdk/aws-ec2.Port.toRuleJSON
22
change-return-type:@aws-cdk/aws-codebuild.PipelineProject.addSecondaryArtifact
33
change-return-type:@aws-cdk/aws-codebuild.Project.addSecondaryArtifact
4-
4+
removed:@aws-cdk/aws-ec2.Connections.allowFromAnyIPv4
5+
removed:@aws-cdk/aws-ec2.Connections.allowToAnyIPv4
6+
removed:@aws-cdk/aws-ec2.VpcProps.maxAZs
7+
removed:@aws-cdk/aws-elasticloadbalancingv2.ApplicationLoadBalancer.metricIPv6ProcessedBytes
8+
removed:@aws-cdk/aws-elasticloadbalancingv2.ApplicationLoadBalancer.metricIPv6RequestCount
9+
removed:@aws-cdk/aws-elasticloadbalancingv2.ApplicationTargetGroup.metricIPv6RequestCount
10+
removed:@aws-cdk/core.Fn.getAZs

design/aws-ecs/aws-ecs-autoscaling-queue-worker.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# AWS ECS - L3 Construct for Autoscaling ECS/Fargate Service that Processes Items in a SQS Queue
22

3-
To address issue [#2396](https://github.com/awslabs/aws-cdk/issues/2396), the AWS ECS CDK construct library should provide a way for customers to create a queue processing service (an AWS ECS/Fargate service that processes items from an sqs queue). This would mean adding new ECS CDK constructs `QueueProcessingEc2Service` and `QueueProcessingFargateService`, that would take in the necessary properties required to create a task definition, an SQS queue as well as an ECS/Fargate service and enable autoscaling for the service based on cpu usage and the SQS queue's approximateNumberOfMessagesVisible metric.
3+
To address issue [#2396](https://github.com/awslabs/aws-cdk/issues/2396), the AWS ECS CDK construct library should provide a way for customers to create a queue processing service (an AWS ECS/Fargate service that processes items from an sqs queue). This would mean adding new ECS CDK constructs `QueueProcessingEc2Service` and `QueueProcessingFargateService`, that would take in the necessary properties required to create a task definition, an SQS queue as well as an ECS/Fargate service and enable autoscaling for the service based on cpu usage and the SQS queue's approximateNumberOfMessagesVisible metric.
44

55
## General approach
66

@@ -9,7 +9,7 @@ The new `ecs.QueueProcessingServiceBase`, `ecs.QueueProcessingEc2Service` and `e
99
* QueueProcessingEc2Service
1010
* QueueProcessingFargateService
1111

12-
A `QueueProcessingService` will create a task definition with the specified container (on both EC2 and Fargate). An AWS SQS `Queue` will be created and autoscaling of the ECS Service will be dependent on both CPU as well as the SQS queue's `ApproximateNumberOfMessagesVisible` metric.
12+
A `QueueProcessingService` will create a task definition with the specified container (on both EC2 and Fargate). An AWS SQS `Queue` will be created and autoscaling of the ECS Service will be dependent on both CPU as well as the SQS queue's `ApproximateNumberOfMessagesVisible` metric.
1313

1414
The `QueueProcessingService` constructs (for EC2 and Fargate) will use the following existing constructs:
1515

@@ -24,7 +24,7 @@ Given the above, we should make the following changes to support queue processin
2424
2. Create `QueueProcessingEc2ServiceProps` interface and `QueueProcessingEc2Service` construct
2525
3. Create `QueueProcessingFargateServiceProps` interface and `QueueProcessingFargateService` construct
2626

27-
### Part 1: Create `QueueProcessingServiceBaseProps` interface and `QueueProcessingServiceBase` construct
27+
### Part 1: Create `QueueProcessingServiceBaseProps` interface and `QueueProcessingServiceBase` construct
2828

2929
The `QueueProcessingServiceBaseProps` interface will contain common properties used to construct both the QueueProcessingEc2Service and the QueueProcessingFargateService:
3030

@@ -93,14 +93,14 @@ export interface QueueProcessingServiceBaseProps {
9393
*
9494
* Maps a range of metric values to a particular scaling behavior.
9595
* https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scaling-simple-step.html
96-
*
96+
*
9797
* @default [{ upper: 0, change: -1 },{ lower: 100, change: +1 },{ lower: 500, change: +5 }]
9898
*/
9999
readonly scalingSteps: autoScaling.ScalingInterval[];
100100
}
101101
```
102102

103-
### Part 2: Create `QueueProcessingEc2ServiceProps` interface and `QueueProcessingEc2Service` construct
103+
### Part 2: Create `QueueProcessingEc2ServiceProps` interface and `QueueProcessingEc2Service` construct
104104

105105
The `QueueProcessingEc2ServiceProps` interface will contain properties to construct the Ec2TaskDefinition, SQSQueue and Ec2Service:
106106

@@ -147,12 +147,12 @@ export interface QueueProcessingEc2ServiceProps {
147147
An example use case:
148148
```ts
149149
// Create the vpc and cluster used by the queue processing service
150-
const vpc = new ec2.Vpc(stack, 'Vpc', { maxAZs: 1 });
150+
const vpc = new ec2.Vpc(stack, 'Vpc', { maxAzs: 1 });
151151
const cluster = new ecs.Cluster(stack, 'EcsCluster', { vpc });
152152
cluster.addCapacity('DefaultAutoScalingGroup', {
153153
instanceType: new ec2.InstanceType('t2.micro')
154154
});
155-
const queue = new sqs.Queue(stack, 'ProcessingQueue', {
155+
const queue = new sqs.Queue(stack, 'ProcessingQueue', {
156156
QueueName: 'EcsEventQueue'
157157
});
158158

@@ -168,7 +168,7 @@ new QueueProcessingEc2Service(stack, 'QueueProcessingEc2Service', {
168168
});
169169
```
170170

171-
### Part 3: Create `QueueProcessingFargateServiceProps` interface and `QueueProcessingFargateService` construct
171+
### Part 3: Create `QueueProcessingFargateServiceProps` interface and `QueueProcessingFargateService` construct
172172

173173
The `QueueProcessingFargateServiceProps` interface will contain properties to construct the FargateTaskDefinition, SQSQueue and FargateService:
174174

@@ -219,9 +219,9 @@ export interface QueueProcessingFargateServiceProps {
219219
An example use case:
220220
```ts
221221
// Create the vpc and cluster used by the queue processing service
222-
const vpc = new ec2.Vpc(stack, 'Vpc', { maxAZs: 2 });
222+
const vpc = new ec2.Vpc(stack, 'Vpc', { maxAzs: 2 });
223223
const cluster = new ecs.Cluster(stack, 'FargateCluster', { vpc });
224-
const queue = new sqs.Queue(stack, 'ProcessingQueue', {
224+
const queue = new sqs.Queue(stack, 'ProcessingQueue', {
225225
QueueName: 'FargateEventQueue'
226226
});
227227

design/aws-ecs/aws-ecs-scheduled-ecs-task-construct.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ The new [`ecs.ScheduledEc2Task`] class will include an L3 construct for:
1919

2020
* ScheduledEc2Task
2121

22-
A `ScheduledEc2Task` will create a task definition with the specified container. An `Ec2EventRuleTarget` will be created and associated as the target to an `Amazon Cloudwatch Event Rule` (indicating how frequently the task should be run). Based on the `Amazon Cloudwatch Event Rule` schedule, a task will run on the EC2 instances specified in the cluster.
22+
A `ScheduledEc2Task` will create a task definition with the specified container. An `Ec2EventRuleTarget` will be created and associated as the target to an `Amazon Cloudwatch Event Rule` (indicating how frequently the task should be run). Based on the `Amazon Cloudwatch Event Rule` schedule, a task will run on the EC2 instances specified in the cluster.
2323

2424
## Code changes
2525

2626
Given the above, we should make the following changes to support scheduled tasks on ECS:
2727
1. Create `ScheduledEc2TaskProps` interface and `ScheduledEc2Task` construct
2828

29-
# Part 1: Create `ScheduledEc2TaskProps` interface and `ScheduledEc2Task` construct
29+
# Part 1: Create `ScheduledEc2TaskProps` interface and `ScheduledEc2Task` construct
3030

3131
The `ScheduledEc2TaskProps` interface will contain properties to construct the Ec2TaskDefinition, Ec2EventRuleTarget and EventRule:
3232

@@ -55,14 +55,14 @@ export interface ScheduledEc2TaskProps {
5555

5656
/**
5757
* The CMD value to pass to the container. A string with commands delimited by commas.
58-
*
58+
*
5959
* @default none
6060
*/
6161
readonly command?: string;
6262

6363
/**
6464
* The minimum number of CPU units to reserve for the container.
65-
*
65+
*
6666
* @default none
6767
*/
6868
readonly cpu?: number;
@@ -76,7 +76,7 @@ export interface ScheduledEc2TaskProps {
7676

7777
/**
7878
* The environment variables to pass to the container.
79-
*
79+
*
8080
* @default none
8181
*/
8282
readonly environment?: { [key: string]: string };
@@ -118,7 +118,7 @@ The `ScheduledEc2Task` construct will use the following existing constructs:
118118
An example use case to create a task that is scheduled to run every minute:
119119
```ts
120120
// Create the vpc and cluster used by the scheduled task
121-
const vpc = new ec2.Vpc(stack, 'Vpc', { maxAZs: 1 });
121+
const vpc = new ec2.Vpc(stack, 'Vpc', { maxAzs: 1 });
122122
const cluster = new ecs.Cluster(stack, 'EcsCluster', { vpc });
123123
cluster.addCapacity('DefaultAutoScalingGroup', {
124124
instanceType: new ec2.InstanceType('t2.micro')

design/aws-ecs/aws-ecs-service-discovery-integration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export interface ServiceDiscoveryOptions {
122122
A full example would look like the following:
123123

124124
```
125-
const vpc = new ec2.Vpc(stack, 'Vpc', { maxAZs: 2 });
125+
const vpc = new ec2.Vpc(stack, 'Vpc', { maxAzs: 2 });
126126
127127
// Cloud Map Namespace
128128
const namespace = new servicediscovery.PrivateDnsNamespace(stack, 'MyNamespace', {

packages/@aws-cdk/aws-autoscaling/test/integ.amazonlinux2.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const app = new cdk.App();
77
const stack = new cdk.Stack(app, 'aws-cdk-autoscaling-integ');
88

99
const vpc = new ec2.Vpc(stack, 'VPC', {
10-
maxAZs: 2
10+
maxAzs: 2
1111
});
1212

1313
new autoscaling.AutoScalingGroup(stack, 'Fleet', {

packages/@aws-cdk/aws-autoscaling/test/integ.asg-w-classic-loadbalancer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const app = new cdk.App();
88
const stack = new cdk.Stack(app, 'aws-cdk-asg-integ');
99

1010
const vpc = new ec2.Vpc(stack, 'VPC', {
11-
maxAZs: 3
11+
maxAzs: 3
1212
});
1313

1414
const asg = new autoscaling.AutoScalingGroup(stack, 'Fleet', {

packages/@aws-cdk/aws-autoscaling/test/integ.asg-w-elbv2.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const app = new cdk.App();
88
const stack = new cdk.Stack(app, 'aws-cdk-asg-integ');
99

1010
const vpc = new ec2.Vpc(stack, 'VPC', {
11-
maxAZs: 2
11+
maxAzs: 2
1212
});
1313

1414
const asg = new autoscaling.AutoScalingGroup(stack, 'Fleet', {

packages/@aws-cdk/aws-autoscaling/test/integ.custom-scaling.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const app = new cdk.App();
77
const stack = new cdk.Stack(app, 'aws-cdk-autoscaling-integ');
88

99
const vpc = new ec2.Vpc(stack, 'VPC', {
10-
maxAZs: 2
10+
maxAzs: 2
1111
});
1212

1313
const asg = new autoscaling.AutoScalingGroup(stack, 'Fleet', {
@@ -30,4 +30,4 @@ asg.scaleOnCpuUtilization('KeepCPUReasonable', {
3030
targetUtilizationPercent: 50
3131
});
3232

33-
app.synth();
33+
app.synth();

packages/@aws-cdk/aws-autoscaling/test/integ.spot-instances.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const app = new cdk.App();
77
const stack = new cdk.Stack(app, 'aws-cdk-autoscaling-integ');
88

99
const vpc = new ec2.Vpc(stack, 'VPC', {
10-
maxAZs: 2
10+
maxAzs: 2
1111
});
1212

1313
new autoscaling.AutoScalingGroup(stack, 'Fleet', {

packages/@aws-cdk/aws-codebuild/test/integ.project-vpc.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const app = new cdk.App();
77

88
const stack = new cdk.Stack(app, 'aws-cdk-codebuild-project-vpc');
99
const vpc = new ec2.Vpc(stack, 'MyVPC', {
10-
maxAZs: 1,
10+
maxAzs: 1,
1111
natGateways: 1,
1212
});
1313
const securityGroup = new ec2.SecurityGroup(stack, 'SecurityGroup1', {

0 commit comments

Comments
 (0)