Skip to content

Commit

Permalink
chore: version updates, including breaking changes in jsii (backport #…
Browse files Browse the repository at this point in the history
…22382) (#22464)

This is an automatic backport of pull request #22382 done by [Mergify](https://mergify.com).
Cherry-pick of f169d7f has failed:
```
On branch mergify/bp/v1-main/pr-22382
Your branch is up to date with 'origin/v1-main'.

You are currently cherry-picking commit f169d7f.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   packages/@aws-cdk/aws-certificatemanager/lambda-packages/dns_validated_certificate_handler/package.json
	modified:   packages/@aws-cdk/aws-cloudformation/package.json
	modified:   packages/@aws-cdk/aws-dynamodb/package.json
	modified:   packages/@aws-cdk/aws-ec2/package.json
	modified:   packages/@aws-cdk/aws-ec2/test/vpn.test.ts
	modified:   packages/@aws-cdk/aws-iam/package.json
	modified:   packages/@aws-cdk/aws-lambda-nodejs/package.json
	modified:   packages/@aws-cdk/aws-lambda/package.json
	modified:   packages/@aws-cdk/aws-logs/package.json
	modified:   packages/@aws-cdk/aws-route53/package.json
	modified:   packages/@aws-cdk/aws-s3/package.json
	modified:   packages/@aws-cdk/aws-ses/package.json
	modified:   packages/@aws-cdk/custom-resources/package.json
	modified:   tools/@aws-cdk/cdk-build-tools/lib/deprecated-symbols.ts

Unmerged paths:
  (use "git add/rm <file>..." as appropriate to mark resolution)
	both modified:   package.json
	both modified:   packages/@aws-cdk/aws-apigatewayv2-authorizers/package.json
	both modified:   packages/@aws-cdk/aws-ec2/lib/vpc.ts
	both modified:   packages/@aws-cdk/aws-ec2/test/vpc.test.ts
	both modified:   packages/@aws-cdk/aws-eks/package.json
	both modified:   packages/@aws-cdk/cloudformation-diff/package.json
	both modified:   packages/@aws-cdk/core/package.json
	both modified:   packages/@aws-cdk/custom-resources/test/aws-custom-resource/aws-custom-resource.test.ts
	deleted by us:   packages/@aws-cdk/custom-resources/test/aws-custom-resource/integ.aws-custom-resource-vpc.ts
	both modified:   packages/@aws-cdk/integ-runner/THIRD_PARTY_LICENSES
	both modified:   packages/@aws-cdk/integ-runner/package.json
	both modified:   packages/@aws-cdk/integ-tests/package.json
	both modified:   packages/@monocdk-experiment/assert/package.json
	both modified:   packages/@monocdk-experiment/rewrite-imports/package.json
	both modified:   packages/aws-cdk-lib/package.json
	both modified:   packages/aws-cdk-migration/package.json
	both modified:   packages/aws-cdk/THIRD_PARTY_LICENSES
	both modified:   packages/aws-cdk/package.json
	both modified:   packages/awslint/package.json
	both modified:   packages/cdk-assets/package.json
	both modified:   packages/cdk-cli-wrapper/package.json
	both modified:   packages/cdk-dasm/package.json
	both modified:   packages/monocdk/package.json
	both modified:   tools/@aws-cdk/cdk-build-tools/package.json
	both modified:   tools/@aws-cdk/cfn2ts/package.json
	both modified:   tools/@aws-cdk/eslint-plugin/package.json
	both modified:   tools/@aws-cdk/node-bundle/package.json
	both modified:   tools/@aws-cdk/prlint/package.json
	both modified:   tools/@aws-cdk/yarn-cling/package.json
	both modified:   yarn.lock

```


To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/github/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

---


<details>
<summary>Mergify commands and options</summary>

<br />

More conditions and actions can be found in the [documentation](https://docs.mergify.com/).

You can also trigger Mergify actions by commenting on this pull request:

- `@Mergifyio refresh` will re-evaluate the rules
- `@Mergifyio rebase` will rebase this PR on its base branch
- `@Mergifyio update` will merge the base branch into this PR
- `@Mergifyio backport <destination>` will backport this PR on `<destination>` branch

Additionally, on Mergify [dashboard](https://dashboard.mergify.com/) you can:

- look at your merge queues
- generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.com
</details>
  • Loading branch information
mergify[bot] committed Oct 12, 2022
1 parent 40c20b4 commit 9632c2f
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 23 deletions.
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-ec2/lib/vpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2190,7 +2190,7 @@ function determineNatGatewayCount(requestedCount: number | undefined, subnetConf

if (count === 0 && hasPrivateSubnets) {
// eslint-disable-next-line max-len
throw new Error('If you do not want NAT gateways (natGateways=0), make sure you don\'t configure any PRIVATE subnets in \'subnetConfiguration\' (make them PUBLIC or ISOLATED instead)');
throw new Error('If you do not want NAT gateways (natGateways=0), make sure you don\'t configure any PRIVATE(_WITH_NAT) subnets in \'subnetConfiguration\' (make them PUBLIC or ISOLATED instead)');
}

if (count > 0 && !hasPublicSubnets) {
Expand Down
9 changes: 4 additions & 5 deletions packages/@aws-cdk/aws-ec2/test/vpc.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {
describe('vpc', () => {
describe('When creating a VPC', () => {

test('SubnetType.PRIVATE is equivalent to SubnetType.PRIVATE_WITH_NAT', () => {
testDeprecated('SubnetType.PRIVATE is equivalent to SubnetType.PRIVATE_WITH_NAT', () => {

const stack1 = getTestStack();
const stack2 = getTestStack();
Expand Down Expand Up @@ -68,7 +68,7 @@ describe('vpc', () => {

});

test('SubnetType.ISOLATED is equivalent to SubnetType.PRIVATE_ISOLATED', () => {
testDeprecated('SubnetType.ISOLATED is equivalent to SubnetType.PRIVATE_ISOLATED', () => {

const stack1 = getTestStack();
const stack2 = getTestStack();
Expand All @@ -89,7 +89,6 @@ describe('vpc', () => {
},
],
});

const t1 = Template.fromStack(stack1);
const t2 = Template.fromStack(stack2);

Expand Down Expand Up @@ -706,7 +705,7 @@ describe('vpc', () => {

});

test('natGateways = 0 throws if no PRIVATE subnets configured', () => {
testDeprecated('natGateways = 0 throws if PRIVATE_WITH_NAT subnets configured', () => {
const stack = getTestStack();
expect(() => {
new Vpc(stack, 'VPC', {
Expand All @@ -722,7 +721,7 @@ describe('vpc', () => {
},
],
});
}).toThrow(/make sure you don't configure any PRIVATE subnets/);
}).toThrow(/make sure you don't configure any PRIVATE/);


});
Expand Down
60 changes: 44 additions & 16 deletions packages/@aws-cdk/aws-ec2/test/vpn.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Template } from '@aws-cdk/assertions';
import { testDeprecated } from '@aws-cdk/cdk-build-tools';
import { Duration, SecretValue, Stack, Token } from '@aws-cdk/core';
import { PublicSubnet, Vpc, VpnConnection } from '../lib';

Expand Down Expand Up @@ -84,25 +85,52 @@ describe('vpn', () => {

});

test.each([false, true])('with tunnel options, using secret: %p', (secret) => {
test('with tunnel options, using secret value', () => {
// GIVEN
const stack = new Stack();

new Vpc(stack, 'VpcNetwork', {
vpnConnections: {
VpnConnection: {
ip: '192.0.2.1',
tunnelOptions: [
secret
? {
preSharedKeySecret: SecretValue.unsafePlainText('secretkey1234'),
tunnelInsideCidr: '169.254.10.0/30',
}
: {
preSharedKey: 'secretkey1234',
tunnelInsideCidr: '169.254.10.0/30',
},
],
tunnelOptions: [{
preSharedKeySecret: SecretValue.unsafePlainText('secretkey1234'),
tunnelInsideCidr: '169.254.10.0/30',
}],
},
},
});

Template.fromStack(stack).hasResourceProperties('AWS::EC2::VPNConnection', {
CustomerGatewayId: {
Ref: 'VpcNetworkVpnConnectionCustomerGateway8B56D9AF',
},
Type: 'ipsec.1',
VpnGatewayId: {
Ref: 'VpcNetworkVpnGateway501295FA',
},
StaticRoutesOnly: false,
VpnTunnelOptionsSpecifications: [
{
PreSharedKey: 'secretkey1234',
TunnelInsideCidr: '169.254.10.0/30',
},
],
});
});

testDeprecated('with tunnel options, using secret', () => {
// GIVEN
const stack = new Stack();

new Vpc(stack, 'VpcNetwork', {
vpnConnections: {
VpnConnection: {
ip: '192.0.2.1',
tunnelOptions: [{
preSharedKey: 'secretkey1234',
tunnelInsideCidr: '169.254.10.0/30',
}],
},
},
});
Expand Down Expand Up @@ -150,13 +178,13 @@ describe('vpn', () => {
ip: '192.0.2.1',
tunnelOptions: [
{
preSharedKey: 'secretkey1234',
preSharedKeySecret: SecretValue.unsafePlainText('secretkey1234'),
},
{
preSharedKey: 'secretkey1234',
preSharedKeySecret: SecretValue.unsafePlainText('secretkey1234'),
},
{
preSharedKey: 'secretkey1234',
preSharedKeySecret: SecretValue.unsafePlainText('secretkey1234'),
},
],
},
Expand Down Expand Up @@ -189,7 +217,7 @@ describe('vpn', () => {

});

test('fails when specifying an invalid pre-shared key', () => {
testDeprecated('fails when specifying an invalid pre-shared key', () => {
// GIVEN
const stack = new Stack();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -742,4 +742,4 @@ test('assumedRoleArn adds statement for sts:assumeRole', () => {
Version: '2012-10-17',
},
});
});
});
15 changes: 15 additions & 0 deletions tools/@aws-cdk/cdk-build-tools/lib/deprecated-symbols.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,21 @@ export function testDeprecated(name: string, fn: () => any, timeout?: number) {
}, timeout);
}

export declare namespace testDeprecated {
const each: typeof test.each;
}

(testDeprecated as any).each = function(cases: ReadonlyArray<ReadonlyArray<any>>) {
const testRunner = (test.each as any).call(test, cases);
return (name: string, fn: (...testArgs: any[]) => any) => {
testRunner(name, (...testArgs: any[]) => {
const deprecated = DeprecatedSymbols.quiet();
fn(...testArgs);
DeprecatedSymbols.reset(deprecated);
});
};
};

namespace DeprecatedSymbols {
export function quiet(): string | undefined {
const deprecated = process.env.JSII_DEPRECATED;
Expand Down

0 comments on commit 9632c2f

Please sign in to comment.