Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: version updates, including breaking changes in jsii #22382

Merged
merged 10 commits into from
Oct 6, 2022
Merged
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
"fs-extra": "^9.1.0",
"graceful-fs": "^4.2.10",
"jest-junit": "^13.2.0",
"jsii-diff": "^1.68.0",
"jsii-pacmak": "^1.68.0",
"jsii-reflect": "^1.68.0",
"jsii-rosetta": "^1.68.0",
"jsii-diff": "^1.69.0",
"jsii-pacmak": "^1.69.0",
"jsii-reflect": "^1.69.0",
"jsii-rosetta": "^1.69.0",
"lerna": "^4.0.0",
"patch-package": "^6.4.7",
"semver": "^6.3.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"@aws-cdk/cdk-build-tools": "0.0.0",
"@aws-cdk/integ-runner": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/aws-lambda": "^8.10.104",
"@types/aws-lambda": "^8.10.106",
"@aws-cdk/integ-tests": "0.0.0",
"@types/jest": "^27.5.2"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ describe('auto scaling group', () => {
expect(asg.node.defaultChild instanceof autoscaling.CfnAutoScalingGroup).toEqual(true);
});

test('can set blockDeviceMappings', () => {
testDeprecated('can set blockDeviceMappings', () => {
// GIVEN
const stack = new cdk.Stack();
const vpc = mockVpc(stack);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@types/aws-lambda": "^8.10.104",
"@types/aws-lambda": "^8.10.106",
"@types/sinon": "^9.0.11",
"@aws-cdk/cdk-build-tools": "0.0.0",
"aws-sdk": "^2.596.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-cloudformation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"@aws-cdk/integ-runner": "0.0.0",
"@aws-cdk/cfn2ts": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/aws-lambda": "^8.10.104",
"@types/aws-lambda": "^8.10.106",
"@types/jest": "^27.5.2",
"jest": "^27.5.1"
},
Expand Down
3 changes: 2 additions & 1 deletion packages/@aws-cdk/aws-cloudfront/test/origin-groups.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { Match, Template } from '@aws-cdk/assertions';
import * as s3 from '@aws-cdk/aws-s3';
import { testDeprecated } from '@aws-cdk/cdk-build-tools';
import * as cdk from '@aws-cdk/core';
import { CloudFrontWebDistribution, FailoverStatusCode } from '../lib';

describe('origin group', () => {
test('Distribution with custom origin failover', () => {
testDeprecated('Distribution with custom origin failover', () => {
const stack = new cdk.Stack();

new CloudFrontWebDistribution(stack, 'ADistribution', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ NQIDAQAB

describe('web distribution', () => {

test('distribution with custom origin adds custom origin', () => {
testDeprecated('distribution with custom origin adds custom origin', () => {
const stack = new cdk.Stack();

new CloudFrontWebDistribution(stack, 'AnAmazingWebsiteProbably', {
Expand Down Expand Up @@ -410,7 +410,7 @@ added the ellipsis so a user would know there was more to r...`,
});


test('distribution with trusted signers on default distribution', () => {
testDeprecated('distribution with trusted signers on default distribution', () => {
const stack = new cdk.Stack();
const sourceBucket = new s3.Bucket(stack, 'Bucket');
const pubKey = new PublicKey(stack, 'MyPubKey', {
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-dynamodb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
"@aws-cdk/integ-runner": "0.0.0",
"@aws-cdk/integ-tests": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/aws-lambda": "^8.10.104",
"@types/aws-lambda": "^8.10.106",
"@types/jest": "^27.5.2",
"@types/sinon": "^9.0.11",
"aws-sdk": "^2.1211.0",
Expand Down
5 changes: 3 additions & 2 deletions packages/@aws-cdk/aws-ec2/lib/vpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2244,12 +2244,13 @@ function determineNatGatewayCount(requestedCount: number | undefined, subnetConf
const hasPrivateSubnets = subnetConfig.some(c => (c.subnetType === SubnetType.PRIVATE_WITH_EGRESS
|| c.subnetType === SubnetType.PRIVATE || c.subnetType === SubnetType.PRIVATE_WITH_NAT) && !c.reserved);
const hasPublicSubnets = subnetConfig.some(c => c.subnetType === SubnetType.PUBLIC);
const hasCustomEgress = subnetConfig.some(c => c.subnetType === SubnetType.PRIVATE_WITH_EGRESS);

const count = requestedCount !== undefined ? Math.min(requestedCount, azCount) : (hasPrivateSubnets ? azCount : 0);

if (count === 0 && hasPrivateSubnets && subnetConfig.some(c => c.subnetType === SubnetType.PRIVATE_WITH_NAT)) {
if (count === 0 && hasPrivateSubnets && !hasCustomEgress) {
// 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
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-ec2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"@aws-cdk/cloud-assembly-schema": "0.0.0",
"@aws-cdk/cx-api": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/aws-lambda": "^8.10.104",
"@types/aws-lambda": "^8.10.106",
"@types/jest": "^27.5.2",
"jest": "^27.5.1"
},
Expand Down
29 changes: 14 additions & 15 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_WITH_NAT is equivalent to SubnetType.PRIVATE_WITH_EGRESS', () => {
testDeprecated('SubnetType.PRIVATE_WITH_NAT is equivalent to SubnetType.PRIVATE_WITH_EGRESS', () => {

const stack1 = getTestStack();
const stack2 = getTestStack();
Expand Down Expand Up @@ -68,7 +68,7 @@ describe('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 @@ -105,7 +105,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 @@ -126,7 +126,6 @@ describe('vpc', () => {
},
],
});

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

Expand Down Expand Up @@ -373,7 +372,7 @@ describe('vpc', () => {
{
cidrMask: 24,
name: 'reserved',
subnetType: SubnetType.PRIVATE_WITH_NAT,
subnetType: SubnetType.PRIVATE_WITH_EGRESS,
reserved: true,
},
{
Expand All @@ -400,13 +399,13 @@ describe('vpc', () => {
{
cidrMask: 24,
name: 'reserved',
subnetType: SubnetType.PRIVATE_WITH_NAT,
subnetType: SubnetType.PRIVATE_WITH_EGRESS,
reserved: true,
},
{
cidrMask: 24,
name: 'rds',
subnetType: SubnetType.PRIVATE_WITH_NAT,
subnetType: SubnetType.PRIVATE_WITH_EGRESS,
},
],
maxAzs: 3,
Expand Down Expand Up @@ -443,7 +442,7 @@ describe('vpc', () => {
{
cidrMask: 24,
name: 'application',
subnetType: SubnetType.PRIVATE_WITH_NAT,
subnetType: SubnetType.PRIVATE_WITH_EGRESS,
},
{
cidrMask: 28,
Expand Down Expand Up @@ -482,7 +481,7 @@ describe('vpc', () => {
{
cidrMask: 24,
name: 'application',
subnetType: SubnetType.PRIVATE_WITH_NAT,
subnetType: SubnetType.PRIVATE_WITH_EGRESS,
},
{
cidrMask: 28,
Expand Down Expand Up @@ -585,7 +584,7 @@ describe('vpc', () => {
},
{
name: 'private',
subnetType: SubnetType.PRIVATE_WITH_NAT,
subnetType: SubnetType.PRIVATE_WITH_EGRESS,
mapPublicIpOnLaunch: true,
},
],
Expand Down Expand Up @@ -624,7 +623,7 @@ describe('vpc', () => {
},
{
name: 'private',
subnetType: SubnetType.PRIVATE_WITH_NAT,
subnetType: SubnetType.PRIVATE_WITH_EGRESS,
},
],
});
Expand All @@ -648,7 +647,7 @@ describe('vpc', () => {
},
{
name: 'private',
subnetType: SubnetType.PRIVATE_WITH_NAT,
subnetType: SubnetType.PRIVATE_WITH_EGRESS,
},
],
vpcName: 'CustomVPCName',
Expand Down Expand Up @@ -755,7 +754,7 @@ describe('vpc', () => {
{
cidrMask: 24,
name: 'private',
subnetType: SubnetType.PRIVATE_WITH_NAT,
subnetType: SubnetType.PRIVATE_WITH_EGRESS,
},
],
natGatewaySubnets: {
Expand All @@ -775,7 +774,7 @@ describe('vpc', () => {

});

test('natGateways = 0 throws if PRIVATE_WITH_NAT subnets configured', () => {
testDeprecated('natGateways = 0 throws if PRIVATE_WITH_NAT subnets configured', () => {
const stack = getTestStack();
expect(() => {
new Vpc(stack, 'VPC', {
Expand All @@ -791,7 +790,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
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-eks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@
"@aws-cdk/integ-tests": "0.0.0",
"@aws-cdk/cfn2ts": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/aws-lambda": "^8.10.104",
"@types/aws-lambda": "^8.10.106",
"@types/jest": "^27.5.2",
"@types/sinon": "^9.0.11",
"@types/yaml": "1.9.6",
"aws-sdk": "^2.1211.0",
"cdk8s": "^2.4.33",
"cdk8s": "^2.4.39",
"cdk8s-plus-21": "^2.0.0-beta.12",
"jest": "^27.5.1",
"sinon": "^9.2.4"
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-iam/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"@aws-cdk/integ-runner": "0.0.0",
"@aws-cdk/cfn2ts": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/aws-lambda": "^8.10.104",
"@types/aws-lambda": "^8.10.106",
"@types/jest": "^27.5.2",
"@types/sinon": "^9.0.11",
"jest": "^27.5.1",
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 @@ -79,7 +79,7 @@
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^27.5.2",
"delay": "5.0.0",
"esbuild": "^0.15.8"
"esbuild": "^0.15.9"
},
"dependencies": {
"@aws-cdk/aws-lambda": "0.0.0",
Expand Down
Loading