Skip to content

Commit 9e071d2

Browse files
authored
chore(release): 1.41.0 (#8125)
see CHANGELOG
2 parents b2c3043 + 2716460 commit 9e071d2

File tree

85 files changed

+3983
-398
lines changed

Some content is hidden

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

85 files changed

+3983
-398
lines changed

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,24 @@
22

33
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.
44

5+
## [1.41.0](https://github.com/aws/aws-cdk/compare/v1.40.0...v1.41.0) (2020-05-21)
6+
7+
8+
### Features
9+
10+
* **cloudtrail:** create cloudwatch event without needing to create a Trail ([#8076](https://github.com/aws/aws-cdk/issues/8076)) ([0567a23](https://github.com/aws/aws-cdk/commit/0567a2360ac713e3171c9a82767611174dadb6c6)), closes [#6716](https://github.com/aws/aws-cdk/issues/6716)
11+
* **cognito:** user pool - case sensitivity for sign in ([460394f](https://github.com/aws/aws-cdk/commit/460394f3dc4737cee80504d6c8ef106ecc3b67d5)), closes [#7988](https://github.com/aws/aws-cdk/issues/7988) [#7235](https://github.com/aws/aws-cdk/issues/7235)
12+
* **core:** CfnJson enables intrinsics in hash keys ([#8099](https://github.com/aws/aws-cdk/issues/8099)) ([195cd40](https://github.com/aws/aws-cdk/commit/195cd405d9f0869875de2ec78661aee3af2c7c7d)), closes [#8084](https://github.com/aws/aws-cdk/issues/8084)
13+
* **secretsmanager:** adds grantWrite to Secret ([#7858](https://github.com/aws/aws-cdk/issues/7858)) ([3fed84b](https://github.com/aws/aws-cdk/commit/3fed84ba9eec3f53c662966e366aa629209b7bf5))
14+
* **sns:** add support for subscription DLQ in SNS ([383cdb8](https://github.com/aws/aws-cdk/commit/383cdb86effeafdf5d0767ed379b16b3d78a933b))
15+
* **stepfunctions:** new service integration classes for Lambda, SNS, and SQS ([#7946](https://github.com/aws/aws-cdk/issues/7946)) ([c038848](https://github.com/aws/aws-cdk/commit/c0388483524832ca7863de4ee9c472b8ab39de8e)), closes [#6715](https://github.com/aws/aws-cdk/issues/6715) [#6489](https://github.com/aws/aws-cdk/issues/6489)
16+
17+
18+
### Bug Fixes
19+
20+
* **apigateway:** contextAccountId in AccessLogField incorrectly resolves to requestId ([7b89e80](https://github.com/aws/aws-cdk/commit/7b89e805c716fa73d41cc97fcb728634e7a59136)), closes [#7952](https://github.com/aws/aws-cdk/issues/7952) [#7951](https://github.com/aws/aws-cdk/issues/7951)
21+
* **autoscaling:** add noDevice as a volume type ([#7253](https://github.com/aws/aws-cdk/issues/7253)) ([751958b](https://github.com/aws/aws-cdk/commit/751958b69225fdfc52622781c618f5a77f881fb6)), closes [#7242](https://github.com/aws/aws-cdk/issues/7242)
22+
523
## [1.40.0](https://github.com/aws/aws-cdk/compare/v1.39.0...v1.40.0) (2020-05-20)
624

725

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
[![PyPI version](https://badge.fury.io/py/aws-cdk.core.svg)](https://badge.fury.io/py/aws-cdk.core)
88
[![NuGet version](https://badge.fury.io/nu/Amazon.CDK.svg)](https://badge.fury.io/nu/Amazon.CDK)
99
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/software.amazon.awscdk/core/badge.svg)](https://maven-badges.herokuapp.com/maven-central/software.amazon.awscdk/core)
10+
[![Mergify](https://img.shields.io/endpoint.svg?url=https://gh.mergify.io/badges/aws/aws-cdk&style=flat)](https://mergify.io)
1011

1112
The **AWS Cloud Development Kit (AWS CDK)** is an open-source software development
1213
framework to define cloud infrastructure in code and provision it through AWS CloudFormation.

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
"tools/*"
1111
],
1212
"rejectCycles": "true",
13-
"version": "1.40.0"
13+
"version": "1.41.0"
1414
}

packages/@aws-cdk/aws-apigateway/lib/access-log.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export class AccessLogField {
4646
* The API owner's AWS account ID.
4747
*/
4848
public static contextAccountId() {
49-
return '$context.requestId';
49+
return '$context.identity.accountId';
5050
}
5151

5252
/**

packages/@aws-cdk/aws-apigateway/test/test.access-log.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,13 @@ export = {
3838
requestId: apigateway.AccessLogField.contextRequestId(),
3939
sourceIp: apigateway.AccessLogField.contextIdentitySourceIp(),
4040
method: apigateway.AccessLogField.contextHttpMethod(),
41+
accountId: apigateway.AccessLogField.contextAccountId(),
4142
userContext: {
4243
sub: apigateway.AccessLogField.contextAuthorizerClaims('sub'),
4344
email: apigateway.AccessLogField.contextAuthorizerClaims('email'),
4445
},
4546
}));
46-
test.deepEqual(testFormat.toString(), '{"requestId":"$context.requestId","sourceIp":"$context.identity.sourceIp","method":"$context.httpMethod","userContext":{"sub":"$context.authorizer.claims.sub","email":"$context.authorizer.claims.email"}}');
47+
test.deepEqual(testFormat.toString(), '{"requestId":"$context.requestId","sourceIp":"$context.identity.sourceIp","method":"$context.httpMethod","accountId":"$context.identity.accountId","userContext":{"sub":"$context.authorizer.claims.sub","email":"$context.authorizer.claims.email"}}');
4748

4849
test.done();
4950
},

packages/@aws-cdk/aws-autoscaling/lib/auto-scaling-group.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { BasicLifecycleHookProps, LifecycleHook } from './lifecycle-hook';
1414
import { BasicScheduledActionProps, ScheduledAction } from './scheduled-action';
1515
import { BasicStepScalingPolicyProps, StepScalingPolicy } from './step-scaling-policy';
1616
import { BaseTargetTrackingProps, PredefinedMetric, TargetTrackingScalingPolicy } from './target-tracking-scaling-policy';
17-
import { BlockDevice, EbsDeviceVolumeType } from './volume';
17+
import { BlockDevice, BlockDeviceVolume, EbsDeviceVolumeType } from './volume';
1818

1919
/**
2020
* Name tag constant
@@ -474,11 +474,7 @@ export class AutoScalingGroup extends AutoScalingGroupBase implements
474474
associatePublicIpAddress: props.associatePublicIpAddress,
475475
spotPrice: props.spotPrice,
476476
blockDeviceMappings: (props.blockDevices !== undefined ?
477-
synthesizeBlockDeviceMappings(this, props.blockDevices).map<CfnLaunchConfiguration.BlockDeviceMappingProperty>(
478-
({ deviceName, ebs, virtualName, noDevice }) => ({
479-
deviceName, ebs, virtualName, noDevice: noDevice ? true : undefined,
480-
}),
481-
) : undefined),
477+
synthesizeBlockDeviceMappings(this, props.blockDevices) : undefined),
482478
});
483479

484480
launchConfig.node.addDependency(this.role);
@@ -973,6 +969,13 @@ function synthesizeBlockDeviceMappings(construct: Construct, blockDevices: Block
973969
return blockDevices.map<CfnLaunchConfiguration.BlockDeviceMappingProperty>(({ deviceName, volume, mappingEnabled }) => {
974970
const { virtualName, ebsDevice: ebs } = volume;
975971

972+
if (volume === BlockDeviceVolume._NO_DEVICE || mappingEnabled === false) {
973+
return {
974+
deviceName,
975+
noDevice: true,
976+
};
977+
}
978+
976979
if (ebs) {
977980
const { iops, volumeType } = ebs;
978981

@@ -987,7 +990,6 @@ function synthesizeBlockDeviceMappings(construct: Construct, blockDevices: Block
987990

988991
return {
989992
deviceName, ebs, virtualName,
990-
noDevice: mappingEnabled === false ? true : undefined,
991993
};
992994
});
993995
}

packages/@aws-cdk/aws-autoscaling/lib/volume.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ export interface BlockDevice {
2929
* Amazon EC2 Auto Scaling launches a replacement instance if the instance fails the health check.
3030
*
3131
* @default true - device mapping is left untouched
32+
* @deprecated use `BlockDeviceVolume.noDevice()` as the volume to supress a mapping.
33+
*
3234
*/
3335
readonly mappingEnabled?: boolean;
3436
}
@@ -112,6 +114,11 @@ export interface EbsDeviceProps extends EbsDeviceSnapshotOptions {
112114
* Describes a block device mapping for an EC2 instance or Auto Scaling group.
113115
*/
114116
export class BlockDeviceVolume {
117+
/**
118+
* @internal
119+
*/
120+
public static _NO_DEVICE = new BlockDeviceVolume();
121+
115122
/**
116123
* Creates a new Elastic Block Storage device
117124
*
@@ -146,6 +153,13 @@ export class BlockDeviceVolume {
146153
return new this(undefined, `ephemeral${volumeIndex}`);
147154
}
148155

156+
/**
157+
* Supresses a volume mapping
158+
*/
159+
public static noDevice() {
160+
return this._NO_DEVICE;
161+
}
162+
149163
/**
150164
* @param ebsDevice EBS device info
151165
* @param virtualName Virtual device name

packages/@aws-cdk/aws-autoscaling/test/test.auto-scaling-group.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,6 @@ export = {
714714
}),
715715
}, {
716716
deviceName: 'ebs-snapshot',
717-
mappingEnabled: false,
718717
volume: autoscaling.BlockDeviceVolume.ebsFromSnapshot('snapshot-id', {
719718
volumeSize: 500,
720719
deleteOnTermination: false,
@@ -723,6 +722,13 @@ export = {
723722
}, {
724723
deviceName: 'ephemeral',
725724
volume: autoscaling.BlockDeviceVolume.ephemeral(0),
725+
}, {
726+
deviceName: 'disabled',
727+
volume: autoscaling.BlockDeviceVolume.ephemeral(1),
728+
mappingEnabled: false,
729+
}, {
730+
deviceName: 'none',
731+
volume: autoscaling.BlockDeviceVolume.noDevice(),
726732
}],
727733
});
728734

@@ -748,13 +754,21 @@ export = {
748754
VolumeSize: 500,
749755
VolumeType: 'sc1',
750756
},
751-
NoDevice: true,
757+
NoDevice: ABSENT,
752758
},
753759
{
754760
DeviceName: 'ephemeral',
755761
VirtualName: 'ephemeral0',
756762
NoDevice: ABSENT,
757763
},
764+
{
765+
DeviceName: 'disabled',
766+
NoDevice: true,
767+
},
768+
{
769+
DeviceName: 'none',
770+
NoDevice: true,
771+
},
758772
],
759773
}));
760774

packages/@aws-cdk/aws-cloudfront/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"devDependencies": {
6565
"@aws-cdk/assert": "0.0.0",
6666
"@types/nodeunit": "^0.0.31",
67-
"aws-sdk": "^2.679.0",
67+
"aws-sdk": "^2.681.0",
6868
"cdk-build-tools": "0.0.0",
6969
"cdk-integ-tools": "0.0.0",
7070
"cfn2ts": "0.0.0",

packages/@aws-cdk/aws-cloudtrail/README.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,33 @@ trail.addLambdaEventSelector(["arn:aws:lambda"]);
9292

9393
// Add an event selector to log data events for the provided Lambda functions.
9494
trail.addLambdaEventSelector([lambdaFunction.functionArn]);
95-
```
95+
```
96+
97+
Using the `Trail.onEvent()` API, an EventBridge rule can be created that gets triggered for
98+
every event logged in CloudTrail.
99+
To only use the events that are of interest, either from a particular service, specific account or
100+
time range, they can be filtered down using the APIs available in `aws-events`. The following code
101+
filters events for S3 from a specific AWS account and triggers a lambda function. See [Events delivered via
102+
CloudTrail](https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/EventTypes.html#events-for-services-not-listed)
103+
to learn more about the event structure for events from CloudTrail.
104+
105+
```ts
106+
import * as cloudtrail from '@aws-cdk/aws-cloudtrail';
107+
import * as eventTargets from '@aws-cdk/aws-events-targets';
108+
import * as lambda from '@aws-cdk/aws-lambda';
109+
110+
const myFunctionHandler = new lambda.Function(this, 'MyFunction', {
111+
code: lambda.Code.fromAsset('resource/myfunction');
112+
runtime: lambda.Runtime.NODEJS_12_X,
113+
handler: 'index.handler',
114+
});
115+
116+
const eventRule = Trail.onEvent(this, 'MyCloudWatchEvent', {
117+
target: new eventTargets.LambdaFunction(myFunctionHandler),
118+
});
119+
120+
eventRule.addEventPattern({
121+
account: '123456789012',
122+
source: 'aws.s3',
123+
});
124+
```

0 commit comments

Comments
 (0)