Skip to content

Commit c7aa9ae

Browse files
committed
Update to version v1.62.0
1 parent abddeed commit c7aa9ae

File tree

71 files changed

+2181
-1345
lines changed

Some content is hidden

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

71 files changed

+2181
-1345
lines changed

CHANGELOG.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [1.62.0] - 2020-09-09
8+
9+
### Added
10+
- aws-events-rule-sqs pattern added ([#25](https://github.com/awslabs/aws-solutions-constructs/issues/25))
11+
- aws-events-rule-sns pattern added ([#42](https://github.com/awslabs/aws-solutions-constructs/issues/42))
12+
- aws-apigateway-kinesisstreams pattern added ([#51](https://github.com/awslabs/aws-solutions-constructs/issues/51))
13+
14+
### Changed
15+
- Upgraded all patterns to CDK v1.62.0
16+
717
## [1.61.1] - 2020-09-01
818

919
### Added
@@ -161,4 +171,4 @@ General Availability of the AWS Solutions Constructs!! 🎉🎉🥂🥂🍾🍾
161171
- aws-s3-lambda pattern added
162172
- aws-sns-lambda pattern added
163173
- aws-sqs-lambda pattern added
164-
- core pattern added
174+
- core pattern added

source/lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
"./patterns/@aws-solutions-constructs/*"
77
],
88
"rejectCycles": "true",
9-
"version": "1.61.1"
9+
"version": "1.62.0"
1010
}

source/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "aws-solutions-constructs",
3-
"version": "1.61.1",
3+
"version": "1.62.0",
44
"description": "AWS Solutions Constructs Library",
55
"repository": {
66
"type": "git",

source/patterns/@aws-solutions-constructs/aws-apigateway-dynamodb/package.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@aws-solutions-constructs/aws-apigateway-dynamodb",
3-
"version": "1.61.1",
3+
"version": "1.62.0",
44
"description": "CDK Constructs for AWS API Gateway and Amazon DynamoDB integration.",
55
"main": "lib/index.js",
66
"types": "lib/index.d.ts",
@@ -53,16 +53,16 @@
5353
}
5454
},
5555
"dependencies": {
56-
"@aws-cdk/core": "~1.61.1",
57-
"@aws-cdk/aws-apigateway": "~1.61.1",
58-
"@aws-cdk/aws-iam": "~1.61.1",
59-
"@aws-cdk/aws-dynamodb": "~1.61.1",
60-
"@aws-cdk/aws-logs": "~1.61.1",
61-
"@aws-solutions-constructs/core": "~1.61.1",
56+
"@aws-cdk/core": "~1.62.0",
57+
"@aws-cdk/aws-apigateway": "~1.62.0",
58+
"@aws-cdk/aws-iam": "~1.62.0",
59+
"@aws-cdk/aws-dynamodb": "~1.62.0",
60+
"@aws-cdk/aws-logs": "~1.62.0",
61+
"@aws-solutions-constructs/core": "~1.62.0",
6262
"constructs": "^3.0.4"
6363
},
6464
"devDependencies": {
65-
"@aws-cdk/assert": "~1.61.1",
65+
"@aws-cdk/assert": "~1.62.0",
6666
"@types/jest": "^24.0.23",
6767
"@types/node": "^10.3.0"
6868
},
@@ -72,12 +72,12 @@
7272
]
7373
},
7474
"peerDependencies": {
75-
"@aws-cdk/core": "~1.61.1",
76-
"@aws-cdk/aws-apigateway": "~1.61.1",
77-
"@aws-cdk/aws-iam": "~1.61.1",
78-
"@aws-cdk/aws-dynamodb": "~1.61.1",
79-
"@aws-solutions-constructs/core": "~1.61.1",
75+
"@aws-cdk/core": "~1.62.0",
76+
"@aws-cdk/aws-apigateway": "~1.62.0",
77+
"@aws-cdk/aws-iam": "~1.62.0",
78+
"@aws-cdk/aws-dynamodb": "~1.62.0",
79+
"@aws-solutions-constructs/core": "~1.62.0",
8080
"constructs": "^3.0.4",
81-
"@aws-cdk/aws-logs": "~1.61.1"
81+
"@aws-cdk/aws-logs": "~1.62.0"
8282
}
8383
}

source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ _Parameters_
7575

7676
| **Method** | **Request Path** | **Request Body** | **Stream Action** | **Description** |
7777
|:-------------|:----------------|-----------------|-----------------|-----------------|
78-
|POST|`/record`| `{ "data": "Hello World!", "partitionKey": "pk001 }` |`kinesis:PutRecord`|Writes a single data record into the stream.|
79-
|POST|`/records`| `{ "records": [{ "data": "abc", "partitionKey": "pk001" }, { "data": "xyz", "partitionKeyID": "pk001" }] }` |`kinesis:PutRecords`|Writes multiple data records into the stream in a single call.|
78+
|POST|`/record`| `{ "data": "Hello World!", "partitionKey": "pk001" }` |`kinesis:PutRecord`|Writes a single data record into the stream.|
79+
|POST|`/records`| `{ "records": [{ "data": "abc", "partitionKey": "pk001" }, { "data": "xyz", "partitionKey": "pk001" }] }` |`kinesis:PutRecords`|Writes multiple data records into the stream in a single call.|
8080

8181
## Default settings
8282
Out of the box implementation of the Construct without any override will set the following defaults:

source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/lib/index.ts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,31 +34,36 @@ export interface ApiGatewayToKinesisStreamsProps {
3434
* API Gateway request template for the PutRecord action.
3535
* If not provided, a default one will be used.
3636
*
37-
* @default - None
37+
* @default - { "StreamName": "${this.kinesisStream.streamName}", "Data": "$util.base64Encode($input.json('$.data'))",
38+
* "PartitionKey": "$input.path('$.partitionKey')" }
3839
*/
3940
readonly putRecordRequestTemplate?: string;
4041

4142
/**
4243
* API Gateway request model for the PutRecord action.
4344
* If not provided, a default one will be created.
4445
*
45-
* @default - None
46+
* @default - {"$schema":"http://json-schema.org/draft-04/schema#","title":"PutRecord proxy single-record payload","type":"object",
47+
* "required":["data","partitionKey"],"properties":{"data":{"type":"string"},"partitionKey":{"type":"string"}}}
4648
*/
4749
readonly putRecordRequestModel?: api.ModelOptions;
4850

4951
/**
5052
* API Gateway request template for the PutRecords action.
5153
* If not provided, a default one will be used.
5254
*
53-
* @default - None
55+
* @default - { "StreamName": "${this.kinesisStream.streamName}", "Records": [ #foreach($elem in $input.path('$.records'))
56+
* { "Data": "$util.base64Encode($elem.data)", "PartitionKey": "$elem.partitionKey"}#if($foreach.hasNext),#end #end ] }
5457
*/
5558
readonly putRecordsRequestTemplate?: string;
5659

5760
/**
5861
* API Gateway request model for the PutRecords action.
5962
* If not provided, a default one will be created.
6063
*
61-
* @default - None
64+
* @default - {"$schema":"http://json-schema.org/draft-04/schema#","title":"PutRecords proxy payload data","type":"object","required":["records"],
65+
* "properties":{"records":{"type":"array","items":{"type":"object",
66+
* "required":["data","partitionKey"],"properties":{"data":{"type":"string"},"partitionKey":{"type":"string"}}}}}}
6267
*/
6368
readonly putRecordsRequestModel?: api.ModelOptions;
6469

@@ -92,7 +97,7 @@ export class ApiGatewayToKinesisStreams extends Construct {
9297
* @param {cdk.App} scope - represents the scope for all the resources.
9398
* @param {string} id - this is a a scope-unique id.
9499
* @param {ApiGatewayToKinesisStreamsProps} props - user provided props for the construct.
95-
* @since 1.61.1
100+
* @since 1.62.0
96101
* @access public
97102
*/
98103
constructor(scope: Construct, id: string, props: ApiGatewayToKinesisStreamsProps) {
@@ -150,7 +155,7 @@ export class ApiGatewayToKinesisStreams extends Construct {
150155

151156
private getPutRecordTemplate(putRecordTemplate?: string): string {
152157
if (putRecordTemplate !== undefined) {
153-
return putRecordTemplate;
158+
return putRecordTemplate.replace("${StreamName}", this.kinesisStream.streamName);
154159
}
155160

156161
return `{ "StreamName": "${this.kinesisStream.streamName}", "Data": "$util.base64Encode($input.json('$.data'))", "PartitionKey": "$input.path('$.partitionKey')" }`;
@@ -184,7 +189,7 @@ export class ApiGatewayToKinesisStreams extends Construct {
184189

185190
private getPutRecordsTemplate(putRecordsTemplate?: string): string {
186191
if (putRecordsTemplate !== undefined) {
187-
return putRecordsTemplate;
192+
return putRecordsTemplate.replace("${StreamName}", this.kinesisStream.streamName);
188193
}
189194

190195
return `{ "StreamName": "${this.kinesisStream.streamName}", "Records": [ #foreach($elem in $input.path('$.records')) { "Data": "$util.base64Encode($elem.data)", "PartitionKey": "$elem.partitionKey"}#if($foreach.hasNext),#end #end ] }`;

source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/package.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@aws-solutions-constructs/aws-apigateway-kinesisstreams",
3-
"version": "1.61.1",
3+
"version": "1.62.0",
44
"description": "CDK Constructs for AWS API Gateway and Amazon Kinesis Data Streams integration.",
55
"main": "lib/index.js",
66
"types": "lib/index.d.ts",
@@ -53,16 +53,16 @@
5353
}
5454
},
5555
"dependencies": {
56-
"@aws-cdk/core": "~1.61.1",
57-
"@aws-cdk/aws-apigateway": "~1.61.1",
58-
"@aws-cdk/aws-iam": "~1.61.1",
59-
"@aws-cdk/aws-kinesis": "~1.61.1",
60-
"@aws-cdk/aws-logs": "~1.61.1",
61-
"@aws-solutions-constructs/core": "~1.61.1",
56+
"@aws-cdk/core": "~1.62.0",
57+
"@aws-cdk/aws-apigateway": "~1.62.0",
58+
"@aws-cdk/aws-iam": "~1.62.0",
59+
"@aws-cdk/aws-kinesis": "~1.62.0",
60+
"@aws-cdk/aws-logs": "~1.62.0",
61+
"@aws-solutions-constructs/core": "~1.62.0",
6262
"constructs": "^3.0.4"
6363
},
6464
"devDependencies": {
65-
"@aws-cdk/assert": "~1.61.1",
65+
"@aws-cdk/assert": "~1.62.0",
6666
"@types/jest": "^24.0.23",
6767
"@types/node": "^10.3.0"
6868
},
@@ -72,12 +72,12 @@
7272
]
7373
},
7474
"peerDependencies": {
75-
"@aws-cdk/core": "~1.61.1",
76-
"@aws-cdk/aws-apigateway": "~1.61.1",
77-
"@aws-cdk/aws-iam": "~1.61.1",
78-
"@aws-cdk/aws-kinesis": "~1.61.1",
79-
"@aws-solutions-constructs/core": "~1.61.1",
75+
"@aws-cdk/core": "~1.62.0",
76+
"@aws-cdk/aws-apigateway": "~1.62.0",
77+
"@aws-cdk/aws-iam": "~1.62.0",
78+
"@aws-cdk/aws-kinesis": "~1.62.0",
79+
"@aws-solutions-constructs/core": "~1.62.0",
8080
"constructs": "^3.0.4",
81-
"@aws-cdk/aws-logs": "~1.61.1"
81+
"@aws-cdk/aws-logs": "~1.62.0"
8282
}
8383
}

source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apigateway-kinesis-overwrite.expected.json

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"Name": "my-api"
1818
}
1919
},
20-
"testapigatewaykinesisoverwriteRestApiDeployment1EE3B0963b59c487316048a0c96d810cbd1cf3bb": {
20+
"testapigatewaykinesisoverwriteRestApiDeployment1EE3B096ca960d6e964dacd9ef8ada66856cca97": {
2121
"Type": "AWS::ApiGateway::Deployment",
2222
"Properties": {
2323
"RestApiId": {
@@ -61,7 +61,7 @@
6161
"Format": "{\"requestId\":\"$context.requestId\",\"ip\":\"$context.identity.sourceIp\",\"user\":\"$context.identity.user\",\"caller\":\"$context.identity.caller\",\"requestTime\":\"$context.requestTime\",\"httpMethod\":\"$context.httpMethod\",\"resourcePath\":\"$context.resourcePath\",\"status\":\"$context.status\",\"protocol\":\"$context.protocol\",\"responseLength\":\"$context.responseLength\"}"
6262
},
6363
"DeploymentId": {
64-
"Ref": "testapigatewaykinesisoverwriteRestApiDeployment1EE3B0963b59c487316048a0c96d810cbd1cf3bb"
64+
"Ref": "testapigatewaykinesisoverwriteRestApiDeployment1EE3B096ca960d6e964dacd9ef8ada66856cca97"
6565
},
6666
"MethodSettings": [
6767
{
@@ -132,7 +132,18 @@
132132
"integration.request.header.Content-Type": "'x-amz-json-1.1'"
133133
},
134134
"RequestTemplates": {
135-
"application/json": "{ \"Data\": \"$util.base64Encode($input.json('$.foo'))\", \"PartitionKey\": \"$input.path('$.bar')\" }"
135+
"application/json": {
136+
"Fn::Join": [
137+
"",
138+
[
139+
"{ \"StreamName\": \"",
140+
{
141+
"Ref": "KinesisStream46752A3E"
142+
},
143+
"\", \"Data\": \"$util.base64Encode($input.json('$.foo'))\", \"PartitionKey\": \"$input.path('$.bar')\" }"
144+
]
145+
]
146+
}
136147
},
137148
"Type": "AWS",
138149
"Uri": {
@@ -227,7 +238,18 @@
227238
"integration.request.header.Content-Type": "'x-amz-json-1.1'"
228239
},
229240
"RequestTemplates": {
230-
"application/json": "{ \"Records\": [ #foreach($elem in $input.path('$.records')) { \"Data\": \"$util.base64Encode($elem.foo)\", \"PartitionKey\": \"$elem.bar\"}#if($foreach.hasNext),#end #end ] }"
241+
"application/json": {
242+
"Fn::Join": [
243+
"",
244+
[
245+
"{ \"StreamName\": \"",
246+
{
247+
"Ref": "KinesisStream46752A3E"
248+
},
249+
"\", \"Records\": [ #foreach($elem in $input.path('$.records')) { \"Data\": \"$util.base64Encode($elem.foo)\", \"PartitionKey\": \"$elem.bar\"}#if($foreach.hasNext),#end #end ] }"
250+
]
251+
]
252+
}
231253
},
232254
"Type": "AWS",
233255
"Uri": {

source/patterns/@aws-solutions-constructs/aws-apigateway-kinesisstreams/test/integ.apigateway-kinesis-overwrite.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ const props: ApiGatewayToKinesisStreamsProps = {
3737
shardCount: 1,
3838
retentionPeriod: Duration.days(4)
3939
},
40-
putRecordRequestTemplate: `{ "Data": "$util.base64Encode($input.json('$.foo'))", "PartitionKey": "$input.path('$.bar')" }`,
40+
putRecordRequestTemplate: `{ "StreamName": "\${StreamName}", "Data": "$util.base64Encode($input.json('$.foo'))", "PartitionKey": "$input.path('$.bar')" }`,
4141
putRecordRequestModel: { schema: {} },
4242

43-
putRecordsRequestTemplate: `{ "Records": [ #foreach($elem in $input.path('$.records')) { "Data": "$util.base64Encode($elem.foo)", "PartitionKey": "$elem.bar"}#if($foreach.hasNext),#end #end ] }`,
43+
putRecordsRequestTemplate: `{ "StreamName": "\${StreamName}", "Records": [ #foreach($elem in $input.path('$.records')) { "Data": "$util.base64Encode($elem.foo)", "PartitionKey": "$elem.bar"}#if($foreach.hasNext),#end #end ] }`,
4444
putRecordsRequestModel: { schema: {} }
4545
};
4646

source/patterns/@aws-solutions-constructs/aws-apigateway-lambda/package.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@aws-solutions-constructs/aws-apigateway-lambda",
3-
"version": "1.61.1",
3+
"version": "1.62.0",
44
"description": "CDK constructs for defining an interaction between an API Gateway and a Lambda function.",
55
"main": "lib/index.js",
66
"types": "lib/index.d.ts",
@@ -53,16 +53,16 @@
5353
}
5454
},
5555
"dependencies": {
56-
"@aws-cdk/aws-apigateway": "~1.61.1",
57-
"@aws-cdk/aws-lambda": "~1.61.1",
58-
"@aws-cdk/aws-logs": "~1.61.1",
59-
"@aws-cdk/core": "~1.61.1",
60-
"@aws-cdk/aws-iam": "~1.61.1",
61-
"@aws-solutions-constructs/core": "~1.61.1",
56+
"@aws-cdk/aws-apigateway": "~1.62.0",
57+
"@aws-cdk/aws-lambda": "~1.62.0",
58+
"@aws-cdk/aws-logs": "~1.62.0",
59+
"@aws-cdk/core": "~1.62.0",
60+
"@aws-cdk/aws-iam": "~1.62.0",
61+
"@aws-solutions-constructs/core": "~1.62.0",
6262
"constructs": "^3.0.4"
6363
},
6464
"devDependencies": {
65-
"@aws-cdk/assert": "~1.61.1",
65+
"@aws-cdk/assert": "~1.62.0",
6666
"@types/jest": "^24.0.23",
6767
"@types/node": "^10.3.0"
6868
},
@@ -72,12 +72,12 @@
7272
]
7373
},
7474
"peerDependencies": {
75-
"@aws-cdk/aws-apigateway": "~1.61.1",
76-
"@aws-cdk/aws-lambda": "~1.61.1",
77-
"@aws-cdk/aws-logs": "~1.61.1",
78-
"@aws-cdk/core": "~1.61.1",
79-
"@aws-solutions-constructs/core": "~1.61.1",
75+
"@aws-cdk/aws-apigateway": "~1.62.0",
76+
"@aws-cdk/aws-lambda": "~1.62.0",
77+
"@aws-cdk/aws-logs": "~1.62.0",
78+
"@aws-cdk/core": "~1.62.0",
79+
"@aws-solutions-constructs/core": "~1.62.0",
8080
"constructs": "^3.0.4",
81-
"@aws-cdk/aws-iam": "~1.61.1"
81+
"@aws-cdk/aws-iam": "~1.62.0"
8282
}
8383
}

0 commit comments

Comments
 (0)