Skip to content

Commit 3f03e12

Browse files
committed
Update to version v1.58.0
1 parent 50d3e9c commit 3f03e12

File tree

85 files changed

+1481
-1211
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

+1481
-1211
lines changed

.viperlightignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# This file is used by Viperlight utility to override findings (false alarm)
2+
dist/
3+
coverage/
4+
node_modules/
5+
deployment/publishing/nuget/publish.sh:43
6+
deployment/publishing/nuget/publish.sh:44
7+
source/use_cases/aws-serverless-web-app/test/integ.backend-deployment.expected.json:180
8+
source/patterns/@aws-solutions-constructs/aws-apigateway-lambda/test/integ.deployFunction.expected.json:140
9+
source/patterns/@aws-solutions-constructs/aws-apigateway-lambda/test/integ.existingFunction.expected.json:140
10+
source/patterns/@aws-solutions-constructs/aws-apigateway-sqs/test/integ.apigateway-sqs-crud.expected.json:121
11+
source/patterns/@aws-solutions-constructs/aws-cloudfront-apigateway/test/integ.no-arguments.expected.json:140
12+
CODE_OF_CONDUCT.md:4
13+
CONTRIBUTING.md:206
14+
source/patterns/@aws-solutions-constructs/core/test/step-function-helper.test.ts:118
15+
source/patterns/@aws-solutions-constructs/aws-apigateway-sqs/test/integ.apigateway-sqs-crud.expected.json:41
16+
source/patterns/@aws-solutions-constructs/aws-lambda-sqs/test/integ.deployFunction.expected.json:90
17+
source/patterns/@aws-solutions-constructs/aws-lambda-sqs/test/integ.existingFunction.expected.json:90
18+
source/patterns/@aws-solutions-constructs/aws-apigateway-sqs/test/integ.apigateway-sqs-crud.expected.json:163
19+
source/patterns/@aws-solutions-constructs/aws-apigateway-sqs/test/integ.apigateway-sqs-crud.expected.json:179
20+
source/tools/cdk-integ-tools/package-lock.json:373
21+
source/patterns/@aws-solutions-constructs/core/test/step-function-helper.test.js:115

.viperlightrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"failOn": "medium",
3+
"all": true
4+
}

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ 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.58.0] - 2020-08-14
8+
9+
### Changed
10+
- Upgraded all patterns to CDK v1.58.0
11+
- Fix `aws-apigateway-sqs` pattern bug with overriding `apiGatewayProps` ([#37](https://github.com/awslabs/aws-solutions-constructs/issues/37))
12+
- Updated `aws-cloudfront-apigateway` and `aws-cloudfront-apigateway-lambda` patterns to deploy unauthenticated APIs
13+
- [All *-dynamodb-* patterns] Enable continuous backups and point-in-time recovery for DynamoDB Table ([#35](https://github.com/awslabs/aws-solutions-constructs/issues/35))
14+
- Removed the default Cognito UserPool SMS role creation ([#9513](https://github.com/aws/aws-cdk/pull/9513))
15+
716
## [1.57.0] - 2020-08-07
817

918
### Changed

CONTRIBUTING.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,20 +149,25 @@ BREAKING CHANGE: Description of what broke and how to achieve this behavior now
149149

150150
### Step 5: Pull Request
151151

152-
* Push to a GitHub fork or to a branch (naming convention: `<user>/<feature-bug-name>`)
152+
* Push to a GitHub fork
153153
* Submit a Pull Requests on GitHub.
154-
* Please follow the PR checklist written below. We trust our contributors to self-check, and this helps that process!
154+
* Please follow the PR checklist written above. We trust our contributors to self-check, and this helps that process!
155155
* Discuss review comments and iterate until you get at least one “Approve”. When iterating, push new commits to the
156156
same branch. Usually all these are going to be squashed when you merge to master. The commit messages should be hints
157157
for you when you finalize your merge commit message.
158158
* Make sure to update the PR title/description if things change. The PR title/description are going to be used as the
159159
commit title/message and will appear in the CHANGELOG, so maintain them all the way throughout the process.
160+
* Make sure your PR builds successfully (we have CodeBuild setup to automatically build all PRs)
160161

162+
#### CodeBuild Build steps
161163

164+
The CodeBuild runs through the following build steps:
165+
* Content scanning using Viperlight utility. It is a security, vulnerability and general risk highlighting tool. The source code for utility is located [here](https://s3.amazonaws.com/viperlight-scanner/latest/viperlight.zip) It uses [.viperlightignore](https://github.com/awslabs/aws-solutions-constructs/blob/master/.viperlightignore) to override any false alarms.
166+
* Build/validate/package all the constructs in the library
167+
* Scan the Cloudformation templates generated by [Integration Tests](https://github.com/awslabs/aws-solutions-constructs/blob/master/CONTRIBUTING.md#integration-tests) using (cfn_nag)[https://github.com/stelligent/cfn_nag]
162168

163169
### Step 6: Merge
164170

165-
* Make sure your PR builds successfully (we have CodeBuild setup to automatically build all PRs)
166171
* Once approved and tested, a maintainer will squash-merge to master and will use your PR title/description as the
167172
commit message.
168173

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.57.0"
9+
"version": "1.58.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.57.0",
3+
"version": "1.58.0",
44
"description": "AWS Solutions Constructs Library",
55
"repository": {
66
"type": "git",

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ Out of the box implementation of the Construct without any override will set the
8787
* Enable server-side encryption for DynamoDB Table using AWS managed KMS Key
8888
* Creates a partition key called 'id' for DynamoDB Table
8989
* Retain the Table when deleting the CloudFormation stack
90+
* Enable continuous backups and point-in-time recovery
9091

9192
## Architecture
9293
![Architecture Diagram](architecture.png)

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

Lines changed: 32 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -126,25 +126,53 @@ export class ApiGatewayToDynamoDB extends Construct {
126126
if (props.allowCreateOperation && props.allowCreateOperation === true && props.createRequestTemplate) {
127127
const createRequestTemplate = props.createRequestTemplate.replace("${Table}", this.dynamoTable.tableName);
128128
this.addActionToPolicy("dynamodb:PutItem");
129-
this.addMethod(this.apiGateway.root, createRequestTemplate, "PutItem", "POST");
129+
defaults.addProxyMethodToApiResource({
130+
service: "dynamodb",
131+
action: "PutItem",
132+
apiGatewayRole: this.apiGatewayRole,
133+
apiMethod: "POST",
134+
apiResource: this.apiGateway.root,
135+
requestTemplate: createRequestTemplate
136+
});
130137
}
131138
// Read
132139
if (!props.allowReadOperation || props.allowReadOperation === true) {
133140
const getRequestTemplate = "{\r\n\"TableName\": \"" + this.dynamoTable.tableName + "\",\r\n \"KeyConditionExpression\": \"" + partitionKeyName + " = :v1\",\r\n \"ExpressionAttributeValues\": {\r\n \":v1\": {\r\n \"S\": \"$input.params('" + partitionKeyName + "')\"\r\n }\r\n }\r\n}";
134141
this.addActionToPolicy("dynamodb:Query");
135-
this.addMethod(apiGatewayResource, getRequestTemplate, "Query", "GET");
142+
defaults.addProxyMethodToApiResource({
143+
service: "dynamodb",
144+
action: "Query",
145+
apiGatewayRole: this.apiGatewayRole,
146+
apiMethod: "GET",
147+
apiResource: apiGatewayResource,
148+
requestTemplate: getRequestTemplate
149+
});
136150
}
137151
// Update
138152
if (props.allowUpdateOperation && props.allowUpdateOperation === true && props.updateRequestTemplate) {
139153
const updateRequestTemplate = props.updateRequestTemplate.replace("${Table}", this.dynamoTable.tableName);
140154
this.addActionToPolicy("dynamodb:UpdateItem");
141-
this.addMethod(apiGatewayResource, updateRequestTemplate, "UpdateItem", "PUT");
155+
defaults.addProxyMethodToApiResource({
156+
service: "dynamodb",
157+
action: "UpdateItem",
158+
apiGatewayRole: this.apiGatewayRole,
159+
apiMethod: "PUT",
160+
apiResource: apiGatewayResource,
161+
requestTemplate: updateRequestTemplate
162+
});
142163
}
143164
// Delete
144165
if (props.allowDeleteOperation && props.allowDeleteOperation === true) {
145166
const deleteRequestTemplate = "{\r\n \"TableName\": \"" + this.dynamoTable.tableName + "\",\r\n \"Key\": {\r\n \"" + partitionKeyName + "\": {\r\n \"S\": \"$input.params('" + partitionKeyName + "')\"\r\n }\r\n },\r\n \"ConditionExpression\": \"attribute_not_exists(Replies)\",\r\n \"ReturnValues\": \"ALL_OLD\"\r\n}";
146167
this.addActionToPolicy("dynamodb:DeleteItem");
147-
this.addMethod(apiGatewayResource, deleteRequestTemplate, "DeleteItem", "DELETE");
168+
defaults.addProxyMethodToApiResource({
169+
service: "dynamodb",
170+
action: "DeleteItem",
171+
apiGatewayRole: this.apiGatewayRole,
172+
apiMethod: "DELETE",
173+
apiResource: apiGatewayResource,
174+
requestTemplate: deleteRequestTemplate
175+
});
148176
}
149177
}
150178

@@ -156,53 +184,4 @@ export class ApiGatewayToDynamoDB extends Construct {
156184
actions: [ `${action}` ]
157185
}));
158186
}
159-
160-
private addMethod(apiResource: api.IResource, requestTemplate: string, dynamodbAction: string, apiMethod: string) {
161-
// Setup the API Gateway Integration
162-
const apiGatewayIntegration = new api.AwsIntegration({
163-
service: "dynamodb",
164-
action: dynamodbAction,
165-
integrationHttpMethod: "POST",
166-
options: {
167-
passthroughBehavior: api.PassthroughBehavior.NEVER,
168-
credentialsRole: this.apiGatewayRole,
169-
requestParameters: {
170-
"integration.request.header.Content-Type": "'application/json'"
171-
},
172-
requestTemplates: {
173-
"application/json": requestTemplate
174-
},
175-
integrationResponses: [
176-
{
177-
statusCode: "200"
178-
},
179-
{
180-
statusCode: "500",
181-
responseTemplates: {
182-
"text/html": "Error"
183-
},
184-
selectionPattern: "500"
185-
}
186-
]
187-
}
188-
});
189-
190-
// Setup the API Gateway method(s)
191-
apiResource.addMethod(apiMethod, apiGatewayIntegration, {
192-
methodResponses: [
193-
{
194-
statusCode: "200",
195-
responseParameters: {
196-
"method.response.header.Content-Type": true
197-
}
198-
},
199-
{
200-
statusCode: "500",
201-
responseParameters: {
202-
"method.response.header.Content-Type": true
203-
},
204-
}
205-
]
206-
});
207-
}
208187
}

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.57.0",
3+
"version": "1.58.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.57.0",
57-
"@aws-cdk/aws-apigateway": "~1.57.0",
58-
"@aws-cdk/aws-iam": "~1.57.0",
59-
"@aws-cdk/aws-dynamodb": "~1.57.0",
60-
"@aws-cdk/aws-logs": "~1.57.0",
61-
"@aws-solutions-constructs/core": "~1.57.0",
56+
"@aws-cdk/core": "~1.58.0",
57+
"@aws-cdk/aws-apigateway": "~1.58.0",
58+
"@aws-cdk/aws-iam": "~1.58.0",
59+
"@aws-cdk/aws-dynamodb": "~1.58.0",
60+
"@aws-cdk/aws-logs": "~1.58.0",
61+
"@aws-solutions-constructs/core": "~1.58.0",
6262
"constructs": "^3.0.2"
6363
},
6464
"devDependencies": {
65-
"@aws-cdk/assert": "~1.57.0",
65+
"@aws-cdk/assert": "~1.58.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.57.0",
76-
"@aws-cdk/aws-apigateway": "~1.57.0",
77-
"@aws-cdk/aws-iam": "~1.57.0",
78-
"@aws-cdk/aws-dynamodb": "~1.57.0",
79-
"@aws-solutions-constructs/core": "~1.57.0",
75+
"@aws-cdk/core": "~1.58.0",
76+
"@aws-cdk/aws-apigateway": "~1.58.0",
77+
"@aws-cdk/aws-iam": "~1.58.0",
78+
"@aws-cdk/aws-dynamodb": "~1.58.0",
79+
"@aws-solutions-constructs/core": "~1.58.0",
8080
"constructs": "^3.0.2",
81-
"@aws-cdk/aws-logs": "~1.57.0"
81+
"@aws-cdk/aws-logs": "~1.58.0"
8282
}
8383
}

source/patterns/@aws-solutions-constructs/aws-apigateway-dynamodb/test/__snapshots__/apigateway-dynamodb.test.js.snap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ Object {
5252
"KeyType": "HASH",
5353
},
5454
],
55+
"PointInTimeRecoverySpecification": Object {
56+
"PointInTimeRecoveryEnabled": true,
57+
},
5558
"SSESpecification": Object {
5659
"SSEEnabled": true,
5760
},

0 commit comments

Comments
 (0)