Skip to content

Commit

Permalink
chore(release): 1.119.0 (#16098)
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Aug 17, 2021
2 parents a4f0418 + 8f706d5 commit 2921d64
Show file tree
Hide file tree
Showing 107 changed files with 1,775 additions and 912 deletions.
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,25 @@

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.119.0](https://github.com/aws/aws-cdk/compare/v1.118.0...v1.119.0) (2021-08-17)


### Features

* **apigatewayv2:** http api - domain url for a stage ([#15973](https://github.com/aws/aws-cdk/issues/15973)) ([bb5d587](https://github.com/aws/aws-cdk/commit/bb5d5874098b4b1047a29b6697e5e3a65f349ff0)), closes [#15801](https://github.com/aws/aws-cdk/issues/15801)
* **assets:** exclude "cdk.out" from docker assets ([#16034](https://github.com/aws/aws-cdk/issues/16034)) ([84a831a](https://github.com/aws/aws-cdk/commit/84a831ab804244d426321504fc0971d74f6181fd)), closes [#14841](https://github.com/aws/aws-cdk/issues/14841) [#14842](https://github.com/aws/aws-cdk/issues/14842)
* **aws-apigateway:** import existing usage plan ([#15771](https://github.com/aws/aws-cdk/issues/15771)) ([97fc290](https://github.com/aws/aws-cdk/commit/97fc29032c05edb7914c48efee0124be0126a5c4)), closes [#12677](https://github.com/aws/aws-cdk/issues/12677)
* **cfnspec:** cloudformation spec v39.9.0 ([#15987](https://github.com/aws/aws-cdk/issues/15987)) ([e0d6181](https://github.com/aws/aws-cdk/commit/e0d61810ab78f7cab1af53bce82c60790a814f71))


### Bug Fixes

* **core:** asset bundling fails for non-existent user ([#15313](https://github.com/aws/aws-cdk/issues/15313)) ([bf5882f](https://github.com/aws/aws-cdk/commit/bf5882f8def0676bbfaee7c2ff4fab6bf39df281)), closes [#15415](https://github.com/aws/aws-cdk/issues/15415)
* **ec2:** opaque error when insufficient NAT EIPs are configured ([#16040](https://github.com/aws/aws-cdk/issues/16040)) ([a308cac](https://github.com/aws/aws-cdk/commit/a308cacf1fc48e24311caec246b768ffe6ae9153)), closes [#16039](https://github.com/aws/aws-cdk/issues/16039)
* **events:** cross-account event targets that have a Role are broken ([#15717](https://github.com/aws/aws-cdk/issues/15717)) ([f570c94](https://github.com/aws/aws-cdk/commit/f570c94a7bc99cd5bebc96ee388d152220f9f613)), closes [#15639](https://github.com/aws/aws-cdk/issues/15639)
* **pipelines:** repos with dashes cannot be used as additionalInputs ([#16017](https://github.com/aws/aws-cdk/issues/16017)) ([400a59d](https://github.com/aws/aws-cdk/commit/400a59d19ee63fbd9318da34760b4ed8c9ba99b9)), closes [#15753](https://github.com/aws/aws-cdk/issues/15753)
* **s3-deployment:** BucketDeployment doesn't validate that distribution paths start with "/" ([#15865](https://github.com/aws/aws-cdk/issues/15865)) ([f8d8795](https://github.com/aws/aws-cdk/commit/f8d8795a610c3f49e31967001695caa648730d6d)), closes [#9317](https://github.com/aws/aws-cdk/issues/9317)

## [1.118.0](https://github.com/aws/aws-cdk/compare/v1.117.0...v1.118.0) (2021-08-10)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,15 @@ class StackMatchesTemplateAssertion extends Assertion<StackInspector> {
}

for (const change of Object.values(diff.parameters.changes)) {
if (change.isAddition) { return false; }
if (!change.isAddition) { return false; }
}

for (const change of Object.values(diff.outputs.changes)) {
if (change.isAddition || change.isUpdate) { return false; }
if (!change.isAddition) { return false; }
}

return true;
}
throw new Error(`Unsupported match style: ${this.matchStyle}`);
}

public get description(): string {
Expand Down
29 changes: 29 additions & 0 deletions packages/@aws-cdk/assert-internal/test/cloud-artifact.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import * as fs from 'fs';
import * as path from 'path';
import * as cxschema from '@aws-cdk/cloud-assembly-schema';
import * as cxapi from '@aws-cdk/cx-api';

export function mkStack(template: any): cxapi.CloudFormationStackArtifact {
const assembly = new cxapi.CloudAssemblyBuilder();
assembly.addArtifact('test', {
type: cxschema.ArtifactType.AWS_CLOUDFORMATION_STACK,
environment: cxapi.EnvironmentUtils.format('123456789012', 'bermuda-triangle-1'),
properties: {
templateFile: 'template.json',
},
});

fs.writeFileSync(path.join(assembly.outdir, 'template.json'), JSON.stringify(template));
return assembly.buildAssembly().getStackByName('test');
}

export function mkResource(props: any): cxapi.CloudFormationStackArtifact {
return mkStack({
Resources: {
SomeResource: {
Type: 'Some::Resource',
Properties: props,
},
},
});
}
26 changes: 3 additions & 23 deletions packages/@aws-cdk/assert-internal/test/have-output.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { unlink, writeFileSync } from 'fs';
import { join } from 'path';
import * as cxschema from '@aws-cdk/cloud-assembly-schema';
import { unlink } from 'fs';
import * as cxapi from '@aws-cdk/cx-api';
import { mkStack } from './cloud-artifact';
import '../jest';

let templateFilePath: string;
Expand Down Expand Up @@ -180,23 +179,4 @@ afterEach(done => {
} else {
done();
}
});

function mkStack(template: any): cxapi.CloudFormationStackArtifact {
const templateFileName = 'test-have-output-template.json';
const stackName = 'test-have-output';
const assembly = new cxapi.CloudAssemblyBuilder();

assembly.addArtifact(stackName, {
type: cxschema.ArtifactType.AWS_CLOUDFORMATION_STACK,
environment: cxapi.EnvironmentUtils.format('123456789012', 'bermuda-triangle-1'),
properties: {
templateFile: templateFileName,
},
});

templateFilePath = join(assembly.outdir, templateFileName);
writeFileSync(templateFilePath, JSON.stringify(template));

return assembly.buildAssembly().getStackByName(stackName);
}
});
48 changes: 10 additions & 38 deletions packages/@aws-cdk/assert-internal/test/have-resource.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import { writeFileSync } from 'fs';
import { join } from 'path';
import * as cxschema from '@aws-cdk/cloud-assembly-schema';
import * as cxapi from '@aws-cdk/cx-api';
import { ABSENT, arrayWith, exactValue, expect as cdkExpect, haveResource, haveResourceLike, Capture, anything } from '../lib/index';
import { mkResource, mkStack } from './cloud-artifact';

test('support resource with no properties', () => {
const synthStack = mkStack({
Expand Down Expand Up @@ -86,7 +83,7 @@ test('haveResource allows to opt in value extension', () => {

describe('property absence', () => {
test('pass on absence', () => {
const synthStack = mkSomeResource({
const synthStack = mkResource({
Prop: 'somevalue',
});

Expand All @@ -96,7 +93,7 @@ describe('property absence', () => {
});

test('fail on presence', () => {
const synthStack = mkSomeResource({
const synthStack = mkResource({
PropA: 3,
});

Expand All @@ -108,7 +105,7 @@ describe('property absence', () => {
});

test('pass on deep absence', () => {
const synthStack = mkSomeResource({
const synthStack = mkResource({
Deep: {
Prop: 'somevalue',
},
Expand All @@ -123,7 +120,7 @@ describe('property absence', () => {
});

test('fail on deep presence', () => {
const synthStack = mkSomeResource({
const synthStack = mkResource({
Deep: {
Prop: 'somevalue',
},
Expand All @@ -139,7 +136,7 @@ describe('property absence', () => {
});

test('can use matcher to test for list element', () => {
const synthStack = mkSomeResource({
const synthStack = mkResource({
List: [
{ Prop: 'distraction' },
{ Prop: 'goal' },
Expand All @@ -160,7 +157,7 @@ describe('property absence', () => {
});

test('arrayContaining must match all elements in any order', () => {
const synthStack = mkSomeResource({
const synthStack = mkResource({
List: ['a', 'b'],
});

Expand All @@ -178,7 +175,7 @@ describe('property absence', () => {
});

test('exactValue escapes from deep fuzzy matching', () => {
const synthStack = mkSomeResource({
const synthStack = mkResource({
Deep: {
PropA: 'A',
PropB: 'B',
Expand Down Expand Up @@ -216,7 +213,7 @@ describe('property absence', () => {
* it.
*/
test('objectContainingDeep has deep effect through lists', () => {
const synthStack = mkSomeResource({
const synthStack = mkResource({
List: [
{
PropA: 'A',
Expand All @@ -240,7 +237,7 @@ describe('property absence', () => {
});

test('test capturing', () => {
const synthStack = mkSomeResource({
const synthStack = mkResource({
Prop: 'somevalue',
});

Expand All @@ -252,28 +249,3 @@ describe('property absence', () => {
expect(propValue.capturedValue).toEqual('somevalue');
});
});

function mkStack(template: any): cxapi.CloudFormationStackArtifact {
const assembly = new cxapi.CloudAssemblyBuilder();
assembly.addArtifact('test', {
type: cxschema.ArtifactType.AWS_CLOUDFORMATION_STACK,
environment: cxapi.EnvironmentUtils.format('123456789', 'us-west-2'),
properties: {
templateFile: 'template.json',
},
});

writeFileSync(join(assembly.outdir, 'template.json'), JSON.stringify(template));
return assembly.buildAssembly().getStackByName('test');
}

function mkSomeResource(props: any): cxapi.CloudFormationStackArtifact {
return mkStack({
Resources: {
SomeResource: {
Type: 'Some::Resource',
Properties: props,
},
},
});
}
144 changes: 144 additions & 0 deletions packages/@aws-cdk/assert-internal/test/match-template.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
import { MatchStyle } from '../lib';
import { mkStack } from './cloud-artifact';
import '../jest';

describe('matchTemplate', () => {
describe('exact match', () => {
test('match on resources', () => {
const stack = mkStack({
Resources: {
FooResource: { Type: 'Foo::Bar' },
},
});

expect(stack).toMatchTemplate({
Resources: {
FooResource: { Type: 'Foo::Bar' },
},
}, MatchStyle.EXACT);

expect(stack).not.toMatchTemplate({
Resources: {
FooResource: { Type: 'Foo::Baz' },
},
}, MatchStyle.EXACT);
});

test('match on parameters', () => {
const stack = mkStack({
Parameters: {
FooParameter: { Type: 'String' },
},
});
expect(stack).toMatchTemplate({
Parameters: {
FooParameter: { Type: 'String' },
},
}, MatchStyle.EXACT);

expect(stack).not.toMatchTemplate({
Parameters: {
BarParameter: { Type: 'String' },
},
}, MatchStyle.EXACT);
});

test('match on outputs', () => {
const stack = mkStack({
Outputs: {
FooOutput: { Value: 'Foo' },
},
});

expect(stack).toMatchTemplate({
Outputs: {
FooOutput: { Value: 'Foo' },
},
}, MatchStyle.EXACT);

expect(stack).not.toMatchTemplate({
Outputs: {
BarOutput: { Value: 'Bar' },
},
}, MatchStyle.EXACT);

expect(stack).not.toMatchTemplate({
Outputs: {
FooOutput: { Value: 'Bar' },
},
}, MatchStyle.EXACT);
});
});

describe('superset match', () => {
test('match on resources', () => {
const stack = mkStack({
Resources: {
FooResource: {
Type: 'Foo::Bar',
},
BazResource: {
Type: 'Foo::Baz',
},
},
});
expect(stack).toMatchTemplate({
Resources: {
FooResource: {
Type: 'Foo::Bar',
},
},
}, MatchStyle.SUPERSET);
});

test('match on parameters', () => {
const stack = mkStack({
Parameters: {
FooParameter: { Type: 'String' },
BarParameter: { Type: 'String' },
},
});
expect(stack).toMatchTemplate({
Parameters: {
FooParameter: { Type: 'String' },
},
}, MatchStyle.SUPERSET);

expect(stack).not.toMatchTemplate({
Parameters: {
FooParameter: { Type: 'String' },
BarParameter: { Type: 'Number' },
},
}, MatchStyle.SUPERSET);
});

test('match on outputs', () => {
const stack = mkStack({
Outputs: {
FooOutput: { Value: 'Foo' },
BarOutput: { Value: 'Bar' },
},
});

expect(stack).toMatchTemplate({
Outputs: {
FooOutput: { Value: 'Foo' },
},
}, MatchStyle.SUPERSET);

expect(stack).not.toMatchTemplate({
Outputs: {
FooOutput: { Value: 'Foo' },
BarOutput: { Value: 'Baz' },
},
}, MatchStyle.SUPERSET);

expect(stack).not.toMatchTemplate({
Outputs: {
FooOutput: { Value: 'Bar' },
BazOutput: { Value: 'Bar' },
},
}, MatchStyle.SUPERSET);
});
});
});
6 changes: 6 additions & 0 deletions packages/@aws-cdk/aws-apigateway/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,12 @@ plan.addApiStage({
});
```

Existing usage plans can be imported into a CDK app using its id.

```ts
const importedUsagePlan = UsagePlan.fromUsagePlanId(stack, 'imported-usage-plan', '<usage-plan-key-id>');
```

The name and value of the API Key can be specified at creation; if not
provided, a name and value will be automatically generated by API Gateway.

Expand Down
Loading

0 comments on commit 2921d64

Please sign in to comment.