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

chore(release): 1.94.0 #13612

Merged
merged 16 commits into from
Mar 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
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
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,36 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [1.94.0](https://github.com/aws/aws-cdk/compare/v1.93.0...v1.94.0) (2021-03-16)


### ⚠ BREAKING CHANGES TO EXPERIMENTAL FEATURES

* **appmesh:** Backend, backend default and Virtual Service client policies structures are being altered
* **appmesh**: you must use the backend default interface to define backend defaults in `VirtualGateway`.
The property name also changed from `backendsDefaultClientPolicy` to `backendDefaults`
* **appmesh**: you must use the backend default interface to define backend defaults in `VirtualNode`,
(the property name also changed from `backendsDefaultClientPolicy` to `backendDefaults`),
and the `Backend` class to define a backend
* **appmesh**: you can no longer attach a client policy to a `VirtualService`

### Features

* **appmesh:** add missing route match features ([#13350](https://github.com/aws/aws-cdk/issues/13350)) ([b71efd9](https://github.com/aws/aws-cdk/commit/b71efd9d12843ab4b495d53e565cec97d60748f3)), closes [#11645](https://github.com/aws/aws-cdk/issues/11645)
* **aws-elasticloadbalancingv2:** add protocol version for ALB TargetGroups ([#13570](https://github.com/aws/aws-cdk/issues/13570)) ([165a3d8](https://github.com/aws/aws-cdk/commit/165a3d877b7ab23f29e42e1e74ee7c5cb35b7f24)), closes [#12869](https://github.com/aws/aws-cdk/issues/12869)
* **ecs-patterns:** Add ECS deployment circuit breaker support to higher-level constructs ([#12719](https://github.com/aws/aws-cdk/issues/12719)) ([e80a98a](https://github.com/aws/aws-cdk/commit/e80a98aa8839e9b9b89701158d82b991e9ebaa65)), closes [#12534](https://github.com/aws/aws-cdk/issues/12534) [#12360](https://github.com/aws/aws-cdk/issues/12360)


### Bug Fixes

* **appmesh:** Move Client Policy from Virtual Service to backend structure ([#12943](https://github.com/aws/aws-cdk/issues/12943)) ([d3f4284](https://github.com/aws/aws-cdk/commit/d3f428435976c55ca950279cfc841665fd504370)), closes [#11996](https://github.com/aws/aws-cdk/issues/11996)
* **autoscaling:** AutoScaling on percentile metrics doesn't work ([#13366](https://github.com/aws/aws-cdk/issues/13366)) ([46114bb](https://github.com/aws/aws-cdk/commit/46114bb1f4702019a8873b9162d0a9f10763bc61)), closes [#13144](https://github.com/aws/aws-cdk/issues/13144)
* **cloudwatch:** cannot create Alarms from labeled metrics that start with a digit ([#13560](https://github.com/aws/aws-cdk/issues/13560)) ([278029f](https://github.com/aws/aws-cdk/commit/278029f25b41d956091835364e5a8de91429712c)), closes [#13434](https://github.com/aws/aws-cdk/issues/13434)
* use NodeJS 14 for all packaged custom resources ([#13488](https://github.com/aws/aws-cdk/issues/13488)) ([20a2820](https://github.com/aws/aws-cdk/commit/20a2820ee4d022663fcd0928fbc0f61153ae953f)), closes [#13534](https://github.com/aws/aws-cdk/issues/13534) [#13484](https://github.com/aws/aws-cdk/issues/13484)
* **ec2:** Security Groups support all protocols ([#13593](https://github.com/aws/aws-cdk/issues/13593)) ([8c6b3eb](https://github.com/aws/aws-cdk/commit/8c6b3ebea464e27f68ffcab32857d8baec29c413)), closes [#13403](https://github.com/aws/aws-cdk/issues/13403)
* **lambda:** fromDockerBuild output is located under /asset ([#13539](https://github.com/aws/aws-cdk/issues/13539)) ([77449f6](https://github.com/aws/aws-cdk/commit/77449f61e7075fef1240fc52becb8ea60b9ea9ad)), closes [#13439](https://github.com/aws/aws-cdk/issues/13439)
* **region-info:** ap-northeast-3 data not correctly registered ([#13564](https://github.com/aws/aws-cdk/issues/13564)) ([64da84b](https://github.com/aws/aws-cdk/commit/64da84be5c60bb8132551bcc27a7ca9c7effe95d)), closes [#13561](https://github.com/aws/aws-cdk/issues/13561)

## [1.93.0](https://github.com/aws/aws-cdk/compare/v1.92.0...v1.93.0) (2021-03-11)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ export class AppMeshExtension extends ServiceExtension {
// Next update the app mesh config so that the local Envoy
// proxy on this service knows how to route traffic to
// nodes from the other service.
this.virtualNode.addBackend(otherAppMesh.virtualService);
this.virtualNode.addBackend(appmesh.Backend.virtualService(otherAppMesh.virtualService));
}

private routeSpec(weightedTargets: appmesh.WeightedTarget[], serviceName: string): appmesh.RouteSpec {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1349,7 +1349,6 @@
"MeshName"
]
},
"RouteName": "name-route",
"Spec": {
"HttpRoute": {
"Action": {
Expand All @@ -1375,7 +1374,8 @@
"namevirtualrouterC00E1ACE",
"VirtualRouterName"
]
}
},
"RouteName": "name-route"
}
},
"namevirtualservice3DDDDF1E": {
Expand Down Expand Up @@ -2218,7 +2218,6 @@
"MeshName"
]
},
"RouteName": "greeting-route",
"Spec": {
"HttpRoute": {
"Action": {
Expand All @@ -2244,7 +2243,8 @@
"greetingvirtualrouter0F898D1A",
"VirtualRouterName"
]
}
},
"RouteName": "greeting-route"
}
},
"greetingvirtualservice60AD3AD9": {
Expand Down Expand Up @@ -3242,7 +3242,6 @@
"MeshName"
]
},
"RouteName": "greeter-route",
"Spec": {
"HttpRoute": {
"Action": {
Expand All @@ -3268,7 +3267,8 @@
"greetervirtualrouter193840BB",
"VirtualRouterName"
]
}
},
"RouteName": "greeter-route"
}
},
"greetervirtualservice6559950C": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,7 @@
}
},
"Handler": "framework.onEvent",
"Runtime": "nodejs10.x",
"Runtime": "nodejs14.x",
"Timeout": 900
},
"DependsOn": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1537,7 +1537,6 @@
"MeshName"
]
},
"RouteName": "name-production-route",
"Spec": {
"HttpRoute": {
"Action": {
Expand All @@ -1563,7 +1562,8 @@
"nameproductionvirtualrouter00E3366D",
"VirtualRouterName"
]
}
},
"RouteName": "name-production-route"
}
},
"nameproductionvirtualservice4D49D5F6": {
Expand Down Expand Up @@ -2061,7 +2061,6 @@
"MeshName"
]
},
"RouteName": "name-development-route",
"Spec": {
"HttpRoute": {
"Action": {
Expand All @@ -2087,7 +2086,8 @@
"namedevelopmentvirtualrouter0AE5105D",
"VirtualRouterName"
]
}
},
"RouteName": "name-development-route"
}
},
"namedevelopmentvirtualserviceD936E3FD": {
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-apigateway/lib/cors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export interface CorsOptions {
* Access-Control-Allow-Methods and Access-Control-Allow-Headers headers)
* can be cached.
*
* To disable caching altogther use `disableCache: true`.
* To disable caching altogether use `disableCache: true`.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Max-Age
* @default - browser-specific (see reference)
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-apigateway/lib/gateway-response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export class ResponseType {
*/
public static readonly WAF_FILTERED = new ResponseType('WAF_FILTERED');

/** A custom response type to suppport future cases. */
/** A custom response type to support future cases. */
public static of(type: string): ResponseType {
return new ResponseType(type.toUpperCase());
}
Expand Down
6 changes: 3 additions & 3 deletions packages/@aws-cdk/aws-apigateway/lib/resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,12 +282,12 @@ export abstract class ResourceBase extends ResourceConstruct implements IResourc
// prepare responseParams

const integrationResponseParams: { [p: string]: string } = { };
const methodReponseParams: { [p: string]: boolean } = { };
const methodResponseParams: { [p: string]: boolean } = { };

for (const [name, value] of Object.entries(headers)) {
const key = `method.response.header.${name}`;
integrationResponseParams[key] = value;
methodReponseParams[key] = true;
methodResponseParams[key] = true;
}

return this.addMethod('OPTIONS', new MockIntegration({
Expand All @@ -297,7 +297,7 @@ export abstract class ResourceBase extends ResourceConstruct implements IResourc
],
}), {
methodResponses: [
{ statusCode: `${statusCode}`, responseParameters: methodReponseParams },
{ statusCode: `${statusCode}`, responseParameters: methodResponseParams },
],
});

Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-apigateway/lib/restapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ export interface RestApiBaseProps {

/**
* Represents the props that all Rest APIs share.
* @deprecated - superceded by `RestApiBaseProps`
* @deprecated - superseded by `RestApiBaseProps`
*/
export interface RestApiOptions extends RestApiBaseProps, ResourceOptions {
}
Expand Down Expand Up @@ -441,7 +441,7 @@ export abstract class RestApiBase extends Resource implements IRestApi {
/**
* Metric for the total number API requests in a given period.
*
* Default: samplecount over 5 minutes
* Default: sample count over 5 minutes
*/
public metricCount(props?: cloudwatch.MetricOptions): cloudwatch.Metric {
return this.cannedMetric(ApiGatewayMetrics.countSum, {
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-apigateway/lib/usage-plan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export class UsagePlan extends Resource {
public addApiKey(apiKey: IApiKey): void {
const prefix = 'UsagePlanKeyResource';

// Postfixing apikey id only from the 2nd child, to keep physicalIds of UsagePlanKey for existing CDK apps unmodifed.
// Postfixing apikey id only from the 2nd child, to keep physicalIds of UsagePlanKey for existing CDK apps unmodified.
const id = this.node.tryFindChild(prefix) ? `${prefix}:${Names.nodeUniqueId(apiKey.node)}` : prefix;

new CfnUsagePlanKey(this, id, {
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-apigatewayv2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ const api = new HttpApi(stack, 'HttpProxyProdApi', {
});
```

To associate a specifc `Stage` to a custom domain mapping -
To associate a specific `Stage` to a custom domain mapping -

```ts
api.addStage('beta', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,25 @@ export interface BasicStepScalingPolicyProps {
* @default No minimum scaling effect
*/
readonly minAdjustmentMagnitude?: number;

/**
* How many evaluation periods of the metric to wait before triggering a scaling action
*
* Raising this value can be used to smooth out the metric, at the expense
* of slower response times.
*
* @default 1
*/
readonly evaluationPeriods?: number;

/**
* Aggregation to apply to all data points over the evaluation periods
*
* Only has meaning if `evaluationPeriods != 1`.
*
* @default - The statistic from the metric if applicable (MIN, MAX, AVERAGE), otherwise AVERAGE.
*/
readonly metricAggregationType?: MetricAggregationType;
}

export interface StepScalingPolicyProps extends BasicStepScalingPolicyProps {
Expand Down Expand Up @@ -92,7 +111,7 @@ export class StepScalingPolicy extends CoreConstruct {
this.lowerAction = new StepScalingAction(this, 'LowerPolicy', {
adjustmentType,
cooldown: props.cooldown,
metricAggregationType: aggregationTypeFromMetric(props.metric),
metricAggregationType: props.metricAggregationType ?? aggregationTypeFromMetric(props.metric),
minAdjustmentMagnitude: props.minAdjustmentMagnitude,
scalingTarget: props.scalingTarget,
});
Expand All @@ -110,7 +129,7 @@ export class StepScalingPolicy extends CoreConstruct {
metric: props.metric,
alarmDescription: 'Lower threshold scaling alarm',
comparisonOperator: cloudwatch.ComparisonOperator.LESS_THAN_OR_EQUAL_TO_THRESHOLD,
evaluationPeriods: 1,
evaluationPeriods: props.evaluationPeriods ?? 1,
threshold,
});
this.lowerAlarm.addAlarmAction(new StepScalingAlarmAction(this.lowerAction));
Expand All @@ -122,7 +141,7 @@ export class StepScalingPolicy extends CoreConstruct {
this.upperAction = new StepScalingAction(this, 'UpperPolicy', {
adjustmentType,
cooldown: props.cooldown,
metricAggregationType: aggregationTypeFromMetric(props.metric),
metricAggregationType: props.metricAggregationType ?? aggregationTypeFromMetric(props.metric),
minAdjustmentMagnitude: props.minAdjustmentMagnitude,
scalingTarget: props.scalingTarget,
});
Expand All @@ -140,7 +159,7 @@ export class StepScalingPolicy extends CoreConstruct {
metric: props.metric,
alarmDescription: 'Upper threshold scaling alarm',
comparisonOperator: cloudwatch.ComparisonOperator.GREATER_THAN_OR_EQUAL_TO_THRESHOLD,
evaluationPeriods: 1,
evaluationPeriods: props.evaluationPeriods ?? 1,
threshold,
});
this.upperAlarm.addAlarmAction(new StepScalingAlarmAction(this.upperAction));
Expand Down Expand Up @@ -197,7 +216,7 @@ function aggregationTypeFromMetric(metric: cloudwatch.IMetric): MetricAggregatio
case 'Maximum':
return MetricAggregationType.MAXIMUM;
default:
throw new Error(`Cannot only scale on 'Minimum', 'Maximum', 'Average' metrics, got ${statistic}`);
return MetricAggregationType.AVERAGE;
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expect, haveResource, SynthUtils } from '@aws-cdk/assert';
import { expect, haveResource, haveResourceLike, SynthUtils } from '@aws-cdk/assert';
import * as cloudwatch from '@aws-cdk/aws-cloudwatch';
import * as cdk from '@aws-cdk/core';
import * as fc from 'fast-check';
Expand Down Expand Up @@ -152,6 +152,81 @@ export = {

test.done();
},

'step scaling from percentile metric'(test: Test) {
// GIVEN
const stack = new cdk.Stack();
const target = createScalableTarget(stack);

// WHEN
target.scaleOnMetric('Tracking', {
metric: new cloudwatch.Metric({ namespace: 'Test', metricName: 'Metric', statistic: 'p99' }),
scalingSteps: [
{ upper: 0, change: -1 },
{ lower: 100, change: +1 },
{ lower: 500, change: +5 },
],
});

// THEN
expect(stack).to(haveResourceLike('AWS::ApplicationAutoScaling::ScalingPolicy', {
PolicyType: 'StepScaling',
StepScalingPolicyConfiguration: {
AdjustmentType: 'ChangeInCapacity',
MetricAggregationType: 'Average',
},
}));
expect(stack).to(haveResource('AWS::CloudWatch::Alarm', {
ComparisonOperator: 'GreaterThanOrEqualToThreshold',
EvaluationPeriods: 1,
AlarmActions: [
{ Ref: 'TargetTrackingUpperPolicy72CEFA77' },
],
ExtendedStatistic: 'p99',
MetricName: 'Metric',
Namespace: 'Test',
Threshold: 100,
}));

test.done();
},

'step scaling with evaluation period configured'(test: Test) {
// GIVEN
const stack = new cdk.Stack();
const target = createScalableTarget(stack);

// WHEN
target.scaleOnMetric('Tracking', {
metric: new cloudwatch.Metric({ namespace: 'Test', metricName: 'Metric', statistic: 'p99' }),
scalingSteps: [
{ upper: 0, change: -1 },
{ lower: 100, change: +1 },
{ lower: 500, change: +5 },
],
evaluationPeriods: 10,
metricAggregationType: appscaling.MetricAggregationType.MAXIMUM,
});

// THEN
expect(stack).to(haveResourceLike('AWS::ApplicationAutoScaling::ScalingPolicy', {
PolicyType: 'StepScaling',
StepScalingPolicyConfiguration: {
AdjustmentType: 'ChangeInCapacity',
MetricAggregationType: 'Maximum',
},
}));
expect(stack).to(haveResource('AWS::CloudWatch::Alarm', {
ComparisonOperator: 'GreaterThanOrEqualToThreshold',
EvaluationPeriods: 10,
ExtendedStatistic: 'p99',
MetricName: 'Metric',
Namespace: 'Test',
Threshold: 100,
}));

test.done();
},
};

/**
Expand Down
Loading