Skip to content

Commit

Permalink
chore(release): 1.144.0 (#18877)
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] committed Feb 8, 2022
2 parents bebd295 + 4fbb365 commit 22b034f
Show file tree
Hide file tree
Showing 402 changed files with 6,077 additions and 1,521 deletions.
4 changes: 2 additions & 2 deletions .devcontainer.json
@@ -1,8 +1,8 @@
{
"name": "Dev Container Definition - AWS CDK",
"image": "jsii/superchain",
"image": "jsii/superchain:1-buster-slim",
"postCreateCommand": "yarn build --skip-test --no-bail --skip-prereqs --skip-compat",
"extensions": [
"dbaeumer.vscode-eslint@2.1.5"
]
}
}
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Expand Up @@ -11,3 +11,10 @@ updates:
labels:
- "auto-approve"
open-pull-requests-limit: 5
- package-ecosystem: "pip"
directory: "/packages/@aws-cdk/lambda-layer-awscli"
schedule:
interval: "weekly"
labels:
- "auto-approve"
open-pull-requests-limit: 5
3 changes: 2 additions & 1 deletion .github/workflows/yarn-upgrade.yml
Expand Up @@ -49,6 +49,7 @@ jobs:
# We special-case typescript because it's not semantically versionned
# We special-case constructs because we want to stay in control of the minimum compatible version
# We special-case lerna because we have a patch on it that stops applying if Lerna upgrades. Remove this once https://github.com/lerna/lerna/pull/2874 releases.
# We special-case aws-sdk-mock because of breaking changes in type exports https://github.com/dwyl/aws-sdk-mock/pull/260. We are not respecting `@ts-ignore`
run: |-
# Upgrade dependencies at repository root
ncu --upgrade --filter=@types/node,@types/fs-extra --target=minor
Expand All @@ -57,7 +58,7 @@ jobs:
# Upgrade all the packages
lerna exec --parallel ncu -- --upgrade --filter=@types/node,@types/fs-extra --target=minor
lerna exec --parallel ncu -- --upgrade --filter=typescript --target=patch
lerna exec --parallel ncu -- --upgrade --reject='@types/node,@types/fs-extra,constructs,typescript,aws-sdk,${{ steps.list-packages.outputs.list }}' --target=minor
lerna exec --parallel ncu -- --upgrade --reject='@types/node,@types/fs-extra,constructs,typescript,aws-sdk,aws-sdk-mock,${{ steps.list-packages.outputs.list }}' --target=minor
# This will ensure the current lockfile is up-to-date with the dependency specifications (necessary for "yarn update" to run)
- name: Run "yarn install"
run: yarn install
Expand Down
18 changes: 18 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,24 @@

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.144.0](https://github.com/aws/aws-cdk/compare/v1.143.0...v1.144.0) (2022-02-08)


### Features

* **assets:** support networking mode for DockerImageAsset ([#18114](https://github.com/aws/aws-cdk/issues/18114)) ([a7b39f5](https://github.com/aws/aws-cdk/commit/a7b39f527976e29a7f39c1ba1813efba2e0aa209)), closes [#15516](https://github.com/aws/aws-cdk/issues/15516)
* **cfnspec:** cloudformation spec v55.0.0 ([#18827](https://github.com/aws/aws-cdk/issues/18827)) ([a1d94b3](https://github.com/aws/aws-cdk/commit/a1d94b3624eb1b6b543d8ce209ec85af8e85beda))
* **cli:** `cdk diff` works for Nested Stacks ([#18207](https://github.com/aws/aws-cdk/issues/18207)) ([1337b24](https://github.com/aws/aws-cdk/commit/1337b247e82d9462074416623e665cf9526d2cc0)), closes [#5722](https://github.com/aws/aws-cdk/issues/5722)
* **iotevents:** add grant method to Input class ([#18617](https://github.com/aws/aws-cdk/issues/18617)) ([e89688e](https://github.com/aws/aws-cdk/commit/e89688ec1dd7a3b072d23287cddcb73bccc16fd4))
* **iotevents:** support transition events ([#18768](https://github.com/aws/aws-cdk/issues/18768)) ([ccc1988](https://github.com/aws/aws-cdk/commit/ccc198864f92620857da09c68013123e9cd3f01d)), closes [#17711](https://github.com/aws/aws-cdk/issues/17711)
* **s3-deployment:** deploy data with deploy-time values ([#18659](https://github.com/aws/aws-cdk/issues/18659)) ([d40e332](https://github.com/aws/aws-cdk/commit/d40e332578f7590a0c949fdd01622a644cf9359b)), closes [#12903](https://github.com/aws/aws-cdk/issues/12903)


### Bug Fixes

* **aws-appsync:** Strip unsupported characters from Lambda DataSource ([#18765](https://github.com/aws/aws-cdk/issues/18765)) ([bb8d6f6](https://github.com/aws/aws-cdk/commit/bb8d6f6bf5941b76ef0590c99fe8e26440e09c18))
* **tooling:** update vscode devcontainer image ([#18455](https://github.com/aws/aws-cdk/issues/18455)) ([28647f7](https://github.com/aws/aws-cdk/commit/28647f7105da6bd02975aa7d90300d77fe85d0e6))

## [1.143.0](https://github.com/aws/aws-cdk/compare/v1.142.0...v1.143.0) (2022-02-02)


Expand Down
35 changes: 19 additions & 16 deletions CONTRIBUTING.md
Expand Up @@ -22,7 +22,7 @@ let us know if it's not up-to-date (even better, submit a PR with your correcti
- [Step 5: Merge](#step-5-merge)
- [Breaking Changes](#breaking-changes)
- [Documentation](#documentation)
- [rosetta](#rosetta)
- [Rosetta](#rosetta)
- [Tools](#tools)
- [Linters](#linters)
- [cfn2ts](#cfn2ts)
Expand Down Expand Up @@ -217,6 +217,8 @@ Work your magic. Here are some guidelines:
Watch out for their error messages and adjust your code accordingly.
* Every change requires a unit test
* If you change APIs, make sure to update the module's README file
* When you add new examples to the module's README file, you must also ensure they compile - the PR build will fail
if they do not. To learn more about how to ensure that they compile, see [Documentation](#documentation).
* Try to maintain a single feature/bugfix per pull request. It's okay to introduce a little bit of housekeeping
changes along the way, but try to avoid conflating multiple features. Eventually, all these are going to go into a
single commit, so you can use that to frame your scope.
Expand Down Expand Up @@ -508,7 +510,7 @@ the README for the `aws-ec2` module - https://docs.aws.amazon.com/cdk/api/latest

### Rosetta

The README file contains code snippets written as typescript code. Code snippets typed in fenced code blocks
The README file contains code snippets written as typescript code. Code snippets typed in fenced code blocks
(such as `` ```ts ``) will be automatically extracted, compiled and translated to other languages when the
during the [pack](#pack) step. We call this feature 'rosetta'.

Expand Down Expand Up @@ -541,11 +543,12 @@ When no fixture is specified, the fixture with the name
`rosetta/default.ts-fixture` will be used if present. `nofixture` can be used to
opt out of that behavior.

In an `@example` block, which is unfenced, the first line of the example can
contain three slashes to achieve the same effect:
In an `@example` block, which is unfenced, additional information pertaining to
the example can be provided via the `@exampleMetadata` tag:

```
/**
* @exampleMetadata fixture=with-bucket
* @example
* /// fixture=with-bucket
* bucket.addLifecycleTransition({ ...props });
Expand Down Expand Up @@ -582,21 +585,21 @@ cases where some of those do not apply - good judgement is to be applied):
// ...rest of the example...
```

- Within `.ts-fixture` files, make use of `declare` statements instead of
writing a compatible value (this will make your fixtures more durable):
- Make use of `declare` statements directly in examples for values that are
necessary for compilation but unimportant to the example:

```ts
// An hypothetical 'rosetta/default.ts-fixture' file in `@aws-cdk/core`
import * as kms from '@aws-cdk/aws-kms';
import * as s3 from '@aws-cdk/aws-s3';
import { StackProps } from '@aws-cdk/core';

declare const kmsKey: kms.IKey;
declare const bucket: s3.Bucket;

declare const props: StackProps;
// An example about adding a stage to a pipeline in the @aws-cdk/pipelines library
declare const pipeline: pipelines.CodePipeline;
declare const myStage: Stage;
pipeline.addStage(myStage);
```

- Utilize the `default.ts-fixture` that already exists rather than writing new
`.ts-fixture` files. This is because values stored in `.ts-fixture` files do
not surface to the examples visible in the docs, so while they help successful
compilation, they do not help users understand the example.

## Tools (Advanced)

### scripts/foreach.sh
Expand Down Expand Up @@ -662,7 +665,7 @@ extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-e

#### pkglint

The `pkglint` tool "lints" package.json files across the repo according to [rules.ts](tools/pkglint/lib/rules.ts).
The `pkglint` tool "lints" package.json files across the repo according to [rules.ts](tools/@aws-cdk/pkglint/lib/rules.ts).

To evaluate (and attempt to fix) all package linting issues in the repo, run the following command from the root of the
repository (after bootstrapping):
Expand Down
3 changes: 1 addition & 2 deletions design/aws-ecs/aws-ecs-fargate-capacity-providers.md
Expand Up @@ -2,7 +2,7 @@

## Objective

Since Capacity Providers are now supported in CloudFormation, incorporating support for Fargate Spot capacity has been one of the [top asks](https://github.com/aws/aws-cdk/issues?q=is%3Aissue+is%3Aopen+label%3A%40aws-cdk%2Faws-ecs+sort%3Areactions-%2B1-desc) for the ECS CDK module, with over 60 customer reactions. While there are still some outstanding issues regarding capacity provider support in general, specifically regarding cyclic workflows with named clusters (See: [CFN issue](http://%20https//github.com/aws/containers-roadmap/issues/631#issuecomment-702580141)), we should be able to move ahead with supporting `FARGATE` and `FARGATE_SPOT` capacity providers with our existing FargateService construct.
Since Capacity Providers are now supported in CloudFormation, incorporating support for Fargate Spot capacity has been one of the [top asks](https://github.com/aws/aws-cdk/issues?q=is%3Aissue+is%3Aopen+label%3A%40aws-cdk%2Faws-ecs+sort%3Areactions-%2B1-desc) for the ECS CDK module, with over 60 customer reactions. While there are still some outstanding issues regarding capacity provider support in general, specifically regarding cyclic workflows with named clusters (See: [CFN issue](https://github.com/aws/containers-roadmap/issues/631#issuecomment-702580141)), we should be able to move ahead with supporting `FARGATE` and `FARGATE_SPOT` capacity providers with our existing FargateService construct.

See: https://github.com/aws/aws-cdk/issues/5850

Expand Down Expand Up @@ -118,4 +118,3 @@ One alternative considered was to provide a more magical experience by populatin
For future extensibility, we can however add an `addCapacityProvider` method on the Cluster resource, to allow modifying the cluster CapacityProviders field post-construction.

Another option would be to create a new FargateCluster resource, that would have the two Fargate capacity providers set by default. The main advantage with this alternative would be that it would be consistent with the current Console experience, which sets the Fargate capacity providers for you if you choose the “Networking Only” cluster template via the cluster wizard. The downside is that it would be a more restrictive resource model that would go back on the decision to have a single generic ECS Cluster resource that could potentially contain both Fargate and EC2 services or tasks. Given that we are moving towards more generic versions of ECS resources, this is not a preferable solution. That being said, in the current iteration we can set the Fargate Capacity Providers on the cluster by default, but put them behind a feature flag, which we would be able to remove in the v2 version of the ECS module. Using the feature flag would ensure that there would not be a diff in the generated CFN template for existing customers defining ECS clusters in their stack who redeploy using an updated version of the CDK.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -16,7 +16,7 @@
},
"devDependencies": {
"@yarnpkg/lockfile": "^1.1.0",
"cdk-generate-synthetic-examples": "^0.1.3",
"cdk-generate-synthetic-examples": "^0.1.5",
"conventional-changelog-cli": "^2.2.2",
"fs-extra": "^9.1.0",
"graceful-fs": "^4.2.9",
Expand Down
Expand Up @@ -42,7 +42,7 @@
"@aws-cdk/cdk-integ-tools": "0.0.0",
"@aws-cdk/aws-autoscaling": "0.0.0",
"@aws-cdk/cfn2ts": "0.0.0",
"jest": "^27.4.7",
"jest": "^27.5.1",
"@aws-cdk/pkglint": "0.0.0",
"@aws-cdk/assertions": "0.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/app-delivery/package.json
Expand Up @@ -74,7 +74,7 @@
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^27.4.0",
"fast-check": "^2.21.0",
"jest": "^27.4.7"
"jest": "^27.5.1"
},
"repository": {
"type": "git",
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/assert-internal/package.json
Expand Up @@ -27,7 +27,7 @@
"@aws-cdk/cdk-build-tools": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^27.4.0",
"jest": "^27.4.7",
"jest": "^27.5.1",
"ts-jest": "^27.1.3"
},
"dependencies": {
Expand All @@ -40,7 +40,7 @@
"peerDependencies": {
"@aws-cdk/core": "0.0.0",
"constructs": "^3.3.69",
"jest": "^27.4.7"
"jest": "^27.5.1"
},
"repository": {
"url": "https://github.com/aws/aws-cdk.git",
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/assertions/package.json
Expand Up @@ -67,7 +67,7 @@
"@types/fs-extra": "^9.0.13",
"@types/jest": "^27.4.0",
"constructs": "^3.3.69",
"jest": "^27.4.7",
"jest": "^27.5.1",
"ts-jest": "^27.1.3"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/assets/package.json
Expand Up @@ -83,7 +83,7 @@
"@types/jest": "^27.4.0",
"@types/sinon": "^9.0.11",
"aws-cdk": "0.0.0",
"jest": "^27.4.7",
"jest": "^27.5.1",
"sinon": "^9.2.4",
"ts-mock-imports": "^1.3.8"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-applicationautoscaling/package.json
Expand Up @@ -85,7 +85,7 @@
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^27.4.0",
"fast-check": "^2.21.0",
"jest": "^27.4.7"
"jest": "^27.5.1"
},
"dependencies": {
"@aws-cdk/aws-autoscaling-common": "0.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-appmesh/package.json
Expand Up @@ -90,7 +90,7 @@
"@aws-cdk/cfn2ts": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^27.4.0",
"jest": "^27.4.7"
"jest": "^27.5.1"
},
"dependencies": {
"@aws-cdk/aws-acmpca": "0.0.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/@aws-cdk/aws-appsync/lib/data-source.ts
Expand Up @@ -111,7 +111,8 @@ export abstract class BaseDataSource extends CoreConstruct {
if (extended.type !== 'NONE') {
this.serviceRole = props.serviceRole || new Role(this, 'ServiceRole', { assumedBy: new ServicePrincipal('appsync') });
}
const name = props.name ?? id;
// Replace unsupported characters from DataSource name. The only allowed pattern is: {[_A-Za-z][_0-9A-Za-z]*}
const name = (props.name ?? id).replace(/[\W]+/g, '');
this.ds = new CfnDataSource(this, 'Resource', {
apiId: props.api.apiId,
name: name,
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-appsync/package.json
Expand Up @@ -86,7 +86,7 @@
"@aws-cdk/cfn2ts": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^27.4.0",
"jest": "^27.4.7"
"jest": "^27.5.1"
},
"dependencies": {
"@aws-cdk/aws-cognito": "0.0.0",
Expand Down
36 changes: 36 additions & 0 deletions packages/@aws-cdk/aws-appsync/test/appsync-lambda.test.ts
Expand Up @@ -65,6 +65,42 @@ describe('Lambda Data Source configuration', () => {
});
});

test('appsync sanitized datasource name from unsupported characters', () => {
const badCharacters = [...'!@#$%^&*()+-=[]{}\\|;:\'",<>?/'];

badCharacters.forEach((badCharacter) => {
// WHEN
const newStack = new cdk.Stack();
const graphqlapi = new appsync.GraphqlApi(newStack, 'baseApi', {
name: 'api',
schema: appsync.Schema.fromAsset(path.join(__dirname, 'appsync.test.graphql')),
});
const dummyFunction = new lambda.Function(newStack, 'func', {
code: lambda.Code.fromAsset(path.join(__dirname, 'verify/iam-query')),
handler: 'iam-query.handler',
runtime: lambda.Runtime.NODEJS_12_X,
});
graphqlapi.addLambdaDataSource(`data-${badCharacter}-source`, dummyFunction);

// THEN
Template.fromStack(newStack).hasResourceProperties('AWS::AppSync::DataSource', {
Type: 'AWS_LAMBDA',
Name: 'datasource',
});
});
});

test('appsync leaves underscore untouched in datasource name', () => {
// WHEN
api.addLambdaDataSource('data_source', func);

// THEN
Template.fromStack(stack).hasResourceProperties('AWS::AppSync::DataSource', {
Type: 'AWS_LAMBDA',
Name: 'data_source',
});
});

test('appsync errors when creating multiple lambda data sources with no configuration', () => {
// THEN
expect(() => {
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-athena/package.json
Expand Up @@ -85,7 +85,7 @@
"@aws-cdk/cfn2ts": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^27.4.0",
"jest": "^27.4.7"
"jest": "^27.5.1"
},
"dependencies": {
"@aws-cdk/core": "0.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-autoscaling-common/package.json
Expand Up @@ -76,7 +76,7 @@
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^27.4.0",
"fast-check": "^2.21.0",
"jest": "^27.4.7"
"jest": "^27.5.1"
},
"dependencies": {
"@aws-cdk/aws-iam": "0.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-autoscaling-hooktargets/package.json
Expand Up @@ -78,7 +78,7 @@
"@aws-cdk/cfn2ts": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^27.4.0",
"jest": "^27.4.7"
"jest": "^27.5.1"
},
"dependencies": {
"@aws-cdk/aws-autoscaling": "0.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-autoscaling/package.json
Expand Up @@ -87,7 +87,7 @@
"@aws-cdk/cx-api": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^27.4.0",
"jest": "^27.4.7"
"jest": "^27.5.1"
},
"dependencies": {
"@aws-cdk/aws-autoscaling-common": "0.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-batch/package.json
Expand Up @@ -85,7 +85,7 @@
"@aws-cdk/cfn2ts": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^27.4.0",
"jest": "^27.4.7"
"jest": "^27.5.1"
},
"dependencies": {
"@aws-cdk/aws-ec2": "0.0.0",
Expand Down
Expand Up @@ -33,17 +33,17 @@
"@types/sinon": "^9.0.11",
"@aws-cdk/cdk-build-tools": "0.0.0",
"aws-sdk": "^2.596.0",
"aws-sdk-mock": "^5.6.0",
"aws-sdk-mock": "5.6.0",
"eslint": "^7.32.0",
"eslint-config-standard": "^14.1.1",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.3.1",
"eslint-plugin-standard": "^4.1.0",
"jest": "^27.4.7",
"jest": "^27.5.1",
"lambda-tester": "^3.6.0",
"sinon": "^9.2.4",
"nock": "^13.2.2",
"nock": "^13.2.4",
"ts-jest": "^27.1.3"
}
}
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-cloudformation/package.json
Expand Up @@ -88,7 +88,7 @@
"@aws-cdk/pkglint": "0.0.0",
"@types/aws-lambda": "^8.10.92",
"@types/jest": "^27.4.0",
"jest": "^27.4.7"
"jest": "^27.5.1"
},
"dependencies": {
"@aws-cdk/aws-iam": "0.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-cloudfront/package.json
Expand Up @@ -86,7 +86,7 @@
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^27.4.0",
"aws-sdk": "^2.848.0",
"jest": "^27.4.7"
"jest": "^27.5.1"
},
"dependencies": {
"@aws-cdk/aws-certificatemanager": "0.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-cloudtrail/package.json
Expand Up @@ -86,7 +86,7 @@
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^27.4.0",
"aws-sdk": "^2.848.0",
"jest": "^27.4.7"
"jest": "^27.5.1"
},
"dependencies": {
"@aws-cdk/aws-events": "0.0.0",
Expand Down

0 comments on commit 22b034f

Please sign in to comment.