Skip to content

Commit 43278fd

Browse files
Niranjan Jayakarnjlynch
authored andcommitted
chore: forward merge 'master' into 'v2-main' (#13685)
Automated action from aws/cdk-ops
2 parents c491861 + 02b4fcf commit 43278fd

File tree

111 files changed

+307
-184
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+307
-184
lines changed

.github/workflows/yarn-upgrade.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,12 @@ jobs:
6060
run: yarn install
6161

6262
- name: Run "yarn upgrade"
63-
run: yarn upgrade
63+
# jsdom breaks us starting from 16.5.1. Caused by https://github.com/feross/queue-microtask/issues/17
64+
# in combination with https://github.com/jsdom/jsdom/commit/31eb938fdaa5d446e194c9ec4f0d6b46b4354954
65+
# pinning this for now since its only used in tests (by jest-enviroment-jsdom).
66+
# we are not even using this because our environment is 'node' - just the mere fact this module is loaded is what breaks.
67+
# also - jest-enviroment-jsdom doesnt actually require 16.5.1 (https://github.com/facebook/jest/blob/master/packages/jest-environment-jsdom/package.json#L23)
68+
run: yarn upgrade --pattern '!(jsdom)'
6469

6570
- name: Make Pull Request
6671
uses: peter-evans/create-pull-request@v3

allowed-breaking-changes.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,8 @@ incompatible-argument:@aws-cdk/aws-ecs.TaskDefinition.addVolume
5656
# We made properties optional and it's really fine but our differ doesn't think so.
5757
weakened:@aws-cdk/cloud-assembly-schema.DockerImageSource
5858
weakened:@aws-cdk/cloud-assembly-schema.FileSource
59+
60+
# Changed required deprecated props from required -> optional.
61+
# These are fine, since they shouldn't be widely used.
62+
weakened:@aws-cdk/core.FileAssetLocation
63+
weakened:@aws-cdk/aws-events.RuleTargetConfig

packages/@aws-cdk/assert/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
},
2323
"license": "Apache-2.0",
2424
"devDependencies": {
25-
"@types/jest": "^26.0.20",
25+
"@types/jest": "^26.0.21",
2626
"cdk-build-tools": "0.0.0",
2727
"jest": "^26.6.3",
2828
"pkglint": "0.0.0",

packages/@aws-cdk/assets/test/test.staging.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export = {
1414
// WHEN
1515
const staging = new Staging(stack, 's1', { sourcePath });
1616

17-
test.deepEqual(staging.sourceHash, '2f37f937c51e2c191af66acf9b09f548926008ec68c575bd2ee54b6e997c0e00');
17+
test.deepEqual(staging.assetHash, '2f37f937c51e2c191af66acf9b09f548926008ec68c575bd2ee54b6e997c0e00');
1818
test.deepEqual(staging.sourcePath, sourcePath);
1919
test.deepEqual(staging.relativeStagedPath(stack), 'asset.2f37f937c51e2c191af66acf9b09f548926008ec68c575bd2ee54b6e997c0e00');
2020
test.done();
@@ -29,9 +29,9 @@ export = {
2929
// WHEN
3030
const staging = new Staging(stack, 's1', { sourcePath });
3131

32-
test.deepEqual(staging.sourceHash, '2f37f937c51e2c191af66acf9b09f548926008ec68c575bd2ee54b6e997c0e00');
32+
test.deepEqual(staging.assetHash, '2f37f937c51e2c191af66acf9b09f548926008ec68c575bd2ee54b6e997c0e00');
3333
test.deepEqual(staging.sourcePath, sourcePath);
34-
test.deepEqual(staging.stagedPath, sourcePath);
34+
test.deepEqual(staging.absoluteStagedPath, sourcePath);
3535
test.done();
3636
},
3737

@@ -70,9 +70,9 @@ export = {
7070
const withExtra = new Staging(stack, 'withExtra', { sourcePath: directory, extraHash: 'boom' });
7171

7272
// THEN
73-
test.notEqual(withoutExtra.sourceHash, withExtra.sourceHash);
74-
test.deepEqual(withoutExtra.sourceHash, '2f37f937c51e2c191af66acf9b09f548926008ec68c575bd2ee54b6e997c0e00');
75-
test.deepEqual(withExtra.sourceHash, 'c95c915a5722bb9019e2c725d11868e5a619b55f36172f76bcbcaa8bb2d10c5f');
73+
test.notEqual(withoutExtra.assetHash, withExtra.assetHash);
74+
test.deepEqual(withoutExtra.assetHash, '2f37f937c51e2c191af66acf9b09f548926008ec68c575bd2ee54b6e997c0e00');
75+
test.deepEqual(withExtra.assetHash, 'c95c915a5722bb9019e2c725d11868e5a619b55f36172f76bcbcaa8bb2d10c5f');
7676
test.done();
7777
},
7878
};

packages/@aws-cdk/aws-apigateway/lib/restapi.ts

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,10 @@ export abstract class RestApiBase extends Resource implements IRestApi {
490490
ignore(deployment);
491491
}
492492

493-
protected configureCloudWatchRole(apiResource: CfnRestApi) {
493+
/**
494+
* @internal
495+
*/
496+
protected _configureCloudWatchRole(apiResource: CfnRestApi) {
494497
const role = new iam.Role(this, 'CloudWatchRole', {
495498
assumedBy: new iam.ServicePrincipal('apigateway.amazonaws.com'),
496499
managedPolicies: [iam.ManagedPolicy.fromAwsManagedPolicyName('service-role/AmazonAPIGatewayPushToCloudWatchLogs')],
@@ -503,7 +506,24 @@ export abstract class RestApiBase extends Resource implements IRestApi {
503506
resource.node.addDependency(apiResource);
504507
}
505508

506-
protected configureDeployment(props: RestApiOptions) {
509+
/**
510+
* @deprecated This method will be made internal. No replacement
511+
*/
512+
protected configureCloudWatchRole(apiResource: CfnRestApi) {
513+
this._configureCloudWatchRole(apiResource);
514+
}
515+
516+
/**
517+
* @deprecated This method will be made internal. No replacement
518+
*/
519+
protected configureDeployment(props: RestApiBaseProps) {
520+
this._configureDeployment(props);
521+
}
522+
523+
/**
524+
* @internal
525+
*/
526+
protected _configureDeployment(props: RestApiBaseProps) {
507527
const deploy = props.deploy ?? true;
508528
if (deploy) {
509529

@@ -603,14 +623,14 @@ export class SpecRestApi extends RestApiBase {
603623
this.restApiRootResourceId = resource.attrRootResourceId;
604624
this.root = new RootResource(this, {}, this.restApiRootResourceId);
605625

606-
this.configureDeployment(props);
626+
this._configureDeployment(props);
607627
if (props.domainName) {
608628
this.addDomainName('CustomDomain', props.domainName);
609629
}
610630

611631
const cloudWatchRole = props.cloudWatchRole ?? true;
612632
if (cloudWatchRole) {
613-
this.configureCloudWatchRole(resource);
633+
this._configureCloudWatchRole(resource);
614634
}
615635
}
616636
}
@@ -708,10 +728,10 @@ export class RestApi extends RestApiBase {
708728

709729
const cloudWatchRole = props.cloudWatchRole ?? true;
710730
if (cloudWatchRole) {
711-
this.configureCloudWatchRole(resource);
731+
this._configureCloudWatchRole(resource);
712732
}
713733

714-
this.configureDeployment(props);
734+
this._configureDeployment(props);
715735
if (props.domainName) {
716736
this.addDomainName('CustomDomain', props.domainName);
717737
}

packages/@aws-cdk/aws-apigateway/test/integ.restapi.multiuse.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class MultiStack extends cdk.Stack {
99
const hello = new apigw.LambdaIntegration(new lambda.Function(this, 'Hello', {
1010
runtime: lambda.Runtime.NODEJS_10_X,
1111
handler: 'index.handler',
12-
code: lambda.Code.inline(`exports.handler = ${helloCode}`),
12+
code: lambda.Code.fromInline(`exports.handler = ${helloCode}`),
1313
}));
1414

1515
const api = new apigw.RestApi(this, 'hello-api');

packages/@aws-cdk/aws-apigatewayv2/lib/http/vpc-link.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ export class VpcLink extends Resource implements IVpcLink {
9292
this.vpc = props.vpc;
9393

9494
const cfnResource = new CfnVpcLink(this, 'Resource', {
95-
name: props.vpcLinkName || Lazy.stringValue({ produce: () => Names.uniqueId(this) }),
96-
subnetIds: Lazy.listValue({ produce: () => this.renderSubnets() }),
97-
securityGroupIds: Lazy.listValue({ produce: () => this.renderSecurityGroups() }),
95+
name: props.vpcLinkName || Lazy.string({ produce: () => Names.uniqueId(this) }),
96+
subnetIds: Lazy.list({ produce: () => this.renderSubnets() }),
97+
securityGroupIds: Lazy.list({ produce: () => this.renderSecurityGroups() }),
9898
});
9999

100100
this.vpcLinkId = cfnResource.ref;

packages/@aws-cdk/aws-applicationautoscaling/lib/scalable-target.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export class ScalableTarget extends Resource implements IScalableTarget {
136136
* Add a policy statement to the role's policy
137137
*/
138138
public addToRolePolicy(statement: iam.PolicyStatement) {
139-
this.role.addToPolicy(statement);
139+
this.role.addToPrincipalPolicy(statement);
140140
}
141141

142142
/**

packages/@aws-cdk/aws-appmesh/lib/virtual-node.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ export class VirtualNode extends VirtualNodeBase {
181181
virtualNodeName: this.physicalName,
182182
meshName: this.mesh.meshName,
183183
spec: {
184-
backends: cdk.Lazy.anyValue({ produce: () => this.backends }, { omitEmptyArray: true }),
185-
listeners: cdk.Lazy.anyValue({ produce: () => this.listeners.map(listener => listener.listener) }, { omitEmptyArray: true }),
184+
backends: cdk.Lazy.any({ produce: () => this.backends }, { omitEmptyArray: true }),
185+
listeners: cdk.Lazy.any({ produce: () => this.listeners.map(listener => listener.listener) }, { omitEmptyArray: true }),
186186
backendDefaults: props.backendDefaults !== undefined
187187
? {
188188
clientPolicy: props.backendDefaults?.clientPolicy?.bind(this).clientPolicy,

packages/@aws-cdk/aws-autoscaling/lib/auto-scaling-group.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,7 +1097,7 @@ export class AutoScalingGroup extends AutoScalingGroupBase implements
10971097
* Adds a statement to the IAM role assumed by instances of this fleet.
10981098
*/
10991099
public addToRolePolicy(statement: iam.PolicyStatement) {
1100-
this.role.addToPolicy(statement);
1100+
this.role.addToPrincipalPolicy(statement);
11011101
}
11021102

11031103
/**
@@ -1225,7 +1225,7 @@ export class AutoScalingGroup extends AutoScalingGroupBase implements
12251225
...this.autoScalingGroup.cfnOptions.creationPolicy,
12261226
resourceSignal: {
12271227
count: props.resourceSignalCount,
1228-
timeout: props.resourceSignalTimeout && props.resourceSignalTimeout.toISOString(),
1228+
timeout: props.resourceSignalTimeout && props.resourceSignalTimeout.toIsoString(),
12291229
},
12301230
};
12311231
}
@@ -1327,6 +1327,7 @@ export enum ScalingEvent {
13271327

13281328
/**
13291329
* Additional settings when a rolling update is selected
1330+
* @deprecated use `UpdatePolicy.rollingUpdate()`
13301331
*/
13311332
export interface RollingUpdateConfiguration {
13321333
/**
@@ -1516,7 +1517,7 @@ function renderRollingUpdateConfig(config: RollingUpdateConfiguration = {}): Cfn
15161517
minInstancesInService: config.minInstancesInService,
15171518
minSuccessfulInstancesPercent: validatePercentage(config.minSuccessfulInstancesPercent),
15181519
waitOnResourceSignals,
1519-
pauseTime: pauseTime && pauseTime.toISOString(),
1520+
pauseTime: pauseTime && pauseTime.toIsoString(),
15201521
suspendProcesses: config.suspendProcesses ?? DEFAULT_SUSPEND_PROCESSES,
15211522
};
15221523
}

0 commit comments

Comments
 (0)