Skip to content

Commit 0def2cf

Browse files
committed
chore: fix up v2 from inaccurate merge commits
The forward merge #13414 was erroneously squash-merged, resulting in some defects in the future forward merges. In particular, #13426 was dropped, un-reverting the commit and causing issues. There were also some test changes from #13462 that appeared to be dropped. This PR fixes the issue by just directly applying a patch to v2-main that solves the difference between the current v2-main and what we'd have if we un-squashed the squashed merge-commit and replayed all commits after that. This is an effective duplicate of #13742, except that this is a clean patch that can be applied, whereas the other is a rebased branch that will need to be force-pushed to be applied.
1 parent a0b1c3c commit 0def2cf

File tree

8 files changed

+65
-99
lines changed

8 files changed

+65
-99
lines changed

packages/@aws-cdk/assets/lib/fs/options.ts

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ export interface CopyOptions {
1010
* A strategy for how to handle symlinks.
1111
*
1212
* @default Never
13-
* @deprecated use `followSymlinks` instead
1413
*/
1514
readonly follow?: FollowMode;
1615

packages/@aws-cdk/aws-appmesh/lib/route-spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Duration } from '@aws-cdk/core';
1+
import * as cdk from '@aws-cdk/core';
22
import { Construct } from 'constructs';
33
import { CfnRoute } from './appmesh.generated';
44
import { Protocol, HttpTimeout, GrpcTimeout, TcpTimeout } from './shared-interfaces';
@@ -357,7 +357,7 @@ export interface HttpRetryPolicy {
357357
/**
358358
* The timeout for each retry attempt
359359
*/
360-
readonly retryTimeout: Duration;
360+
readonly retryTimeout: cdk.Duration;
361361

362362
/**
363363
* TCP events on which to retry. The event occurs before any processing of a

packages/@aws-cdk/aws-ecr-assets/lib/image-asset.ts

+3-14
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as fs from 'fs';
22
import * as path from 'path';
33
import * as assets from '@aws-cdk/assets';
44
import * as ecr from '@aws-cdk/aws-ecr';
5-
import { Annotations, AssetStaging, FeatureFlags, FileFingerprintOptions, IgnoreMode, Stack, SymlinkFollowMode, Token } from '@aws-cdk/core';
5+
import { Annotations, FeatureFlags, IgnoreMode, Stack, Token } from '@aws-cdk/core';
66
import * as cxapi from '@aws-cdk/cx-api';
77

88
// keep this import separate from other imports to reduce chance for merge conflicts with v2-main
@@ -12,7 +12,7 @@ import { Construct } from 'constructs';
1212
/**
1313
* Options for DockerImageAsset
1414
*/
15-
export interface DockerImageAssetOptions extends assets.FingerprintOptions, FileFingerprintOptions {
15+
export interface DockerImageAssetOptions extends assets.FingerprintOptions {
1616
/**
1717
* ECR repository name
1818
*
@@ -140,9 +140,8 @@ export class DockerImageAsset extends Construct implements assets.IAsset {
140140
// deletion of the ECR repository the app used).
141141
extraHash.version = '1.21.0';
142142

143-
const staging = new AssetStaging(this, 'Staging', {
143+
const staging = new assets.Staging(this, 'Staging', {
144144
...props,
145-
follow: props.followSymlinks ?? toSymlinkFollow(props.follow),
146145
exclude,
147146
ignoreMode,
148147
sourcePath: dir,
@@ -185,13 +184,3 @@ function validateBuildArgs(buildArgs?: { [key: string]: string }) {
185184
}
186185
}
187186
}
188-
189-
function toSymlinkFollow(follow?: assets.FollowMode): SymlinkFollowMode | undefined {
190-
switch (follow) {
191-
case undefined: return undefined;
192-
case assets.FollowMode.NEVER: return SymlinkFollowMode.NEVER;
193-
case assets.FollowMode.ALWAYS: return SymlinkFollowMode.ALWAYS;
194-
case assets.FollowMode.BLOCK_EXTERNAL: return SymlinkFollowMode.BLOCK_EXTERNAL;
195-
case assets.FollowMode.EXTERNAL: return SymlinkFollowMode.EXTERNAL;
196-
}
197-
}

packages/@aws-cdk/aws-neptune/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import * as neptune from '@aws-cdk/aws-neptune';
3131

3232
## Starting a Neptune Database
3333

34-
To set up a Neptune database, define a `DatabaseCluster`. You must always launch a database in a VPC.
34+
To set up a Neptune database, define a `DatabaseCluster`. You must always launch a database in a VPC.
3535

3636
```ts
3737
const cluster = new neptune.DatabaseCluster(this, 'Database', {

packages/@aws-cdk/aws-neptune/test/cluster.test.ts

+42-41
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { ABSENT, expect as expectCDK, haveResource, ResourcePart } from '@aws-cdk/assert';
1+
import '@aws-cdk/assert/jest';
2+
import { ABSENT, ResourcePart } from '@aws-cdk/assert';
23
import * as ec2 from '@aws-cdk/aws-ec2';
34
import * as iam from '@aws-cdk/aws-iam';
45
import * as kms from '@aws-cdk/aws-kms';
@@ -20,28 +21,28 @@ describe('DatabaseCluster', () => {
2021
});
2122

2223
// THEN
23-
expectCDK(stack).to(haveResource('AWS::Neptune::DBCluster', {
24+
expect(stack).toHaveResource('AWS::Neptune::DBCluster', {
2425
Properties: {
2526
DBSubnetGroupName: { Ref: 'DatabaseSubnets3C9252C9' },
2627
VpcSecurityGroupIds: [{ 'Fn::GetAtt': ['DatabaseSecurityGroup5C91FDCB', 'GroupId'] }],
2728
StorageEncrypted: true,
2829
},
2930
DeletionPolicy: 'Retain',
3031
UpdateReplacePolicy: 'Retain',
31-
}, ResourcePart.CompleteDefinition));
32+
}, ResourcePart.CompleteDefinition);
3233

33-
expectCDK(stack).to(haveResource('AWS::Neptune::DBInstance', {
34+
expect(stack).toHaveResource('AWS::Neptune::DBInstance', {
3435
DeletionPolicy: 'Retain',
3536
UpdateReplacePolicy: 'Retain',
36-
}, ResourcePart.CompleteDefinition));
37+
}, ResourcePart.CompleteDefinition);
3738

38-
expectCDK(stack).to(haveResource('AWS::Neptune::DBSubnetGroup', {
39+
expect(stack).toHaveResource('AWS::Neptune::DBSubnetGroup', {
3940
SubnetIds: [
4041
{ Ref: 'VPCPrivateSubnet1Subnet8BCA10E0' },
4142
{ Ref: 'VPCPrivateSubnet2SubnetCFCDAA7A' },
4243
{ Ref: 'VPCPrivateSubnet3Subnet3EDCD457' },
4344
],
44-
}));
45+
});
4546
});
4647

4748
test('can create a cluster with a single instance', () => {
@@ -57,10 +58,10 @@ describe('DatabaseCluster', () => {
5758
});
5859

5960
// THEN
60-
expectCDK(stack).to(haveResource('AWS::Neptune::DBCluster', {
61+
expect(stack).toHaveResource('AWS::Neptune::DBCluster', {
6162
DBSubnetGroupName: { Ref: 'DatabaseSubnets3C9252C9' },
6263
VpcSecurityGroupIds: [{ 'Fn::GetAtt': ['DatabaseSecurityGroup5C91FDCB', 'GroupId'] }],
63-
}));
64+
});
6465
});
6566

6667
test('errors when less than one instance is specified', () => {
@@ -111,11 +112,11 @@ describe('DatabaseCluster', () => {
111112
});
112113

113114
// THEN
114-
expectCDK(stack).to(haveResource('AWS::Neptune::DBCluster', {
115+
expect(stack).toHaveResource('AWS::Neptune::DBCluster', {
115116
EngineVersion: '1.0.4.1',
116117
DBSubnetGroupName: { Ref: 'DatabaseSubnets3C9252C9' },
117118
VpcSecurityGroupIds: [{ 'Fn::GetAtt': ['DatabaseSecurityGroup5C91FDCB', 'GroupId'] }],
118-
}));
119+
});
119120
});
120121

121122
test('can create a cluster with imported vpc and security group', () => {
@@ -135,10 +136,10 @@ describe('DatabaseCluster', () => {
135136
});
136137

137138
// THEN
138-
expectCDK(stack).to(haveResource('AWS::Neptune::DBCluster', {
139+
expect(stack).toHaveResource('AWS::Neptune::DBCluster', {
139140
DBSubnetGroupName: { Ref: 'DatabaseSubnets3C9252C9' },
140141
VpcSecurityGroupIds: ['SecurityGroupId12345'],
141-
}));
142+
});
142143
});
143144

144145
test('cluster with parameter group', () => {
@@ -160,9 +161,9 @@ describe('DatabaseCluster', () => {
160161
});
161162

162163
// THEN
163-
expectCDK(stack).to(haveResource('AWS::Neptune::DBCluster', {
164+
expect(stack).toHaveResource('AWS::Neptune::DBCluster', {
164165
DBClusterParameterGroupName: { Ref: 'ParamsA8366201' },
165-
}));
166+
});
166167
});
167168

168169
test('cluster with associated role', () => {
@@ -183,7 +184,7 @@ describe('DatabaseCluster', () => {
183184
});
184185

185186
// THEN
186-
expectCDK(stack).to(haveResource('AWS::Neptune::DBCluster', {
187+
expect(stack).toHaveResource('AWS::Neptune::DBCluster', {
187188
AssociatedRoles: [
188189
{
189190
RoleArn: {
@@ -194,7 +195,7 @@ describe('DatabaseCluster', () => {
194195
},
195196
},
196197
],
197-
}));
198+
});
198199
});
199200

200201
test('cluster with imported parameter group', () => {
@@ -212,9 +213,9 @@ describe('DatabaseCluster', () => {
212213
});
213214

214215
// THEN
215-
expectCDK(stack).to(haveResource('AWS::Neptune::DBCluster', {
216+
expect(stack).toHaveResource('AWS::Neptune::DBCluster', {
216217
DBClusterParameterGroupName: 'ParamGroupName',
217-
}));
218+
});
218219
});
219220

220221
test('create an encrypted cluster with custom KMS key', () => {
@@ -230,15 +231,15 @@ describe('DatabaseCluster', () => {
230231
});
231232

232233
// THEN
233-
expectCDK(stack).to(haveResource('AWS::Neptune::DBCluster', {
234+
expect(stack).toHaveResource('AWS::Neptune::DBCluster', {
234235
KmsKeyId: {
235236
'Fn::GetAtt': [
236237
'Key961B73FD',
237238
'Arn',
238239
],
239240
},
240241
StorageEncrypted: true,
241-
}));
242+
});
242243
});
243244

244245
test('creating a cluster defaults to using encryption', () => {
@@ -253,9 +254,9 @@ describe('DatabaseCluster', () => {
253254
});
254255

255256
// THEN
256-
expectCDK(stack).to(haveResource('AWS::Neptune::DBCluster', {
257+
expect(stack).toHaveResource('AWS::Neptune::DBCluster', {
257258
StorageEncrypted: true,
258-
}));
259+
});
259260
});
260261

261262
test('supplying a KMS key with storageEncryption false throws an error', () => {
@@ -306,9 +307,9 @@ describe('DatabaseCluster', () => {
306307
});
307308

308309
// THEN
309-
expectCDK(stack).to(haveResource('AWS::Neptune::DBInstance', {
310+
expect(stack).toHaveResource('AWS::Neptune::DBInstance', {
310311
DBInstanceIdentifier: `${instanceIdentifierBase}1`,
311-
}));
312+
});
312313
});
313314

314315
test('cluster identifier used', () => {
@@ -325,9 +326,9 @@ describe('DatabaseCluster', () => {
325326
});
326327

327328
// THEN
328-
expectCDK(stack).to(haveResource('AWS::Neptune::DBInstance', {
329+
expect(stack).toHaveResource('AWS::Neptune::DBInstance', {
329330
DBInstanceIdentifier: `${clusterIdentifier}instance1`,
330-
}));
331+
});
331332
});
332333

333334
test('imported cluster has supplied attributes', () => {
@@ -372,9 +373,9 @@ describe('DatabaseCluster', () => {
372373
cluster.connections.allowToAnyIpv4(ec2.Port.tcp(443));
373374

374375
// THEN
375-
expectCDK(stack).to(haveResource('AWS::EC2::SecurityGroupEgress', {
376+
expect(stack).toHaveResource('AWS::EC2::SecurityGroupEgress', {
376377
GroupId: 'sg-123456789',
377-
}));
378+
});
378379
});
379380

380381
test('backup retention period respected', () => {
@@ -390,9 +391,9 @@ describe('DatabaseCluster', () => {
390391
});
391392

392393
// THEN
393-
expectCDK(stack).to(haveResource('AWS::Neptune::DBCluster', {
394+
expect(stack).toHaveResource('AWS::Neptune::DBCluster', {
394395
BackupRetentionPeriod: 20,
395-
}));
396+
});
396397
});
397398

398399
test('backup maintenance window respected', () => {
@@ -409,10 +410,10 @@ describe('DatabaseCluster', () => {
409410
});
410411

411412
// THEN
412-
expectCDK(stack).to(haveResource('AWS::Neptune::DBCluster', {
413+
expect(stack).toHaveResource('AWS::Neptune::DBCluster', {
413414
BackupRetentionPeriod: 20,
414415
PreferredBackupWindow: '07:34-08:04',
415-
}));
416+
});
416417
});
417418

418419
test('regular maintenance window respected', () => {
@@ -428,9 +429,9 @@ describe('DatabaseCluster', () => {
428429
});
429430

430431
// THEN
431-
expectCDK(stack).to(haveResource('AWS::Neptune::DBCluster', {
432+
expect(stack).toHaveResource('AWS::Neptune::DBCluster', {
432433
PreferredMaintenanceWindow: '07:34-08:04',
433-
}));
434+
});
434435
});
435436

436437
test('iam authentication - off by default', () => {
@@ -445,9 +446,9 @@ describe('DatabaseCluster', () => {
445446
});
446447

447448
// THEN
448-
expectCDK(stack).to(haveResource('AWS::Neptune::DBCluster', {
449+
expect(stack).toHaveResourceLike('AWS::Neptune::DBCluster', {
449450
IamAuthEnabled: ABSENT,
450-
}));
451+
});
451452
});
452453

453454
test('createGrant - creates IAM policy and enables IAM auth', () => {
@@ -466,10 +467,10 @@ describe('DatabaseCluster', () => {
466467
cluster.grantConnect(role);
467468

468469
// THEN
469-
expectCDK(stack).to(haveResource('AWS::Neptune::DBCluster', {
470+
expect(stack).toHaveResourceLike('AWS::Neptune::DBCluster', {
470471
IamAuthEnabled: true,
471-
}));
472-
expectCDK(stack).to(haveResource('AWS::IAM::Policy', {
472+
});
473+
expect(stack).toHaveResource('AWS::IAM::Policy', {
473474
PolicyDocument: {
474475
Statement: [{
475476
Effect: 'Allow',
@@ -502,7 +503,7 @@ describe('DatabaseCluster', () => {
502503
}],
503504
Version: '2012-10-17',
504505
},
505-
}));
506+
});
506507
});
507508

508509
test('createGrant - throws if IAM auth disabled', () => {

packages/@aws-cdk/aws-s3-assets/lib/asset.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import * as cxapi from '@aws-cdk/cx-api';
88
import { Construct } from 'constructs';
99
import { toSymlinkFollow } from './compat';
1010

11-
export interface AssetOptions extends assets.CopyOptions, cdk.FileCopyOptions, cdk.AssetOptions {
11+
export interface AssetOptions extends assets.CopyOptions, cdk.AssetOptions {
1212
/**
1313
* A list of principals that should be able to read this asset from S3.
1414
* You can use `asset.grantRead(principal)` to grant read permissions later.
@@ -121,7 +121,7 @@ export class Asset extends Construct implements cdk.IAsset {
121121
const staging = new cdk.AssetStaging(this, 'Stage', {
122122
...props,
123123
sourcePath: path.resolve(props.path),
124-
follow: props.followSymlinks ?? toSymlinkFollow(props.follow),
124+
follow: toSymlinkFollow(props.follow),
125125
assetHash: props.assetHash ?? props.sourceHash,
126126
});
127127

0 commit comments

Comments
 (0)