Skip to content

Commit

Permalink
chore(release): 1.63.0 (aws#10318)
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Sep 13, 2020
2 parents 8c2d7fc + 8a2cbcc commit 7a68125
Show file tree
Hide file tree
Showing 216 changed files with 9,643 additions and 2,200 deletions.
4 changes: 0 additions & 4 deletions .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ pull_request_rules:
method: squash
strict_method: merge
commit_message: title+body
delete_head_branch: {}
conditions:
- base!=release
- -title~=(WIP|wip)
Expand All @@ -41,7 +40,6 @@ pull_request_rules:
method: squash
strict_method: merge
commit_message: title+body
delete_head_branch: {}
conditions:
- base!=release
- -title~=(WIP|wip)
Expand All @@ -67,7 +65,6 @@ pull_request_rules:
method: merge
strict_method: merge
commit_message: title+body
delete_head_branch: {}
conditions:
- -title~=(WIP|wip)
- -label~=(blocked|do-not-merge)
Expand Down Expand Up @@ -115,7 +112,6 @@ pull_request_rules:
# It's not dangerous: GitHub branch protection settings prevent merging stale branches.
strict: false
method: squash
delete_head_branch: {}
conditions:
- -title~=(WIP|wip)
- -label~=(blocked|do-not-merge)
Expand Down
61 changes: 61 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,66 @@

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.63.0](https://github.com/aws/aws-cdk/compare/v1.62.0...v1.63.0) (2020-09-12)


### ⚠ BREAKING CHANGES TO EXPERIMENTAL FEATURES

* **appsync:** force `apiKeyConfig` require a Expiration class instead of string
- **appsync**: Parameter `apiKeyConfig` takes `Expiration` class instead of `string`
* **core:** custom implementations of `IStackSynthesizer`
must now implement `synthesize()` instead of
`synthesizeStackArtifacts()`.
* **aws-batch:** Changed type of `ComputeResources.computeResourcesTags` from `Tag` to map

### Features

* **appsync:** add authorization config to the HttpDataSource ([#10171](https://github.com/aws/aws-cdk/issues/10171)) ([b2cc277](https://github.com/aws/aws-cdk/commit/b2cc277971aed36aa03e720b8fea093ef14bd9be)), closes [#9971](https://github.com/aws/aws-cdk/issues/9971) [#9934](https://github.com/aws/aws-cdk/issues/9934)
* **appsync:** add support for subscriptions for code-first schema generation ([#10078](https://github.com/aws/aws-cdk/issues/10078)) ([65db131](https://github.com/aws/aws-cdk/commit/65db1312d6b395700c203edeb50248b5e8a0c036)), closes [#9345](https://github.com/aws/aws-cdk/issues/9345)
* **appsync:** implement directives for code-first approach ([#9973](https://github.com/aws/aws-cdk/issues/9973)) ([088cd48](https://github.com/aws/aws-cdk/commit/088cd4857f2f3f29873bdf5f7d1c4b25b3d49372)), closes [#9879](https://github.com/aws/aws-cdk/issues/9879)
* **appsync:** support enumeration types for code-first approach ([#10023](https://github.com/aws/aws-cdk/issues/10023)) ([30a5b80](https://github.com/aws/aws-cdk/commit/30a5b806f265d88e88d2faea623e1ce024c019c3)), closes [#10023](https://github.com/aws/aws-cdk/pull/10023#issuecomment-690773916)
* **appsync:** support union types for code-first approach ([#10025](https://github.com/aws/aws-cdk/issues/10025)) ([28a9834](https://github.com/aws/aws-cdk/commit/28a9834fb6cbacbd3e0ef97441fa0fb6e45120b1))
* **cfn-include:** add support for Hooks ([#10143](https://github.com/aws/aws-cdk/issues/10143)) ([4de68c0](https://github.com/aws/aws-cdk/commit/4de68c0a5b0e7568a5e222e8a29703186b961ec7)), closes [#9713](https://github.com/aws/aws-cdk/issues/9713)
* **cfn-include:** allow renaming the template elements logical IDs ([#10169](https://github.com/aws/aws-cdk/issues/10169)) ([cf746a0](https://github.com/aws/aws-cdk/commit/cf746a07be171b35bb5e5514287c628642436df3)), closes [#9714](https://github.com/aws/aws-cdk/issues/9714)
* **chatbot:** log retention support and metrics utility methods ([#10137](https://github.com/aws/aws-cdk/issues/10137)) ([0f0d1e7](https://github.com/aws/aws-cdk/commit/0f0d1e74fb71a7b415aa9a5d02258b7c5933536b)), closes [#10135](https://github.com/aws/aws-cdk/issues/10135)
* **cli:** support credential_source in aws shared config file ([#10272](https://github.com/aws/aws-cdk/issues/10272)) ([940a443](https://github.com/aws/aws-cdk/commit/940a443ba457ddaebd85b44fa63cd9b15201c18a))
* **codebuild:** add git submodule options of codebuild ([#10283](https://github.com/aws/aws-cdk/issues/10283)) ([698e5ef](https://github.com/aws/aws-cdk/commit/698e5ef3568880474adf73a38c21dad919b62b7e)), closes [#10271](https://github.com/aws/aws-cdk/issues/10271)
* **eks:** arm64 support ([#9875](https://github.com/aws/aws-cdk/issues/9875)) ([ffb84c6](https://github.com/aws/aws-cdk/commit/ffb84c62d03e40daa0e07c451c31bdea2dd0816c)), closes [#9915](https://github.com/aws/aws-cdk/issues/9915)
* **eks:** bump aws-node-termination-handler to 0.9.5 ([#10278](https://github.com/aws/aws-cdk/issues/10278)) ([8cfc190](https://github.com/aws/aws-cdk/commit/8cfc190daaa112de448c19716df2c10eeb29695c)), closes [aws/aws-cdk#10277](https://github.com/aws/aws-cdk/issues/10277)
* **eks:** managed nodegroup with custom AMI and launch template support ([#9881](https://github.com/aws/aws-cdk/issues/9881)) ([5c294fb](https://github.com/aws/aws-cdk/commit/5c294fbc1149167a70f35c7870ff1995042839b7)), closes [#9873](https://github.com/aws/aws-cdk/issues/9873)
* **elasticloadbalancingv2:** more health check validations to NLB target group ([#3703](https://github.com/aws/aws-cdk/issues/3703)) ([#10205](https://github.com/aws/aws-cdk/issues/10205)) ([e3f3332](https://github.com/aws/aws-cdk/commit/e3f333212b7c9f7deb836be8ecd71c7a7a06c394))
* **elasticloadbalancingv2:** multiple security groups for ALBs ([#10244](https://github.com/aws/aws-cdk/issues/10244)) ([1ebf362](https://github.com/aws/aws-cdk/commit/1ebf36206b1e6a98a9a708efbe3ba3bfb1d3f05e)), closes [#5138](https://github.com/aws/aws-cdk/issues/5138)
* **lambda-nodejs:** improved project root detection ([#10182](https://github.com/aws/aws-cdk/issues/10182)) ([cce83dc](https://github.com/aws/aws-cdk/commit/cce83dcc163da8f71b8c2f95818d7d8f25db95f4)), closes [#10174](https://github.com/aws/aws-cdk/issues/10174)
* **pipelines:** adding IAM permissions to ShellScriptAction ([#10149](https://github.com/aws/aws-cdk/issues/10149)) ([ec15485](https://github.com/aws/aws-cdk/commit/ec154850b6bc2f485241aa1c0ea41400785d8a41)), closes [#9600](https://github.com/aws/aws-cdk/issues/9600)
* **rds:** database clusters from snapshots ([#10130](https://github.com/aws/aws-cdk/issues/10130)) ([915eb4b](https://github.com/aws/aws-cdk/commit/915eb4be3946652a00b7496b9e8610169852f27b)), closes [#4379](https://github.com/aws/aws-cdk/issues/4379)
* **rds:** deprecate OracleSE and OracleSE1 engine versions ([#10241](https://github.com/aws/aws-cdk/issues/10241)) ([562f891](https://github.com/aws/aws-cdk/commit/562f8913dae7b77a1516a60cc1ff277ac42fb9e0)), closes [#9249](https://github.com/aws/aws-cdk/issues/9249)
* **rds:** metrics for clusters ([#10162](https://github.com/aws/aws-cdk/issues/10162)) ([49f6034](https://github.com/aws/aws-cdk/commit/49f6034ee2b514f870819b7b48880246750b6fd2)), closes [#5212](https://github.com/aws/aws-cdk/issues/5212)
* **route53-patterns:** support IPv6 in HttpsRedirect ([#10203](https://github.com/aws/aws-cdk/issues/10203)) ([a1f6e1b](https://github.com/aws/aws-cdk/commit/a1f6e1be8a21625b1723b51277457f598a3be23e))
* **secrets-manager:** exclude characters for password rotation applications ([#10110](https://github.com/aws/aws-cdk/issues/10110)) ([1260d52](https://github.com/aws/aws-cdk/commit/1260d5215d474d6edc2460ffe9658552d17ab239)), closes [#4144](https://github.com/aws/aws-cdk/issues/4144)


### Bug Fixes

* **appsync:** strongly type `expires` prop in apiKeyConfig ([#9122](https://github.com/aws/aws-cdk/issues/9122)) ([287f808](https://github.com/aws/aws-cdk/commit/287f808cf34870295e4032995fc083ac204b64c3)), closes [#8698](https://github.com/aws/aws-cdk/issues/8698)
* **aws-batch:** `computeResources` tags are not configured properly ([#10209](https://github.com/aws/aws-cdk/issues/10209)) ([40222ef](https://github.com/aws/aws-cdk/commit/40222ef398fd1fb63b3b886624d5bb40562142c6)), closes [#7350](https://github.com/aws/aws-cdk/issues/7350)
* **cfn-include:** correctly parse YAML strings in short-form GetAtt ([#10197](https://github.com/aws/aws-cdk/issues/10197)) ([a388d70](https://github.com/aws/aws-cdk/commit/a388d70f38a84195bbe5e580220b5cd21ebde624)), closes [#10177](https://github.com/aws/aws-cdk/issues/10177)
* **cfn-include:** correctly substitute falsy parameter values ([#10195](https://github.com/aws/aws-cdk/issues/10195)) ([8791f88](https://github.com/aws/aws-cdk/commit/8791f8877165c87f6ef4967376aa53ffeb696013)), closes [#10107](https://github.com/aws/aws-cdk/issues/10107)
* **cli:** metadata not recorded for templates >50k ([#10184](https://github.com/aws/aws-cdk/issues/10184)) ([dfd2baf](https://github.com/aws/aws-cdk/commit/dfd2baf8b9d4cc930a1c5dc88c178ffe7d1121b0))
* **cli:** simplify lib template ([#10175](https://github.com/aws/aws-cdk/issues/10175)) ([fc3ec9b](https://github.com/aws/aws-cdk/commit/fc3ec9b20edb2442bab456acf55c5cff7efb11b9))
* **cli:** unable to set termination protection for pipeline stacks ([#9938](https://github.com/aws/aws-cdk/issues/9938)) ([a00a4ee](https://github.com/aws/aws-cdk/commit/a00a4ee162f287b5db45e73051ecdf0e32009def))
* **cloudfront:** comment for origin access identity is too long ([#10266](https://github.com/aws/aws-cdk/issues/10266)) ([495aeb9](https://github.com/aws/aws-cdk/commit/495aeb96fd530ba0f73eeeab5a5b75b4a7390c99)), closes [#10211](https://github.com/aws/aws-cdk/issues/10211)
* **codepipeline:** cross-region support stack requires bootstrapping ([#10217](https://github.com/aws/aws-cdk/issues/10217)) ([b5ff4d6](https://github.com/aws/aws-cdk/commit/b5ff4d6673629ebabceb72fc83464001267c328e)), closes [#10215](https://github.com/aws/aws-cdk/issues/10215)
* **core:** DefaultSynthesizer breaks this.node.setContext() on Stack ([#10246](https://github.com/aws/aws-cdk/issues/10246)) ([61865aa](https://github.com/aws/aws-cdk/commit/61865aaef682be6727d7768213260c7a95d799f8))
* **core:** Stacks render CloudFormation elements in nested Stages ([#10156](https://github.com/aws/aws-cdk/issues/10156)) ([5f36f6b](https://github.com/aws/aws-cdk/commit/5f36f6b5b2126de763b2e156fa2a9b6604f40f00)), closes [#9792](https://github.com/aws/aws-cdk/issues/9792) [#9669](https://github.com/aws/aws-cdk/issues/9669)
* **custom-resources:** deleting custom resource fails when using two or more ([#10012](https://github.com/aws/aws-cdk/issues/10012)) ([8d23f24](https://github.com/aws/aws-cdk/commit/8d23f248c7496d56c352a3db4b9d4bcccbdfe1c4))
* **ec2:** cfn-init user data hash not updated if file asset changes ([#10216](https://github.com/aws/aws-cdk/issues/10216)) ([0d7ca63](https://github.com/aws/aws-cdk/commit/0d7ca63edb11a80440732d6327d0fe3ed685a993)), closes [#10206](https://github.com/aws/aws-cdk/issues/10206)
* **eks:** restricted public access breaks cluster functionality ([#10103](https://github.com/aws/aws-cdk/issues/10103)) ([a1b5bf6](https://github.com/aws/aws-cdk/commit/a1b5bf6f5a77e236169f95159cf62a2ecfb25bc4))
* **kms:** do not change the principal to root for imported resources in dependent Stacks ([#10299](https://github.com/aws/aws-cdk/issues/10299)) ([54dfe83](https://github.com/aws/aws-cdk/commit/54dfe8374afeaff400e85f43185462b9fd9c8ac2)), closes [#10166](https://github.com/aws/aws-cdk/issues/10166)
* **lambda-nodejs:** permission denied, mkdir '/.parcel-cache' ([#10181](https://github.com/aws/aws-cdk/issues/10181)) ([20f5535](https://github.com/aws/aws-cdk/commit/20f5535bee8d0e1e7aa5b0c3bad780666d64bc87))
* **pipelines:** changing synth action doesn't restart pipeline ([#10176](https://github.com/aws/aws-cdk/issues/10176)) ([14c8a98](https://github.com/aws/aws-cdk/commit/14c8a9878d092aac857655c2e5c8684015c84b29)), closes [#9458](https://github.com/aws/aws-cdk/issues/9458)
* **pipelines:** check for an empty Stage object ([#10153](https://github.com/aws/aws-cdk/issues/10153)) ([cec20c8](https://github.com/aws/aws-cdk/commit/cec20c8f68676c2bf3c8c3246334c82f50261358)), closes [#9559](https://github.com/aws/aws-cdk/issues/9559)
* **rds:** Make most DatabaseClusterAttributes properties optional ([#10291](https://github.com/aws/aws-cdk/issues/10291)) ([0653e6b](https://github.com/aws/aws-cdk/commit/0653e6bead37ed92e47295010645009e3b97e246)), closes [#3587](https://github.com/aws/aws-cdk/issues/3587)

## [1.62.0](https://github.com/aws/aws-cdk/compare/v1.61.1...v1.62.0) (2020-09-03)


Expand All @@ -10,6 +70,7 @@ All notable changes to this project will be documented in this file. See [standa
* **eks:** when importing EKS clusters using `eks.Cluster.fromClusterAttributes`, the `clusterArn` attribute is not supported anymore, and will always be derived from `clusterName`.
* **eks**: Only a single `eks.Cluster` is allowed per CloudFormation stack.
* **eks**: The `securityGroups` attribute of `ClusterAttributes` is now `securityGroupIds`.
* **cli**: `--qualifier` must be alphanumeric and not longer than 10 characters when bootstrapping using `newStyleStackSynthesis`.

### Features

Expand Down
7 changes: 7 additions & 0 deletions allowed-breaking-changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,10 @@ changed-type:@aws-cdk/aws-codedeploy.ServerDeploymentGroup.autoScalingGroups
change-return-type:@aws-cdk/aws-ecs.ContainerDefinition.renderContainerDefinition
change-return-type:@aws-cdk/aws-ecs.FirelensLogRouter.renderContainerDefinition
change-return-type:@aws-cdk/aws-ecs.LinuxParameters.renderLinuxParameters

# These were accidentally not marked @experimental
removed:@aws-cdk/core.BootstraplessSynthesizer.synthesizeStackArtifacts
removed:@aws-cdk/core.DefaultStackSynthesizer.synthesizeStackArtifacts
removed:@aws-cdk/core.LegacyStackSynthesizer.synthesizeStackArtifacts
removed:@aws-cdk/core.NestedStackSynthesizer.synthesizeStackArtifacts
removed:@aws-cdk/core.IStackSynthesizer.synthesizeStackArtifacts
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
"tools/*"
],
"rejectCycles": "true",
"version": "1.62.0"
"version": "1.63.0"
}
12 changes: 12 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,18 @@
"@aws-cdk/core/minimatch/**",
"@aws-cdk/cx-api/semver",
"@aws-cdk/cx-api/semver/**",
"aws-cdk-lib/case",
"aws-cdk-lib/case/**",
"aws-cdk-lib/fs-extra",
"aws-cdk-lib/fs-extra/**",
"aws-cdk-lib/jsonschema",
"aws-cdk-lib/jsonschema/**",
"aws-cdk-lib/minimatch",
"aws-cdk-lib/minimatch/**",
"aws-cdk-lib/semver",
"aws-cdk-lib/semver/**",
"aws-cdk-lib/yaml",
"aws-cdk-lib/yaml/**",
"monocdk-experiment/case",
"monocdk-experiment/case/**",
"monocdk-experiment/fs-extra",
Expand Down
59 changes: 59 additions & 0 deletions packages/@aws-cdk/assert/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,65 @@ expect(stack).to(haveResourceLike('AWS::IAM::Policy', {
}));
```
### Capturing values from a match
Special `Capture` matchers exist to capture values encountered during a match. These can be
used for two typical purposes:
* Apply additional assertions to the values found during a matching operation.
* Use the value found during a matching operation in a new matching operation.
`Capture` matchers take an inner matcher as an argument, and will only capture the value
if the inner matcher succeeds in matching the given value.
Here's an example which asserts that a policy for `RoleA` contains two statements
with *different* ARNs (without caring what those ARNs might be), and that
a policy for `RoleB` *also* has a statement for one of those ARNs (again, without
caring what the ARN might be):
```ts
const arn1 = Capture.aString();
const arn2 = Capture.aString();

expect(stack).to(haveResourceLike('AWS::IAM::Policy', {
Roles: ['RoleA'],
PolicyDocument: {
Statement: [
objectLike({
Resource: [arn1.capture()],
}),
objectLike({
Resource: [arn2.capture()],
}),
],
},
}));

// Don't care about the values as long as they are not the same
expect(arn1.capturedValue).not.toEqual(arn2.capturedValue);

expect(stack).to(haveResourceLike('AWS::IAM::Policy', {
Roles: ['RoleB'],
PolicyDocument: {
Statement: [
objectLike({
// This ARN must be the same as ARN1 above.
Resource: [arn1.capturedValue]
}),
],
},
}));
```
NOTE: `Capture` look somewhat like *bindings* in other pattern matching
libraries you might be used to, but they are far simpler and very
deterministic. In particular, they don't do unification: if the same Capture
is either used multiple times in the same structure expression or matches
multiple times, no restarting of the match is done to make them all match the
same value: the last value encountered by the `Capture` (as determined by the
behavior of the matchers around it) is stored into it and will be the one
available after the match has completed.
### Check number of resources
If you want to assert that `n` number of resources of a particular type exist, with or without specific properties:
Expand Down
98 changes: 98 additions & 0 deletions packages/@aws-cdk/assert/lib/assertions/have-resource-matchers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,104 @@ export function notMatching(matcher: any): PropertyMatcher {
});
}

export type TypeValidator<T> = (x: any) => x is T;

/**
* Captures a value onto an object if it matches a given inner matcher
*
* @example
*
* const someValue = Capture.aString();
* expect(stack).toHaveResource({
* // ...
* Value: someValue.capture(stringMatching('*a*')),
* });
* console.log(someValue.capturedValue);
*/
export class Capture<T=any> {
/**
* A Capture object that captures any type
*/
public static anyType(): Capture<any> {
return new Capture();
}

/**
* A Capture object that captures a string type
*/
public static aString(): Capture<string> {
return new Capture((x: any): x is string => {
if (typeof x !== 'string') {
throw new Error(`Expected to capture a string, got '${x}'`);
}
return true;
});
}

/**
* A Capture object that captures a custom type
*/
public static a<T>(validator: TypeValidator<T>): Capture<T> {
return new Capture(validator);
}

private _value?: T;
private _didCapture = false;
private _wasInvoked = false;

protected constructor(private readonly typeValidator?: TypeValidator<T>) {
}

/**
* Capture the value if the inner matcher successfully matches it
*
* If no matcher is given, `anything()` is assumed.
*
* And exception will be thrown if the inner matcher returns `true` and
* the value turns out to be of a different type than the `Capture` object
* is expecting.
*/
public capture(matcher?: any): PropertyMatcher {
if (matcher === undefined) {
matcher = anything();
}

return annotateMatcher({ $capture: matcher }, (value: any, failure: InspectionFailure) => {
this._wasInvoked = true;
const result = matcherFrom(matcher)(value, failure);
if (result) {
if (this.typeValidator && !this.typeValidator(value)) {
throw new Error(`Value not of the expected type: ${value}`);
}
this._didCapture = true;
this._value = value;
}
return result;
});
}

/**
* Whether a value was successfully captured
*/
public get didCapture() {
return this._didCapture;
}

/**
* Return the value that was captured
*
* Throws an exception if now value was captured
*/
public get capturedValue(): T {
// When this module is ported to jsii, the type parameter will obviously
// have to be dropped and this will have to turn into an `any`.
if (!this.didCapture) {
throw new Error(`Did not capture a value: ${this._wasInvoked ? 'inner matcher failed' : 'never invoked'}`);
}
return this._value!;
}
}

/**
* Match on the innards of a JSON string, instead of the complete string
*/
Expand Down
Loading

0 comments on commit 7a68125

Please sign in to comment.