Skip to content

Commit

Permalink
Merge branch 'master' into lambda-nodejs-pnpm
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored May 20, 2021
2 parents 7ab655c + e478bf5 commit 5836a5c
Show file tree
Hide file tree
Showing 39 changed files with 411 additions and 179 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/auto-approve.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
|| github.event.pull_request.user.login == 'dependabot[bot]'
|| github.event.pull_request.user.login == 'dependabot-preview[bot]')
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: hmarr/[email protected]
with:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/close-stale-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:

jobs:
cleanup:
permissions:
issues: write
runs-on: ubuntu-latest
name: Stale issue job
steps:
Expand Down
30 changes: 16 additions & 14 deletions .github/workflows/closed-issue-message.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
name: Closed Issue Message
on:
issues:
types: [closed]
issues:
types: [closed]
jobs:
auto_comment:
runs-on: ubuntu-latest
steps:
- uses: aws-actions/closed-issue-message@v1
with:
# These inputs are both required
repo-token: "${{ secrets.GITHUB_TOKEN }}"
message: |
### ⚠️COMMENT VISIBILITY WARNING⚠️
Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.
auto_comment:
permissions:
issues: write
runs-on: ubuntu-latest
steps:
- uses: aws-actions/closed-issue-message@v1
with:
# These inputs are both required
repo-token: "${{ secrets.GITHUB_TOKEN }}"
message: |
### ⚠️COMMENT VISIBILITY WARNING⚠️
Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.
2 changes: 2 additions & 0 deletions .github/workflows/issue-label-assign.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ on:

jobs:
test:
permissions:
issues: write
runs-on: ubuntu-latest
steps:
- uses: Naturalclar/[email protected]
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/pr-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ on:

jobs:
validate-pr:
permissions:
pull-requests: read
runs-on: ubuntu-latest
steps:

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/v2-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ on:
jobs:
# Run yarn pkglint on merge forward PRs and commit the results
pkglint:
permissions:
pull-requests: write
contents: write
if: contains(github.event.pull_request.labels.*.name, 'pr/forward-merge')
runs-on: ubuntu-latest
steps:
Expand Down
43 changes: 39 additions & 4 deletions .github/workflows/yarn-upgrade.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
name: Yarn Upgrade

on:
# Disable this workflow
#schedule:
schedule:
# Every wednesday at 13:37 UTC
#- cron: 37 13 * * 3
- cron: 37 13 * * 3
workflow_dispatch: {}

jobs:
upgrade:
name: Yarn Upgrade
permissions:
contents: read
runs-on: ubuntu-latest
steps:

Expand Down Expand Up @@ -69,6 +70,39 @@ jobs:
# also - jest-enviroment-jsdom doesnt actually require 16.5.1 (https://github.com/facebook/jest/blob/master/packages/jest-environment-jsdom/package.json#L23)
run: yarn upgrade --pattern '!(jsdom)'

# Next, create and upload the changes as a patch file. This will later be downloaded to create a pull request
# Creating a pull request requires write permissions and it's best to keep write privileges isolated.
- name: Create Patch
run: |-
git add .
git diff --patch --staged > ${{ runner.temp }}/upgrade.patch
- name: Upload Patch
uses: actions/upload-artifact@v2
with:
name: upgrade.patch
path: ${{ runner.temp }}/upgrade.patch

pr:
name: Create Pull Request
needs: upgrade
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Check Out
uses: actions/checkout@v2

- name: Download patch
uses: actions/download-artifact@v2
with:
name: upgrade.patch
path: ${{ runner.temp }}

- name: Apply patch
run: '[ -s ${{ runner.temp }}/upgrade.patch ] && git apply ${{ runner.temp
}}/upgrade.patch || echo "Empty patch. Skipping."'

- name: Make Pull Request
uses: peter-evans/create-pull-request@v3
with:
Expand All @@ -83,5 +117,6 @@ jobs:
Ran npm-check-updates and yarn upgrade to keep the `yarn.lock` file up-to-date.
labels: contribution/core,dependencies,pr/auto-approve
team-reviewers: aws-cdk-team
# Privileged token so automated PR validation happens
# Github prevents further Github actions to be run if the default Github token is used.
# Instead use a privileged token here, so further GH actions can be triggered on this PR.
token: ${{ secrets.AUTOMATION_GITHUB_TOKEN }}
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,31 @@

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.105.0](https://github.com/aws/aws-cdk/compare/v1.104.0...v1.105.0) (2021-05-19)


### ⚠ BREAKING CHANGES TO EXPERIMENTAL FEATURES

* **lambda-nodejs:** using `banner` and `footer` now requires `esbuild` >= 0.9.0

### Features

* **apigatewayv2:** http api - lambda authorizer ([#13181](https://github.com/aws/aws-cdk/issues/13181)) ([4da78f6](https://github.com/aws/aws-cdk/commit/4da78f6ba2036f4a94d0e47c8581131b9bc23e14)), closes [#10534](https://github.com/aws/aws-cdk/issues/10534)
* **custom-resources:** restrict output of AwsCustomResource to list of paths ([#14041](https://github.com/aws/aws-cdk/issues/14041)) ([773ca8c](https://github.com/aws/aws-cdk/commit/773ca8c5d2a845f392f530d7710020075b884c72)), closes [#2825](https://github.com/aws/aws-cdk/issues/2825)
* **stepfunctions:** Add support for ResultSelector ([#14648](https://github.com/aws/aws-cdk/issues/14648)) ([50d486a](https://github.com/aws/aws-cdk/commit/50d486ad4e7d175dfac048dbb4abf5e4084ce4fe)), closes [#9904](https://github.com/aws/aws-cdk/issues/9904)


### Bug Fixes

* **cli:** Updated typo user to uses ([#14357](https://github.com/aws/aws-cdk/issues/14357)) ([7fe329c](https://github.com/aws/aws-cdk/commit/7fe329cd17502cf04c451153f6d19955621952dc))
* **core:** cannot determine packaging when bundling that produces an archive is skipped ([#14372](https://github.com/aws/aws-cdk/issues/14372)) ([163e812](https://github.com/aws/aws-cdk/commit/163e8122db994d0bea7077f025876dbeac490ead)), closes [#14369](https://github.com/aws/aws-cdk/issues/14369)
* **ecr:** add validations for ECR repository names ([#12613](https://github.com/aws/aws-cdk/issues/12613)) ([396dca9](https://github.com/aws/aws-cdk/commit/396dca965b56bfbe8a7aedb2bcaddb196b5560c4)), closes [#9877](https://github.com/aws/aws-cdk/issues/9877)
* **lambda:** unable to access SingletonFunction vpc connections ([#14533](https://github.com/aws/aws-cdk/issues/14533)) ([49d18ab](https://github.com/aws/aws-cdk/commit/49d18ab8e8f55f8b36584f7fb95427106139a140)), closes [#6261](https://github.com/aws/aws-cdk/issues/6261)
* **lambda-nodejs:** banner and footer values not escaped ([#14743](https://github.com/aws/aws-cdk/issues/14743)) ([81aa612](https://github.com/aws/aws-cdk/commit/81aa61213b4f5e3bd9cbbc155264252bd64d0f5b)), closes [#13576](https://github.com/aws/aws-cdk/issues/13576)
* **pipelines:** self-mutating builds cannot be run in privileged mode ([#14655](https://github.com/aws/aws-cdk/issues/14655)) ([73b9b4a](https://github.com/aws/aws-cdk/commit/73b9b4a89078d1425f4acdf50a6e9b5275b7e555)), closes [#11425](https://github.com/aws/aws-cdk/issues/11425)
* **pipelines:** stackOutput generates names too long to be used in useOutputs ([#14680](https://github.com/aws/aws-cdk/issues/14680)) ([d81e06d](https://github.com/aws/aws-cdk/commit/d81e06d5a5651cf332614d73e27bf6ed95d083a3)), closes [#13552](https://github.com/aws/aws-cdk/issues/13552)
* **pipelines:** synth fails if 'aws-cdk' is not in `package.json` ([#14745](https://github.com/aws/aws-cdk/issues/14745)) ([0b8ee97](https://github.com/aws/aws-cdk/commit/0b8ee97b7c029c5195de694a1d2eea309c343f61)), closes [#14658](https://github.com/aws/aws-cdk/issues/14658)

## [1.104.0](https://github.com/aws/aws-cdk/compare/v1.103.0...v1.104.0) (2021-05-14)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"aws-sdk-mock": "^5.1.0",
"eslint": "^7.26.0",
"eslint-config-standard": "^14.1.1",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-import": "^2.23.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.3.1",
"eslint-plugin-standard": "^4.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"aws-sdk-mock": "^5.1.0",
"eslint": "^7.26.0",
"eslint-config-standard": "^14.1.1",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-import": "^2.23.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.3.1",
"eslint-plugin-standard": "^4.1.0",
Expand Down
8 changes: 8 additions & 0 deletions packages/@aws-cdk/aws-dynamodb/lib/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,13 @@ export interface TableOptions {
* @default Duration.minutes(30)
*/
readonly replicationTimeout?: Duration;

/**
* Whether CloudWatch contributor insights is enabled.
*
* @default false
*/
readonly contributorInsightsEnabled?: boolean;
}

/**
Expand Down Expand Up @@ -1114,6 +1121,7 @@ export class Table extends TableBase {
sseSpecification,
streamSpecification,
timeToLiveSpecification: props.timeToLiveAttribute ? { attributeName: props.timeToLiveAttribute, enabled: true } : undefined,
contributorInsightsSpecification: props.contributorInsightsEnabled !== undefined ? { enabled: props.contributorInsightsEnabled } : undefined,
});
this.table.applyRemovalPolicy(props.removalPolicy);

Expand Down
2 changes: 2 additions & 0 deletions packages/@aws-cdk/aws-dynamodb/test/dynamodb.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ test('when specifying every property', () => {
timeToLiveAttribute: 'timeToLive',
partitionKey: TABLE_PARTITION_KEY,
sortKey: TABLE_SORT_KEY,
contributorInsightsEnabled: true,
});
Tags.of(table).add('Environment', 'Production');

Expand All @@ -353,6 +354,7 @@ test('when specifying every property', () => {
TableName: 'MyTable',
Tags: [{ Key: 'Environment', Value: 'Production' }],
TimeToLiveSpecification: { AttributeName: 'timeToLive', Enabled: true },
ContributorInsightsSpecification: { Enabled: true },
},
);
});
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-lambda-nodejs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"cdk-build-tools": "0.0.0",
"cdk-integ-tools": "0.0.0",
"delay": "5.0.0",
"esbuild": "^0.11.20",
"esbuild": "^0.12.1",
"pkglint": "0.0.0",
"@aws-cdk/assert-internal": "0.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/cloud-assembly-schema/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"devDependencies": {
"@types/jest": "^26.0.23",
"@types/mock-fs": "^4.13.0",
"@types/semver": "^7.3.5",
"@types/semver": "^7.3.6",
"cdk-build-tools": "0.0.0",
"jest": "^26.6.3",
"mock-fs": "^4.14.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/cloudformation-diff/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
"license": "Apache-2.0",
"dependencies": {
"@aws-cdk/cfnspec": "0.0.0",
"@types/node": "^10.17.56",
"@types/node": "^10.17.60",
"colors": "^1.4.0",
"diff": "^5.0.0",
"fast-deep-equal": "^3.1.3",
"string-width": "^4.2.2",
"table": "^6.7.0"
"table": "^6.7.1"
},
"devDependencies": {
"@types/jest": "^26.0.23",
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@
"@types/jest": "^26.0.23",
"@types/lodash": "^4.14.169",
"@types/minimatch": "^3.0.4",
"@types/node": "^10.17.59",
"@types/node": "^10.17.60",
"@types/sinon": "^9.0.11",
"cdk-build-tools": "0.0.0",
"cfn2ts": "0.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/cx-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"devDependencies": {
"@types/jest": "^26.0.23",
"@types/mock-fs": "^4.13.0",
"@types/semver": "^7.3.5",
"@types/semver": "^7.3.6",
"cdk-build-tools": "0.0.0",
"jest": "^26.6.3",
"mock-fs": "^4.14.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/@monocdk-experiment/assert/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"devDependencies": {
"@monocdk-experiment/rewrite-imports": "0.0.0",
"@types/jest": "^26.0.23",
"@types/node": "^10.17.59",
"@types/node": "^10.17.60",
"cdk-build-tools": "0.0.0",
"constructs": "^3.3.69",
"jest": "^26.6.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/@monocdk-experiment/rewrite-imports/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"devDependencies": {
"@types/glob": "^7.1.3",
"@types/jest": "^26.0.23",
"@types/node": "^10.17.59",
"@types/node": "^10.17.60",
"cdk-build-tools": "0.0.0",
"pkglint": "0.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk-lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@
"@aws-cdk/pipelines": "0.0.0",
"@aws-cdk/region-info": "0.0.0",
"@types/fs-extra": "^8.1.1",
"@types/node": "^10.17.59",
"@types/node": "^10.17.60",
"cdk-build-tools": "0.0.0",
"constructs": "^3.3.69",
"fs-extra": "^9.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk-migration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"devDependencies": {
"@types/glob": "^7.1.3",
"@types/jest": "^26.0.23",
"@types/node": "^10.17.59",
"@types/node": "^10.17.60",
"cdk-build-tools": "0.0.0",
"pkglint": "0.0.0"
},
Expand Down
68 changes: 68 additions & 0 deletions packages/aws-cdk/lib/init-templates/v2/app/go/%name%.template.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
package main

import (
"github.com/aws/aws-cdk-go/awscdk/v2"
"github.com/aws/aws-cdk-go/awscdk/v2/awssns"
"github.com/aws/constructs-go/constructs/v10"
"github.com/aws/jsii-runtime-go"
)

type %name.PascalCased%StackProps struct {
awscdk.StackProps
}

func New%name.PascalCased%Stack(scope constructs.Construct, id string, props *%name.PascalCased%StackProps) awscdk.Stack {
var sprops awscdk.StackProps
if props != nil {
sprops = props.StackProps
}
stack := awscdk.NewStack(scope, &id, &sprops)

// The code that defines your stack goes here

// as an example, here's how you would define an AWS SNS topic:
awssns.NewTopic(stack, jsii.String("MyTopic"), &awssns.TopicProps{
DisplayName: jsii.String("MyCoolTopic"),
})

return stack
}

func main() {
app := awscdk.NewApp(nil)

New%name.PascalCased%Stack(app, "%name.PascalCased%Stack", &%name.PascalCased%StackProps{
awscdk.StackProps{
Env: env(),
},
})

app.Synth(nil)
}

// env determines the AWS environment (account+region) in which our stack is to
// be deployed. For more information see: https://docs.aws.amazon.com/cdk/latest/guide/environments.html
func env() *awscdk.Environment {
// If unspecified, this stack will be "environment-agnostic".
// Account/Region-dependent features and context lookups will not work, but a
// single synthesized template can be deployed anywhere.
//---------------------------------------------------------------------------
return nil

// Uncomment if you know exactly what account and region you want to deploy
// the stack to. This is the recommendation for production stacks.
//---------------------------------------------------------------------------
// return &awscdk.Environment{
// Account: jsii.String("123456789012"),
// Region: jsii.String("us-east-1"),
// }

// Uncomment to specialize this stack for the AWS Account and Region that are
// implied by the current CLI configuration. This is recommended for dev
// stacks.
//---------------------------------------------------------------------------
// return &awscdk.Environment{
// Account: jsii.String(os.Getenv("CDK_DEFAULT_ACCOUNT")),
// Region: jsii.String(os.Getenv("CDK_DEFAULT_REGION")),
// }
}
Loading

0 comments on commit 5836a5c

Please sign in to comment.