Skip to content

Commit 15300ed

Browse files
committed
Update to version v1.78.0
1 parent bd96e95 commit 15300ed

File tree

46 files changed

+1196
-2851
lines changed

Some content is hidden

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

46 files changed

+1196
-2851
lines changed

.github/workflows/slack-notify.yml

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# This is a workflow to notify Slack of any relevant activities on Github.
2+
name: Slack Notifications Workflow
3+
4+
# Controls when the action will run.
5+
on:
6+
issues:
7+
types: [opened]
8+
issue_comment:
9+
types: [created]
10+
pull_request:
11+
types: [opened]
12+
release:
13+
types: [published]
14+
15+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
16+
jobs:
17+
slackNotification:
18+
name: Slack Notifications Job
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Issue Slack Notification
22+
if: github.event_name == 'issues' || github.event_name == 'issue_comment'
23+
uses: 8398a7/action-slack@v3
24+
with:
25+
status: custom
26+
fields: all
27+
custom_payload: |
28+
{
29+
Type: 'Issue',
30+
Content: `https://github.com/awslabs/aws-solutions-constructs/issues/${{ env.ISSUE_NUMBER }}`
31+
}
32+
env:
33+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
34+
ISSUE_NUMBER: ${{ github.event.issue.number }}
35+
- name: PR Slack Notification
36+
if: github.event_name == 'pull_request'
37+
uses: 8398a7/action-slack@v3
38+
with:
39+
status: custom
40+
fields: all
41+
custom_payload: |
42+
{
43+
Type: 'Pull Request',
44+
Content: `https://github.com/awslabs/aws-solutions-constructs/pull/${{ env.PR_NUMBER }}`
45+
}
46+
env:
47+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
48+
PR_NUMBER: ${{ github.event.number }}
49+
- name: Set env
50+
if: github.event_name == 'release'
51+
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
52+
- name: Release Slack Notification
53+
if: github.event_name == 'release'
54+
uses: 8398a7/action-slack@v3
55+
with:
56+
status: custom
57+
fields: all
58+
custom_payload: |
59+
{
60+
Version: `${{ env.TAG_NAME }}`,
61+
Content: `https://github.com/awslabs/aws-solutions-constructs/releases/tag/${{ env.TAG_NAME }}`
62+
}
63+
env:
64+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_RELEASE_WEBHOOK }}
65+
TAG_NAME: ${{ env.RELEASE_VERSION }}

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ cdk.context.json
1515
.cdk.staging/
1616
cdk.out/
1717
*.tabl.json
18+
source/patterns/@aws-solutions-constructs/**/cdk-integ.out/
1819

1920
source/patterns/**/tsconfig.json
2021
deployment/dist/*

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
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.78.0 (2020-12-22)
6+
7+
### Changed
8+
- Upgraded all patterns to CDK v1.78.0
9+
- Allow for `existingTableObj?` for `aws-apigateway-dynamodb` pattern ([#53](https://github.com/awslabs/aws-solutions-constructs/issues/53))
10+
- Updated `aws-cloudfront-apigateway-*` and `aws-cloudfront-mediastore` patterns due to CDK v1.78.0 breaking change: `cloudfront-origins: Default minimum origin SSL protocol for HttpOrigin and LoadBalancerOrigin changed from SSLv3 to TLSv1.2.`
11+
512
## 1.77.0 (2020-12-16)
613

714
### Added

source/lerna.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
"./patterns/@aws-solutions-constructs/*"
77
],
88
"rejectCycles": "true",
9-
"version": "1.77.0"
9+
"version": "1.78.0"
1010
}

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

+19-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import * as iam from '@aws-cdk/aws-iam';
1616
import * as defaults from '@aws-solutions-constructs/core';
1717
import { Construct } from '@aws-cdk/core';
1818
import * as dynamodb from '@aws-cdk/aws-dynamodb';
19-
import { overrideProps } from '@aws-solutions-constructs/core';
19+
import { getPartitionKeyNameFromTable, overrideProps } from '@aws-solutions-constructs/core';
2020
import { LogGroup } from '@aws-cdk/aws-logs';
2121

2222
/**
@@ -29,6 +29,12 @@ export interface ApiGatewayToDynamoDBProps {
2929
* @default - Default props are used
3030
*/
3131
readonly dynamoTableProps?: dynamodb.TableProps,
32+
/**
33+
* Existing instance of DynamoDB table object, If this is set then the dynamoTableProps is ignored
34+
*
35+
* @default - None
36+
*/
37+
readonly existingTableObj?: dynamodb.Table,
3238
/**
3339
* Optional user-provided props to override the default props for the API Gateway.
3440
*
@@ -99,17 +105,26 @@ export class ApiGatewayToDynamoDB extends Construct {
99105
constructor(scope: Construct, id: string, props: ApiGatewayToDynamoDBProps) {
100106
super(scope, id);
101107
let partitionKeyName: string;
108+
let dynamoTableProps: dynamodb.TableProps;
102109

103110
// Set the default props for DynamoDB table
104111
if (props.dynamoTableProps) {
105-
const dynamoTableProps: dynamodb.TableProps = overrideProps(defaults.DefaultTableProps, props.dynamoTableProps);
112+
dynamoTableProps = overrideProps(defaults.DefaultTableProps, props.dynamoTableProps);
106113
partitionKeyName = dynamoTableProps.partitionKey.name;
107-
this.dynamoTable = new dynamodb.Table(this, 'DynamoTable', dynamoTableProps);
108114
} else {
109115
partitionKeyName = defaults.DefaultTableProps.partitionKey.name;
110-
this.dynamoTable = new dynamodb.Table(this, 'DynamoTable', defaults.DefaultTableProps);
116+
dynamoTableProps = defaults.DefaultTableProps;
111117
}
112118

119+
if (props.existingTableObj) {
120+
partitionKeyName = getPartitionKeyNameFromTable(props.existingTableObj);
121+
}
122+
123+
this.dynamoTable = defaults.buildDynamoDBTable(this, {
124+
existingTableObj: props.existingTableObj,
125+
dynamoTableProps,
126+
});
127+
113128
// Setup the API Gateway
114129
[this.apiGateway, this.apiGatewayCloudWatchRole, this.apiGatewayLogGroup] = defaults.GlobalRestApi(this, props.apiGatewayProps);
115130

0 commit comments

Comments
 (0)