From 987827387d0e8a5f7551c7694868a35d7f1253c8 Mon Sep 17 00:00:00 2001 From: Jakob Berg Date: Tue, 7 May 2024 15:29:10 -0400 Subject: [PATCH 01/11] nice work --- .../cloudformation-diff/lib/diff-template.ts | 35 +++++++++++++++++-- .../cloudformation-diff/lib/diff/types.ts | 4 +++ 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/packages/@aws-cdk/cloudformation-diff/lib/diff-template.ts b/packages/@aws-cdk/cloudformation-diff/lib/diff-template.ts index 118df03c6ebc5..ddcb1fad04ba5 100644 --- a/packages/@aws-cdk/cloudformation-diff/lib/diff-template.ts +++ b/packages/@aws-cdk/cloudformation-diff/lib/diff-template.ts @@ -55,7 +55,7 @@ export function fullDiff( normalize(newTemplate); const theDiff = diffTemplate(currentTemplate, newTemplate); if (changeSet) { - filterFalsePositives(theDiff, changeSet); + filterFalsePositives(theDiff, changeSet, newTemplate.Resources); addImportInformation(theDiff, changeSet); } else if (isImport) { makeAllResourceChangesImports(theDiff); @@ -229,8 +229,39 @@ function makeAllResourceChangesImports(diff: types.TemplateDiff) { }); } -function filterFalsePositives(diff: types.TemplateDiff, changeSet: DescribeChangeSetOutput) { +function filterFalsePositives(diff: types.TemplateDiff, changeSet: DescribeChangeSetOutput, newTemplateResources: {[logicalId: string]: any}) { const replacements = findResourceReplacements(changeSet); + + for (const logicalId of Object.keys(newTemplateResources || {})) { + if (logicalId in replacements) { + // diff.resources.get(logicalId).isDifferent = true; + // Then the properties that have been replaced need to be referenced + for (const propertyName of Object.keys(replacements[logicalId].propertiesReplaced)) { + + if (logicalId in diff.resources) { + // In this case, a property of a changed resource may have been skipped + if (!(propertyName in diff.resources.get(logicalId).propertyUpdates)) { + const newProp = new types.PropertyDifference( + // these fields we be decided below + {}, {}, { changeImpact: undefined }, + ); + newProp.isDifferent = true; + diff.resources.get(logicalId).propertyUpdates[propertyName] = newProp; + } + } else { + // In this case, we missed the resource entirely. + diff.resources.add(logicalId, diffResource(newTemplateResources[logicalId], newTemplateResources[logicalId])); + const newProp = new types.PropertyDifference( + // these fields we be decided below + {}, {}, { changeImpact: undefined }, + ); + newProp.isDifferent = true; + diff.resources.get(logicalId).setPropertyChange(propertyName, newProp); + } + } + } + }; + diff.resources.forEachDifference((logicalId: string, change: types.ResourceDifference) => { if (change.resourceType.includes('AWS::Serverless')) { // CFN applies the SAM transform before creating the changeset, so the changeset contains no information about SAM resources diff --git a/packages/@aws-cdk/cloudformation-diff/lib/diff/types.ts b/packages/@aws-cdk/cloudformation-diff/lib/diff/types.ts index 4b65ef484e919..9d66476c62852 100644 --- a/packages/@aws-cdk/cloudformation-diff/lib/diff/types.ts +++ b/packages/@aws-cdk/cloudformation-diff/lib/diff/types.ts @@ -349,6 +349,10 @@ export class PropertyDifference extends Difference { export class DifferenceCollection> { constructor(private readonly diffs: { [logicalId: string]: T }) {} + public add(logicalId: string, diff: T): void { + this.diffs[logicalId] = diff; + } + public get changes(): { [logicalId: string]: T } { return onlyChanges(this.diffs); } From eba549abf7039e2b4aabc04167aad3d5eccdd1a3 Mon Sep 17 00:00:00 2001 From: Jakob Berg Date: Tue, 7 May 2024 16:13:25 -0400 Subject: [PATCH 02/11] fix: add properties from changeset to template diff --- .../cloudformation-diff/lib/diff-template.ts | 56 +++++++------------ 1 file changed, 21 insertions(+), 35 deletions(-) diff --git a/packages/@aws-cdk/cloudformation-diff/lib/diff-template.ts b/packages/@aws-cdk/cloudformation-diff/lib/diff-template.ts index ddcb1fad04ba5..52eee47887e30 100644 --- a/packages/@aws-cdk/cloudformation-diff/lib/diff-template.ts +++ b/packages/@aws-cdk/cloudformation-diff/lib/diff-template.ts @@ -55,7 +55,7 @@ export function fullDiff( normalize(newTemplate); const theDiff = diffTemplate(currentTemplate, newTemplate); if (changeSet) { - filterFalsePositives(theDiff, changeSet, newTemplate.Resources); + refineDiffWithChangeSet(theDiff, changeSet, newTemplate.Resources); addImportInformation(theDiff, changeSet); } else if (isImport) { makeAllResourceChangesImports(theDiff); @@ -143,13 +143,6 @@ function calculateTemplateDiff(currentTemplate: { [key: string]: any }, newTempl return new types.TemplateDiff(differences); } -/** - * Compare two CloudFormation resources and return semantic differences between them - */ -export function diffResource(oldValue: types.Resource, newValue: types.Resource): types.ResourceDifference { - return impl.diffResource(oldValue, newValue); -} - /** * Replace all references to the given logicalID on the given template, in-place * @@ -229,39 +222,32 @@ function makeAllResourceChangesImports(diff: types.TemplateDiff) { }); } -function filterFalsePositives(diff: types.TemplateDiff, changeSet: DescribeChangeSetOutput, newTemplateResources: {[logicalId: string]: any}) { +function refineDiffWithChangeSet(diff: types.TemplateDiff, changeSet: DescribeChangeSetOutput, newTemplateResources: {[logicalId: string]: any}) { const replacements = findResourceReplacements(changeSet); - for (const logicalId of Object.keys(newTemplateResources || {})) { - if (logicalId in replacements) { - // diff.resources.get(logicalId).isDifferent = true; - // Then the properties that have been replaced need to be referenced - for (const propertyName of Object.keys(replacements[logicalId].propertiesReplaced)) { - - if (logicalId in diff.resources) { - // In this case, a property of a changed resource may have been skipped - if (!(propertyName in diff.resources.get(logicalId).propertyUpdates)) { - const newProp = new types.PropertyDifference( - // these fields we be decided below - {}, {}, { changeImpact: undefined }, - ); - newProp.isDifferent = true; - diff.resources.get(logicalId).propertyUpdates[propertyName] = newProp; - } - } else { - // In this case, we missed the resource entirely. - diff.resources.add(logicalId, diffResource(newTemplateResources[logicalId], newTemplateResources[logicalId])); - const newProp = new types.PropertyDifference( - // these fields we be decided below - {}, {}, { changeImpact: undefined }, - ); - newProp.isDifferent = true; - diff.resources.get(logicalId).setPropertyChange(propertyName, newProp); - } + // Add resources and properties that aren't in the template diff but that ARE in the changeset diff + for (const logicalId of Object.keys(replacements)) { + if (!(logicalId in diff.resources)) { + const noChangeResourceDiff = impl.diffResource(newTemplateResources[logicalId], newTemplateResources[logicalId]); + diff.resources.add(logicalId, noChangeResourceDiff); + } + + for (const propertyName of Object.keys(replacements[logicalId].propertiesReplaced)) { + if (propertyName in diff.resources.get(logicalId).propertyUpdates) { + // If the property is already marked to be updated, then we don't need to do anything. + continue; } + + const newProp = new types.PropertyDifference( + // these fields we be decided below + {}, {}, { changeImpact: undefined }, + ); + newProp.isDifferent = true; + diff.resources.get(logicalId).setPropertyChange(propertyName, newProp); } }; + // Now use the changeset diff to make property changeImpact more accurate. diff.resources.forEachDifference((logicalId: string, change: types.ResourceDifference) => { if (change.resourceType.includes('AWS::Serverless')) { // CFN applies the SAM transform before creating the changeset, so the changeset contains no information about SAM resources From 0e9e901dcfdb0bbc0ca7b5aa0f019ff7874566f1 Mon Sep 17 00:00:00 2001 From: Jakob Berg Date: Tue, 7 May 2024 16:26:25 -0400 Subject: [PATCH 03/11] fix typo --- packages/@aws-cdk/cloudformation-diff/lib/diff-template.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@aws-cdk/cloudformation-diff/lib/diff-template.ts b/packages/@aws-cdk/cloudformation-diff/lib/diff-template.ts index 52eee47887e30..74d146e2a0c54 100644 --- a/packages/@aws-cdk/cloudformation-diff/lib/diff-template.ts +++ b/packages/@aws-cdk/cloudformation-diff/lib/diff-template.ts @@ -239,7 +239,7 @@ function refineDiffWithChangeSet(diff: types.TemplateDiff, changeSet: DescribeCh } const newProp = new types.PropertyDifference( - // these fields we be decided below + // these fields will be decided below {}, {}, { changeImpact: undefined }, ); newProp.isDifferent = true; From e38b3b002f838d20174235a9510d8d335b7bb5ba Mon Sep 17 00:00:00 2001 From: Jakob Berg Date: Tue, 7 May 2024 18:17:27 -0400 Subject: [PATCH 04/11] fix build --- packages/@aws-cdk/cloudformation-diff/lib/diff-template.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/@aws-cdk/cloudformation-diff/lib/diff-template.ts b/packages/@aws-cdk/cloudformation-diff/lib/diff-template.ts index 74d146e2a0c54..81b88115f6437 100644 --- a/packages/@aws-cdk/cloudformation-diff/lib/diff-template.ts +++ b/packages/@aws-cdk/cloudformation-diff/lib/diff-template.ts @@ -226,8 +226,9 @@ function refineDiffWithChangeSet(diff: types.TemplateDiff, changeSet: DescribeCh const replacements = findResourceReplacements(changeSet); // Add resources and properties that aren't in the template diff but that ARE in the changeset diff + const resourceDiffLogicalIds = diff.resources.logicalIds; for (const logicalId of Object.keys(replacements)) { - if (!(logicalId in diff.resources)) { + if (!(resourceDiffLogicalIds.includes(logicalId))) { const noChangeResourceDiff = impl.diffResource(newTemplateResources[logicalId], newTemplateResources[logicalId]); diff.resources.add(logicalId, noChangeResourceDiff); } From 9c08eff6aa39a20e0bc3f58a517bcd45cf38096f Mon Sep 17 00:00:00 2001 From: Jakob Berg Date: Wed, 8 May 2024 11:16:54 -0400 Subject: [PATCH 05/11] tests --- .../test/diff-template.test.ts | 513 ++++++++++++++++++ 1 file changed, 513 insertions(+) diff --git a/packages/@aws-cdk/cloudformation-diff/test/diff-template.test.ts b/packages/@aws-cdk/cloudformation-diff/test/diff-template.test.ts index 318f27b6bbf30..41511f6b160e7 100644 --- a/packages/@aws-cdk/cloudformation-diff/test/diff-template.test.ts +++ b/packages/@aws-cdk/cloudformation-diff/test/diff-template.test.ts @@ -1231,4 +1231,517 @@ describe('changeset', () => { expect(differences.resources.differenceCount).toBe(1); expect(differences.resources.get('BucketResource').changeImpact === ResourceImpact.WILL_IMPORT); }); + + test('properties that only show up in changeset diff are included in fullDiff', () => { + // GIVEN + const currentTemplate = { + Parameters: { + SsmParameterValuetestbugreportC9: { + Type: 'AWS::SSM::Parameter::Value', + Default: 'goodJob', + }, + }, + Resources: { + mySsmParameter: { + Type: 'AWS::SSM::Parameter', + Properties: { + Name: 'mySsmParameterFromStack', + Type: 'String', + Value: { + Ref: 'SsmParameterValuetestbugreportC9', + }, + }, + }, + }, + }; + + // Template diff misses the change: + const diffWithoutChangeSet = fullDiff(currentTemplate, currentTemplate); + // THEN + expect(diffWithoutChangeSet.differenceCount).toBe(0); + expect(diffWithoutChangeSet.resources.changes).toEqual({}); + // AND THEN + const diffWithChangeSet = fullDiff(currentTemplate, currentTemplate, + { + Changes: [ + { + Type: 'Resource', + ResourceChange: { + Action: 'Modify', + LogicalResourceId: 'mySsmParameter', + PhysicalResourceId: 'mySsmParameterFromStack', + ResourceType: 'AWS::SSM::Parameter', + Replacement: 'False', + Scope: ['Properties'], + Details: [{ + Target: { Attribute: 'Properties', Name: 'Value', RequiresRecreation: 'Never' }, + Evaluation: 'Static', + ChangeSource: 'DirectModification', + }], + }, + }, + ], + Parameters: [{ + ParameterKey: 'SsmParameterValuetestbugreportC9', + ParameterValue: 'goodJob', + ResolvedValue: 'changedVal', + }], + }, + ); + + // THEN + expect(diffWithChangeSet.differenceCount).toBe(1); + expect(diffWithChangeSet.resources.changes).toEqual( + { + mySsmParameter: { + oldValue: { + Type: 'AWS::SSM::Parameter', + Properties: { + Name: 'mySsmParameterFromStack', + Type: 'String', + Value: { + Ref: 'SsmParameterValuetestbugreportC9', + }, + }, + }, + newValue: { + Type: 'AWS::SSM::Parameter', + Properties: { + Name: 'mySsmParameterFromStack', + Type: 'String', + Value: { + Ref: 'SsmParameterValuetestbugreportC9', + }, + }, + }, + resourceTypes: { + oldType: 'AWS::SSM::Parameter', + newType: 'AWS::SSM::Parameter', + }, + propertyDiffs: { + Name: { + oldValue: 'mySsmParameterFromStack', + newValue: 'mySsmParameterFromStack', + isDifferent: false, + changeImpact: 'NO_CHANGE', + }, + Type: { + oldValue: 'String', + newValue: 'String', + isDifferent: false, + changeImpact: 'NO_CHANGE', + }, + Value: { + oldValue: { + }, + newValue: { + }, + isDifferent: true, + changeImpact: 'WILL_UPDATE', // this is what changed! + }, + }, + otherDiffs: { + Type: { + oldValue: 'AWS::SSM::Parameter', + newValue: 'AWS::SSM::Parameter', + isDifferent: false, + }, + }, + isAddition: false, + isRemoval: false, + isImport: undefined, + }, + }, + ); + }); + + test('resources that only show up in changeset diff are included in fullDiff', () => { + // GIVEN + const currentTemplate = { + Parameters: { + SsmParameterValuetestbugreportC9: { + Type: 'AWS::SSM::Parameter::Value', + Default: 'goodJob', + }, + }, + Resources: { + Queue: { + Type: 'AWS::SQS::Queue', + Properties: { + QueueName: { + Ref: 'SsmParameterValuetestbugreportC9', + }, + }, + }, + }, + }; + + // Template diff misses the change: + const diffWithoutChangeSet = fullDiff(currentTemplate, currentTemplate); + // THEN + expect(diffWithoutChangeSet.differenceCount).toBe(0); + expect(diffWithoutChangeSet.resources.changes).toEqual({}); + + // AND THEN + const diffWithChangeSet = fullDiff(currentTemplate, currentTemplate, + { + Changes: [ + { + Type: 'Resource', + ResourceChange: { + PolicyAction: 'ReplaceAndDelete', + Action: 'Modify', + LogicalResourceId: 'Queue', + PhysicalResourceId: 'https://sqs.us-east-1.amazonaws.com/012345678901/hiii', + ResourceType: 'AWS::SQS::Queue', + Replacement: 'True', + Scope: ['Properties'], + Details: [{ + Target: { Attribute: 'Properties', Name: 'QueueName', RequiresRecreation: 'Always' }, + Evaluation: 'Static', + ChangeSource: 'DirectModification', + }], + }, + }, + ], + Parameters: [{ + ParameterKey: 'SsmParameterValuetestbugreportC9', + ParameterValue: 'goodJob', + ResolvedValue: 'changedVal', + }], + }, + + ); + + // THEN + expect(diffWithChangeSet.differenceCount).toBe(1); + expect(diffWithChangeSet.resources.changes).toEqual( + { + Queue: { + oldValue: { + Type: 'AWS::SQS::Queue', + Properties: { + QueueName: { + Ref: 'SsmParameterValuetestbugreportC9', + }, + }, + }, + newValue: { + Type: 'AWS::SQS::Queue', + Properties: { + QueueName: { + Ref: 'SsmParameterValuetestbugreportC9', + }, + }, + }, + resourceTypes: { + oldType: 'AWS::SQS::Queue', + newType: 'AWS::SQS::Queue', + }, + propertyDiffs: { + QueueName: { + oldValue: { + }, + newValue: { + }, + isDifferent: true, + changeImpact: 'WILL_REPLACE', // this is what changed! + }, + }, + otherDiffs: { + Type: { + oldValue: 'AWS::SQS::Queue', + newValue: 'AWS::SQS::Queue', + isDifferent: false, + }, + }, + isAddition: false, + isRemoval: false, + isImport: undefined, + }, + }, + ); + }); + + test('a resource in the diff that is missing a property has the missing property added to the diff', () => { + // The idea is, we detect 1 change in the template diff -- and we detect another change in the changeset diff. + + // GIVEN + const currentTemplate = { + Parameters: { + SsmParameterValuetestbugreportC9: { + Type: 'AWS::SSM::Parameter::Value', + Default: 'goodJob', + }, + }, + Resources: { + Queue: { + Type: 'AWS::SQS::Queue', + Properties: { + QueueName: { + 'Fn::Join': [ + '', + [ + 'newValue', + { + Ref: 'SsmParameterValuetestbugreportC9', + }, + ], + ], + }, + ReceiveMessageWaitTimeSeconds: 10, + }, + }, + }, + }; + + const newTemplate = { + Parameters: { + SsmParameterValuetestbugreportC9: { + Type: 'AWS::SSM::Parameter::Value', + Default: 'goodJob', + }, + }, + Resources: { + Queue: { + Type: 'AWS::SQS::Queue', + Properties: { + QueueName: { + 'Fn::Join': [ + '', + [ + 'newValue', + { + Ref: 'SsmParameterValuetestbugreportC9', + }, + ], + ], + }, + ReceiveMessageWaitTimeSeconds: 20, + }, + }, + }, + }; + + // Template diff misses the change: + const diffWithoutChangeSet = fullDiff(currentTemplate, newTemplate); + // THEN + expect(diffWithoutChangeSet.differenceCount).toBe(1); + expect(diffWithoutChangeSet.resources.changes).toEqual( + { + Queue: { + oldValue: { + Type: 'AWS::SQS::Queue', + Properties: { + QueueName: { + 'Fn::Join': [ + '', + [ + 'newValue', + { + Ref: 'SsmParameterValuetestbugreportC9', + }, + ], + ], + }, + ReceiveMessageWaitTimeSeconds: 10, + }, + }, + newValue: { + Type: 'AWS::SQS::Queue', + Properties: { + QueueName: { + 'Fn::Join': [ + '', + [ + 'newValue', + { + Ref: 'SsmParameterValuetestbugreportC9', + }, + ], + ], + }, + ReceiveMessageWaitTimeSeconds: 20, + }, + }, + resourceTypes: { + oldType: 'AWS::SQS::Queue', + newType: 'AWS::SQS::Queue', + }, + propertyDiffs: { + QueueName: { + oldValue: { + 'Fn::Join': [ + '', + [ + 'newValue', + { + Ref: 'SsmParameterValuetestbugreportC9', + }, + ], + ], + }, + newValue: { + 'Fn::Join': [ + '', + [ + 'newValue', + { + Ref: 'SsmParameterValuetestbugreportC9', + }, + ], + ], + }, + isDifferent: false, + changeImpact: 'NO_CHANGE', + }, + ReceiveMessageWaitTimeSeconds: { + oldValue: 10, + newValue: 20, + isDifferent: true, + changeImpact: 'WILL_UPDATE', + }, + }, + otherDiffs: { + Type: { + oldValue: 'AWS::SQS::Queue', + newValue: 'AWS::SQS::Queue', + isDifferent: false, + }, + }, + isAddition: false, + isRemoval: false, + isImport: undefined, + }, + }, + ); + + // AND THEN + const diffWithChangeSet = fullDiff(currentTemplate, newTemplate, + { + Changes: [ + { + Type: 'Resource', + ResourceChange: { + PolicyAction: 'ReplaceAndDelete', + Action: 'Modify', + LogicalResourceId: 'Queue', + PhysicalResourceId: 'https://sqs.us-east-1.amazonaws.com/012345678901/newValueNEEEWWWEEERRRRR', + ResourceType: 'AWS::SQS::Queue', + Replacement: 'True', + Scope: [ + 'Properties', + ], + Details: [{ + Target: { Attribute: 'Properties', Name: 'QueueName', RequiresRecreation: 'Always' }, + Evaluation: 'Static', + ChangeSource: 'DirectModification', + }, + { + Target: { Attribute: 'Properties', Name: 'ReceiveMessageWaitTimeSeconds', RequiresRecreation: 'Never' }, + Evaluation: 'Static', + ChangeSource: 'DirectModification', + }], + }, + }, + ], + Parameters: [{ + ParameterKey: 'SsmParameterValuetestbugreportC9', + ParameterValue: 'goodJob', + ResolvedValue: 'changedddd', + }], + }, + ); + + // THEN + expect(diffWithChangeSet.differenceCount).toBe(1); // this is the count of how many resources have changed + expect(diffWithChangeSet.resources.get('Queue').propertyUpdates).toEqual( + { + QueueName: { + oldValue: { + }, + newValue: { + }, + isDifferent: true, + changeImpact: 'WILL_REPLACE', + }, + ReceiveMessageWaitTimeSeconds: { + oldValue: 10, + newValue: 20, + isDifferent: true, + changeImpact: 'WILL_UPDATE', + }, + }, + ); + expect(diffWithChangeSet.resources.changes).toEqual( + { + Queue: { + oldValue: { + Type: 'AWS::SQS::Queue', + Properties: { + QueueName: { + 'Fn::Join': [ + '', + [ + 'newValue', + { + Ref: 'SsmParameterValuetestbugreportC9', + }, + ], + ], + }, + ReceiveMessageWaitTimeSeconds: 10, + }, + }, + newValue: { + Type: 'AWS::SQS::Queue', + Properties: { + QueueName: { + 'Fn::Join': [ + '', + [ + 'newValue', + { + Ref: 'SsmParameterValuetestbugreportC9', + }, + ], + ], + }, + ReceiveMessageWaitTimeSeconds: 20, + }, + }, + resourceTypes: { + oldType: 'AWS::SQS::Queue', + newType: 'AWS::SQS::Queue', + }, + propertyDiffs: { + QueueName: { + oldValue: { + }, + newValue: { + }, + isDifferent: true, + changeImpact: 'WILL_REPLACE', + }, + ReceiveMessageWaitTimeSeconds: { + oldValue: 10, + newValue: 20, + isDifferent: true, + changeImpact: 'WILL_UPDATE', + }, + }, + otherDiffs: { + Type: { + oldValue: 'AWS::SQS::Queue', + newValue: 'AWS::SQS::Queue', + isDifferent: false, + }, + }, + isAddition: false, + isRemoval: false, + isImport: undefined, + }, + }, + ); + }); }); From a8c90d933f39e8a8bb831d5d15ee05359af575aa Mon Sep 17 00:00:00 2001 From: Jakob Berg Date: Wed, 8 May 2024 13:24:49 -0400 Subject: [PATCH 06/11] integ tests --- .../@aws-cdk-testing/cli-integ/package.json | 7 +- .../cli-integ/resources/cdk-apps/app/app.js | 18 + .../tests/cli-integ-tests/cli.integtest.ts | 54 ++ yarn.lock | 505 ++++++++++++++++-- 4 files changed, 550 insertions(+), 34 deletions(-) diff --git a/packages/@aws-cdk-testing/cli-integ/package.json b/packages/@aws-cdk-testing/cli-integ/package.json index 44ae905358779..31d04fe76dd7d 100644 --- a/packages/@aws-cdk-testing/cli-integ/package.json +++ b/packages/@aws-cdk-testing/cli-integ/package.json @@ -30,14 +30,15 @@ "license": "Apache-2.0", "devDependencies": { "@aws-cdk/cdk-build-tools": "0.0.0", - "@types/semver": "^7.5.8", - "@types/yargs": "^15.0.19", + "@aws-cdk/pkglint": "0.0.0", "@types/fs-extra": "^9.0.13", "@types/glob": "^7.2.0", "@types/npm": "^7.19.3", - "@aws-cdk/pkglint": "0.0.0" + "@types/semver": "^7.5.8", + "@types/yargs": "^15.0.19" }, "dependencies": { + "@aws-sdk/client-ssm": "^3.569.0", "@octokit/rest": "^18.12.0", "aws-sdk": "^2.1610.0", "axios": "^1.6.8", diff --git a/packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/app/app.js b/packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/app/app.js index 5683951c2a832..8dbd2b4fd40b3 100755 --- a/packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/app/app.js +++ b/packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/app/app.js @@ -126,6 +126,22 @@ class SsoInstanceAccessControlConfig extends Stack { } } +class DiffFromChangeSetStack extends Stack { + constructor(scope, id) { + super(scope, id); + + const queueNameFromParameter = ssm.StringParameter.valueForStringParameter(this, 'for-queue-name-defined-by-ssm-param'); + new sqs.Queue(this, "DiffFromChangeSetQueue", { + queueName: queueNameFromParameter, + }) + + new ssm.StringParameter(this, 'DiffFromChangeSetSSMParam', { + parameterName: 'DiffFromChangeSetSSMParamName', + stringValue: queueNameFromParameter, + }); + } +} + class ListMultipleDependentStack extends Stack { constructor(scope, id) { super(scope, id); @@ -658,6 +674,8 @@ switch (stackSet) { const failed = new FailedStack(app, `${stackPrefix}-failed`) + new DiffFromChangeSetStack(app, `${stackPrefix}-queue-name-defined-by-ssm-param`) + // A stack that depends on the failed stack -- used to test that '-e' does not deploy the failing stack const dependsOnFailed = new OutputsStack(app, `${stackPrefix}-depends-on-failed`); dependsOnFailed.addDependency(failed); diff --git a/packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/cli.integtest.ts b/packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/cli.integtest.ts index 749788183f26e..b4b2800c8d6cc 100644 --- a/packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/cli.integtest.ts +++ b/packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/cli.integtest.ts @@ -1,6 +1,7 @@ import { promises as fs, existsSync } from 'fs'; import * as os from 'os'; import * as path from 'path'; +import * as SSM from '@aws-sdk/client-ssm'; import { integTest, cloneDirectory, shell, withDefaultFixture, retry, sleep, randomInteger, withSamIntegrationFixture, RESOURCES_DIR, withCDKMigrateFixture, withExtendedTimeoutFixture } from '../../lib'; jest.setTimeout(2 * 60 * 60_000); // Includes the time to acquire locks, worst-case single-threaded runtime @@ -944,6 +945,59 @@ integTest('cdk diff --quiet does not print \'There were no differences\' message expect(diff).not.toContain('There were no differences'); })); +integTest('cdk diff picks up changes that are only present in changeset', withDefaultFixture(async (fixture) => { + // eslint-disable-next-line no-console + const ssmClient = new SSM.SSMClient(); + await ssmClient.send(new SSM.PutParameterCommand( + { + Name: 'for-queue-name-defined-by-ssm-param', + Value: Math.floor(Math.random() * 100_000_000_000_001).toString(), + Overwrite: true, + Type: 'String', + }, + )); + + // GIVEN + try { + await fixture.cdkDeploy('queue-name-defined-by-ssm-param'); + + // We want to change the ssm value. Then the CFN changeset will detect that the queue will be changed upon deploy. + const newRandomValueForSsmParam = Math.floor(Math.random() * 100_000_000_000_001).toString(); + await ssmClient.send(new SSM.PutParameterCommand( + { + Name: 'for-queue-name-defined-by-ssm-param', + Value: newRandomValueForSsmParam, + Type: 'String', + Overwrite: true, + }, + )); + + // WHEN + const diff = await fixture.cdk(['diff', fixture.fullStackName('queue-name-defined-by-ssm-param')]); + + ` + Resources + [~] AWS::SQS::Queue DiffFromChangeSetQueue DiffFromChangeSetQueue06622C07 replace + └─ [~] QueueName (requires replacement) + [~] AWS::SSM::Parameter DiffFromChangeSetSSMParam DiffFromChangeSetSSMParam92A9A723 + └─ [~] Value + `; + + // THEN + // the reason these aren't just 1 line is because the terminal output includes colors, which comes up like \u001b[4m\u001b[1mResources\u001b + // which is not very human friendly... + expect(diff).toContain('AWS::SQS::Queue'); + expect(diff).toContain('DiffFromChangeSetQueue'); + expect(diff).toContain('QueueName (requires replacement)'); + expect(diff).toContain('AWS::SSM::Parameter'); + expect(diff).toContain('DiffFromChangeSetSSMParam'); + expect(diff).toContain('Value'); + expect(diff).toContain('Number of stacks with differences: 1'); + } finally { + await fixture.cdkDestroy('queue-name-defined-by-ssm-param'); + } +})); + integTest('deploy stack with docker asset', withDefaultFixture(async (fixture) => { await fixture.cdkDeploy('docker'); })); diff --git a/yarn.lock b/yarn.lock index 8b4c5897c2b27..25b968db9994b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1529,6 +1529,101 @@ tslib "^2.5.0" uuid "^8.3.2" +"@aws-sdk/client-ssm@^3.569.0": + version "3.569.0" + resolved "https://registry.npmjs.org/@aws-sdk/client-ssm/-/client-ssm-3.569.0.tgz#c30e197ee1ed21cfe3007f8dc38bce7dc0c73566" + integrity sha512-SO/R0QxjApOC/Jvlx421JJjtCsApxSI+029IcVXTeaIWyNHlXtSTS3+E2NOap9s1YWCa5JCCceXEunoqeMM0XA== + dependencies: + "@aws-crypto/sha256-browser" "3.0.0" + "@aws-crypto/sha256-js" "3.0.0" + "@aws-sdk/client-sso-oidc" "3.569.0" + "@aws-sdk/client-sts" "3.569.0" + "@aws-sdk/core" "3.567.0" + "@aws-sdk/credential-provider-node" "3.569.0" + "@aws-sdk/middleware-host-header" "3.567.0" + "@aws-sdk/middleware-logger" "3.568.0" + "@aws-sdk/middleware-recursion-detection" "3.567.0" + "@aws-sdk/middleware-user-agent" "3.567.0" + "@aws-sdk/region-config-resolver" "3.567.0" + "@aws-sdk/types" "3.567.0" + "@aws-sdk/util-endpoints" "3.567.0" + "@aws-sdk/util-user-agent-browser" "3.567.0" + "@aws-sdk/util-user-agent-node" "3.568.0" + "@smithy/config-resolver" "^2.2.0" + "@smithy/core" "^1.4.2" + "@smithy/fetch-http-handler" "^2.5.0" + "@smithy/hash-node" "^2.2.0" + "@smithy/invalid-dependency" "^2.2.0" + "@smithy/middleware-content-length" "^2.2.0" + "@smithy/middleware-endpoint" "^2.5.1" + "@smithy/middleware-retry" "^2.3.1" + "@smithy/middleware-serde" "^2.3.0" + "@smithy/middleware-stack" "^2.2.0" + "@smithy/node-config-provider" "^2.3.0" + "@smithy/node-http-handler" "^2.5.0" + "@smithy/protocol-http" "^3.3.0" + "@smithy/smithy-client" "^2.5.1" + "@smithy/types" "^2.12.0" + "@smithy/url-parser" "^2.2.0" + "@smithy/util-base64" "^2.3.0" + "@smithy/util-body-length-browser" "^2.2.0" + "@smithy/util-body-length-node" "^2.3.0" + "@smithy/util-defaults-mode-browser" "^2.2.1" + "@smithy/util-defaults-mode-node" "^2.3.1" + "@smithy/util-endpoints" "^1.2.0" + "@smithy/util-middleware" "^2.2.0" + "@smithy/util-retry" "^2.2.0" + "@smithy/util-utf8" "^2.3.0" + "@smithy/util-waiter" "^2.2.0" + tslib "^2.6.2" + uuid "^9.0.1" + +"@aws-sdk/client-sso-oidc@3.569.0": + version "3.569.0" + resolved "https://registry.npmjs.org/@aws-sdk/client-sso-oidc/-/client-sso-oidc-3.569.0.tgz#4dc90be9a35119238112455f8d9080b2ccdf0e24" + integrity sha512-u5DEjNEvRvlKKh1QLCDuQ8GIrx+OFvJFLfhorsp4oCxDylvORs+KfyKKnJAw4wYEEHyxyz9GzHD7p6a8+HLVHw== + dependencies: + "@aws-crypto/sha256-browser" "3.0.0" + "@aws-crypto/sha256-js" "3.0.0" + "@aws-sdk/client-sts" "3.569.0" + "@aws-sdk/core" "3.567.0" + "@aws-sdk/credential-provider-node" "3.569.0" + "@aws-sdk/middleware-host-header" "3.567.0" + "@aws-sdk/middleware-logger" "3.568.0" + "@aws-sdk/middleware-recursion-detection" "3.567.0" + "@aws-sdk/middleware-user-agent" "3.567.0" + "@aws-sdk/region-config-resolver" "3.567.0" + "@aws-sdk/types" "3.567.0" + "@aws-sdk/util-endpoints" "3.567.0" + "@aws-sdk/util-user-agent-browser" "3.567.0" + "@aws-sdk/util-user-agent-node" "3.568.0" + "@smithy/config-resolver" "^2.2.0" + "@smithy/core" "^1.4.2" + "@smithy/fetch-http-handler" "^2.5.0" + "@smithy/hash-node" "^2.2.0" + "@smithy/invalid-dependency" "^2.2.0" + "@smithy/middleware-content-length" "^2.2.0" + "@smithy/middleware-endpoint" "^2.5.1" + "@smithy/middleware-retry" "^2.3.1" + "@smithy/middleware-serde" "^2.3.0" + "@smithy/middleware-stack" "^2.2.0" + "@smithy/node-config-provider" "^2.3.0" + "@smithy/node-http-handler" "^2.5.0" + "@smithy/protocol-http" "^3.3.0" + "@smithy/smithy-client" "^2.5.1" + "@smithy/types" "^2.12.0" + "@smithy/url-parser" "^2.2.0" + "@smithy/util-base64" "^2.3.0" + "@smithy/util-body-length-browser" "^2.2.0" + "@smithy/util-body-length-node" "^2.3.0" + "@smithy/util-defaults-mode-browser" "^2.2.1" + "@smithy/util-defaults-mode-node" "^2.3.1" + "@smithy/util-endpoints" "^1.2.0" + "@smithy/util-middleware" "^2.2.0" + "@smithy/util-retry" "^2.2.0" + "@smithy/util-utf8" "^2.3.0" + tslib "^2.6.2" + "@aws-sdk/client-sso@3.421.0": version "3.421.0" resolved "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.421.0.tgz#794350d63bd6b327f4919460ae908a1a39585165" @@ -1655,6 +1750,50 @@ "@smithy/util-utf8" "^2.3.0" tslib "^2.6.2" +"@aws-sdk/client-sso@3.568.0": + version "3.568.0" + resolved "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.568.0.tgz#4e06fa9c052931641921a0a723f58f81513c673c" + integrity sha512-LSD7k0ZBQNWouTN5dYpUkeestoQ+r5u6cp6o+FATKeiFQET85RNA3xJ4WPnOI5rBC1PETKhQXvF44863P3hCaQ== + dependencies: + "@aws-crypto/sha256-browser" "3.0.0" + "@aws-crypto/sha256-js" "3.0.0" + "@aws-sdk/core" "3.567.0" + "@aws-sdk/middleware-host-header" "3.567.0" + "@aws-sdk/middleware-logger" "3.568.0" + "@aws-sdk/middleware-recursion-detection" "3.567.0" + "@aws-sdk/middleware-user-agent" "3.567.0" + "@aws-sdk/region-config-resolver" "3.567.0" + "@aws-sdk/types" "3.567.0" + "@aws-sdk/util-endpoints" "3.567.0" + "@aws-sdk/util-user-agent-browser" "3.567.0" + "@aws-sdk/util-user-agent-node" "3.568.0" + "@smithy/config-resolver" "^2.2.0" + "@smithy/core" "^1.4.2" + "@smithy/fetch-http-handler" "^2.5.0" + "@smithy/hash-node" "^2.2.0" + "@smithy/invalid-dependency" "^2.2.0" + "@smithy/middleware-content-length" "^2.2.0" + "@smithy/middleware-endpoint" "^2.5.1" + "@smithy/middleware-retry" "^2.3.1" + "@smithy/middleware-serde" "^2.3.0" + "@smithy/middleware-stack" "^2.2.0" + "@smithy/node-config-provider" "^2.3.0" + "@smithy/node-http-handler" "^2.5.0" + "@smithy/protocol-http" "^3.3.0" + "@smithy/smithy-client" "^2.5.1" + "@smithy/types" "^2.12.0" + "@smithy/url-parser" "^2.2.0" + "@smithy/util-base64" "^2.3.0" + "@smithy/util-body-length-browser" "^2.2.0" + "@smithy/util-body-length-node" "^2.3.0" + "@smithy/util-defaults-mode-browser" "^2.2.1" + "@smithy/util-defaults-mode-node" "^2.3.1" + "@smithy/util-endpoints" "^1.2.0" + "@smithy/util-middleware" "^2.2.0" + "@smithy/util-retry" "^2.2.0" + "@smithy/util-utf8" "^2.3.0" + tslib "^2.6.2" + "@aws-sdk/client-sts@3.421.0": version "3.421.0" resolved "https://registry.npmjs.org/@aws-sdk/client-sts/-/client-sts-3.421.0.tgz#1c7b3265be3acb609159533c24421da4e9466570" @@ -1745,6 +1884,52 @@ fast-xml-parser "4.2.5" tslib "^2.5.0" +"@aws-sdk/client-sts@3.569.0": + version "3.569.0" + resolved "https://registry.npmjs.org/@aws-sdk/client-sts/-/client-sts-3.569.0.tgz#dc2e0e791081c37dede1b58a2057c26488fcddbf" + integrity sha512-3AyipQ2zHszkcTr8n1Sp7CiMUi28aMf1vOhEo0KKi0DWGo1Z1qJEpWeRP363KG0n9/8U3p1IkXGz5FRbpXZxIw== + dependencies: + "@aws-crypto/sha256-browser" "3.0.0" + "@aws-crypto/sha256-js" "3.0.0" + "@aws-sdk/client-sso-oidc" "3.569.0" + "@aws-sdk/core" "3.567.0" + "@aws-sdk/credential-provider-node" "3.569.0" + "@aws-sdk/middleware-host-header" "3.567.0" + "@aws-sdk/middleware-logger" "3.568.0" + "@aws-sdk/middleware-recursion-detection" "3.567.0" + "@aws-sdk/middleware-user-agent" "3.567.0" + "@aws-sdk/region-config-resolver" "3.567.0" + "@aws-sdk/types" "3.567.0" + "@aws-sdk/util-endpoints" "3.567.0" + "@aws-sdk/util-user-agent-browser" "3.567.0" + "@aws-sdk/util-user-agent-node" "3.568.0" + "@smithy/config-resolver" "^2.2.0" + "@smithy/core" "^1.4.2" + "@smithy/fetch-http-handler" "^2.5.0" + "@smithy/hash-node" "^2.2.0" + "@smithy/invalid-dependency" "^2.2.0" + "@smithy/middleware-content-length" "^2.2.0" + "@smithy/middleware-endpoint" "^2.5.1" + "@smithy/middleware-retry" "^2.3.1" + "@smithy/middleware-serde" "^2.3.0" + "@smithy/middleware-stack" "^2.2.0" + "@smithy/node-config-provider" "^2.3.0" + "@smithy/node-http-handler" "^2.5.0" + "@smithy/protocol-http" "^3.3.0" + "@smithy/smithy-client" "^2.5.1" + "@smithy/types" "^2.12.0" + "@smithy/url-parser" "^2.2.0" + "@smithy/util-base64" "^2.3.0" + "@smithy/util-body-length-browser" "^2.2.0" + "@smithy/util-body-length-node" "^2.3.0" + "@smithy/util-defaults-mode-browser" "^2.2.1" + "@smithy/util-defaults-mode-node" "^2.3.1" + "@smithy/util-endpoints" "^1.2.0" + "@smithy/util-middleware" "^2.2.0" + "@smithy/util-retry" "^2.2.0" + "@smithy/util-utf8" "^2.3.0" + tslib "^2.6.2" + "@aws-sdk/client-synthetics@3.421.0": version "3.421.0" resolved "https://registry.npmjs.org/@aws-sdk/client-synthetics/-/client-synthetics-3.421.0.tgz#fbc848916f51255d883c1b3b5240f8975842daba" @@ -1809,6 +1994,19 @@ fast-xml-parser "4.2.5" tslib "^2.6.2" +"@aws-sdk/core@3.567.0": + version "3.567.0" + resolved "https://registry.npmjs.org/@aws-sdk/core/-/core-3.567.0.tgz#f0b93ba1541dcc179438fb8d80b2a80ec865b623" + integrity sha512-zUDEQhC7blOx6sxhHdT75x98+SXQVdUIMu8z8AjqMWiYK2v4WkOS8i6dOS4E5OjL5J1Ac+ruy8op/Bk4AFqSIw== + dependencies: + "@smithy/core" "^1.4.2" + "@smithy/protocol-http" "^3.3.0" + "@smithy/signature-v4" "^2.3.0" + "@smithy/smithy-client" "^2.5.1" + "@smithy/types" "^2.12.0" + fast-xml-parser "4.2.5" + tslib "^2.6.2" + "@aws-sdk/credential-provider-cognito-identity@3.421.0": version "3.421.0" resolved "https://registry.npmjs.org/@aws-sdk/credential-provider-cognito-identity/-/credential-provider-cognito-identity-3.421.0.tgz#d06bf11df56896feb048e057b02e98b1870bd388" @@ -1850,6 +2048,16 @@ "@smithy/types" "^2.12.0" tslib "^2.6.2" +"@aws-sdk/credential-provider-env@3.568.0": + version "3.568.0" + resolved "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.568.0.tgz#fc7fda0bc48bbc75065a9084e41d429037e0e1c5" + integrity sha512-MVTQoZwPnP1Ev5A7LG+KzeU6sCB8BcGkZeDT1z1V5Wt7GPq0MgFQTSSjhImnB9jqRSZkl1079Bt3PbO6lfIS8g== + dependencies: + "@aws-sdk/types" "3.567.0" + "@smithy/property-provider" "^2.2.0" + "@smithy/types" "^2.12.0" + tslib "^2.6.2" + "@aws-sdk/credential-provider-http@3.552.0": version "3.552.0" resolved "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.552.0.tgz#ecc88d02cba95621887e6b85b2583e756ad29eb6" @@ -1865,6 +2073,21 @@ "@smithy/util-stream" "^2.2.0" tslib "^2.6.2" +"@aws-sdk/credential-provider-http@3.568.0": + version "3.568.0" + resolved "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.568.0.tgz#7f7239bed7c23db7356ebeae5f3b3bda9f751b08" + integrity sha512-gL0NlyI2eW17hnCrh45hZV+qjtBquB+Bckiip9R6DIVRKqYcoILyiFhuOgf2bXeF23gVh6j18pvUvIoTaFWs5w== + dependencies: + "@aws-sdk/types" "3.567.0" + "@smithy/fetch-http-handler" "^2.5.0" + "@smithy/node-http-handler" "^2.5.0" + "@smithy/property-provider" "^2.2.0" + "@smithy/protocol-http" "^3.3.0" + "@smithy/smithy-client" "^2.5.1" + "@smithy/types" "^2.12.0" + "@smithy/util-stream" "^2.2.0" + tslib "^2.6.2" + "@aws-sdk/credential-provider-ini@3.421.0": version "3.421.0" resolved "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.421.0.tgz#b58f8fd095c4389926d0e53ed2b775b184d03ec2" @@ -1913,6 +2136,22 @@ "@smithy/types" "^2.12.0" tslib "^2.6.2" +"@aws-sdk/credential-provider-ini@3.568.0": + version "3.568.0" + resolved "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.568.0.tgz#3ed29a48fb2f9f44f614d268f3f5a70daf22ba85" + integrity sha512-m5DUN9mpto5DhEvo6w3+8SS6q932ja37rTNvpPqWJIaWhj7OorAwVirSaJQAQB/M8+XCUIrUonxytphZB28qGQ== + dependencies: + "@aws-sdk/credential-provider-env" "3.568.0" + "@aws-sdk/credential-provider-process" "3.568.0" + "@aws-sdk/credential-provider-sso" "3.568.0" + "@aws-sdk/credential-provider-web-identity" "3.568.0" + "@aws-sdk/types" "3.567.0" + "@smithy/credential-provider-imds" "^2.3.0" + "@smithy/property-provider" "^2.2.0" + "@smithy/shared-ini-file-loader" "^2.4.0" + "@smithy/types" "^2.12.0" + tslib "^2.6.2" + "@aws-sdk/credential-provider-node@3.421.0": version "3.421.0" resolved "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.421.0.tgz#3d1793ee47d0335532eb01a23cbb7d5320dd3056" @@ -1965,6 +2204,24 @@ "@smithy/types" "^2.12.0" tslib "^2.6.2" +"@aws-sdk/credential-provider-node@3.569.0": + version "3.569.0" + resolved "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.569.0.tgz#714f3c3ccb4cec717f02535edde7c5eeb8bb8828" + integrity sha512-7jH4X2qlPU3PszZP1zvHJorhLARbU1tXvp8ngBe8ArXBrkFpl/dQ2Y/IRAICPm/pyC1IEt8L/CvKp+dz7v/eRw== + dependencies: + "@aws-sdk/credential-provider-env" "3.568.0" + "@aws-sdk/credential-provider-http" "3.568.0" + "@aws-sdk/credential-provider-ini" "3.568.0" + "@aws-sdk/credential-provider-process" "3.568.0" + "@aws-sdk/credential-provider-sso" "3.568.0" + "@aws-sdk/credential-provider-web-identity" "3.568.0" + "@aws-sdk/types" "3.567.0" + "@smithy/credential-provider-imds" "^2.3.0" + "@smithy/property-provider" "^2.2.0" + "@smithy/shared-ini-file-loader" "^2.4.0" + "@smithy/types" "^2.12.0" + tslib "^2.6.2" + "@aws-sdk/credential-provider-process@3.418.0": version "3.418.0" resolved "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.418.0.tgz#1cb6d816bd471db3f9724715b007035ef18b5b2b" @@ -1998,6 +2255,17 @@ "@smithy/types" "^2.12.0" tslib "^2.6.2" +"@aws-sdk/credential-provider-process@3.568.0": + version "3.568.0" + resolved "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.568.0.tgz#9c6202d64bd9bead77dc10fb6b61b2a64c819749" + integrity sha512-r01zbXbanP17D+bQUb7mD8Iu2SuayrrYZ0Slgvx32qgz47msocV9EPCSwI4Hkw2ZtEPCeLQR4XCqFJB1D9P50w== + dependencies: + "@aws-sdk/types" "3.567.0" + "@smithy/property-provider" "^2.2.0" + "@smithy/shared-ini-file-loader" "^2.4.0" + "@smithy/types" "^2.12.0" + tslib "^2.6.2" + "@aws-sdk/credential-provider-sso@3.421.0": version "3.421.0" resolved "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.421.0.tgz#1863eabf232dd6add900e045e36a0e6c1213e31c" @@ -2037,6 +2305,19 @@ "@smithy/types" "^2.12.0" tslib "^2.6.2" +"@aws-sdk/credential-provider-sso@3.568.0": + version "3.568.0" + resolved "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.568.0.tgz#7120d27181daeb7a2ca809e7f2c86b71a0595ed2" + integrity sha512-+TA77NWOEXMUcfLoOuim6xiyXFg1GqHj55ggI1goTKGVvdHYZ+rhxZbwjI29+ewzPt/qcItDJcvhrjOrg9lCag== + dependencies: + "@aws-sdk/client-sso" "3.568.0" + "@aws-sdk/token-providers" "3.568.0" + "@aws-sdk/types" "3.567.0" + "@smithy/property-provider" "^2.2.0" + "@smithy/shared-ini-file-loader" "^2.4.0" + "@smithy/types" "^2.12.0" + tslib "^2.6.2" + "@aws-sdk/credential-provider-web-identity@3.418.0": version "3.418.0" resolved "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.418.0.tgz#c2aed2a79bf193c1fef2b98391aaa9de7336aaaf" @@ -2067,6 +2348,16 @@ "@smithy/types" "^2.12.0" tslib "^2.6.2" +"@aws-sdk/credential-provider-web-identity@3.568.0": + version "3.568.0" + resolved "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.568.0.tgz#b4e7958dc92a6cbbf5e9fd065cecd76573d4b70f" + integrity sha512-ZJSmTmoIdg6WqAULjYzaJ3XcbgBzVy36lir6Y0UBMRGaxDgos1AARuX6EcYzXOl+ksLvxt/xMQ+3aYh1LWfKSw== + dependencies: + "@aws-sdk/types" "3.567.0" + "@smithy/property-provider" "^2.2.0" + "@smithy/types" "^2.12.0" + tslib "^2.6.2" + "@aws-sdk/credential-providers@3.421.0": version "3.421.0" resolved "https://registry.npmjs.org/@aws-sdk/credential-providers/-/credential-providers-3.421.0.tgz#567d4b7ae00809d7d4f8dce088e6ed5b5e622b7b" @@ -2212,6 +2503,16 @@ "@smithy/types" "^2.12.0" tslib "^2.6.2" +"@aws-sdk/middleware-host-header@3.567.0": + version "3.567.0" + resolved "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.567.0.tgz#52f278234458ec3035e9534fee582c95a8fec4f7" + integrity sha512-zQHHj2N3in9duKghH7AuRNrOMLnKhW6lnmb7dznou068DJtDr76w475sHp2TF0XELsOGENbbBsOlN/S5QBFBVQ== + dependencies: + "@aws-sdk/types" "3.567.0" + "@smithy/protocol-http" "^3.3.0" + "@smithy/types" "^2.12.0" + tslib "^2.6.2" + "@aws-sdk/middleware-location-constraint@3.418.0": version "3.418.0" resolved "https://registry.npmjs.org/@aws-sdk/middleware-location-constraint/-/middleware-location-constraint-3.418.0.tgz#e62e213a72ce583ba6135db51dcc60d07825b8ee" @@ -2257,6 +2558,15 @@ "@smithy/types" "^2.12.0" tslib "^2.6.2" +"@aws-sdk/middleware-logger@3.568.0": + version "3.568.0" + resolved "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.568.0.tgz#aeb85cc8f7da431442d0f5914f3a3e262eb55a09" + integrity sha512-BinH72RG7K3DHHC1/tCulocFv+ZlQ9SrPF9zYT0T1OT95JXuHhB7fH8gEABrc6DAtOdJJh2fgxQjPy5tzPtsrA== + dependencies: + "@aws-sdk/types" "3.567.0" + "@smithy/types" "^2.12.0" + tslib "^2.6.2" + "@aws-sdk/middleware-recursion-detection@3.418.0": version "3.418.0" resolved "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.418.0.tgz#2bb80d084f946846ad4907f3d6e0b451787d62b1" @@ -2287,6 +2597,16 @@ "@smithy/types" "^2.12.0" tslib "^2.6.2" +"@aws-sdk/middleware-recursion-detection@3.567.0": + version "3.567.0" + resolved "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.567.0.tgz#95d91f071b57fb5245d522db70df1652275f06ac" + integrity sha512-rFk3QhdT4IL6O/UWHmNdjJiURutBCy+ogGqaNHf/RELxgXH3KmYorLwCe0eFb5hq8f6vr3zl4/iH7YtsUOuo1w== + dependencies: + "@aws-sdk/types" "3.567.0" + "@smithy/protocol-http" "^3.3.0" + "@smithy/types" "^2.12.0" + tslib "^2.6.2" + "@aws-sdk/middleware-sdk-ec2@3.418.0": version "3.418.0" resolved "https://registry.npmjs.org/@aws-sdk/middleware-sdk-ec2/-/middleware-sdk-ec2-3.418.0.tgz#eac7054b128645c5a040c8e95b5cf92c7994d2fd" @@ -2444,6 +2764,17 @@ "@smithy/types" "^2.12.0" tslib "^2.6.2" +"@aws-sdk/middleware-user-agent@3.567.0": + version "3.567.0" + resolved "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.567.0.tgz#0dbedb18b33a7f490948f8b153301bd4bc7e825d" + integrity sha512-a7DBGMRBLWJU3BqrQjOtKS4/RcCh/BhhKqwjCE0FEhhm6A/GGuAs/DcBGOl6Y8Wfsby3vejSlppTLH/qtV1E9w== + dependencies: + "@aws-sdk/types" "3.567.0" + "@aws-sdk/util-endpoints" "3.567.0" + "@smithy/protocol-http" "^3.3.0" + "@smithy/types" "^2.12.0" + tslib "^2.6.2" + "@aws-sdk/node-http-handler@^3.370.0": version "3.374.0" resolved "https://registry.npmjs.org/@aws-sdk/node-http-handler/-/node-http-handler-3.374.0.tgz#8cd58b4d9814713e26034c12eabc119c113a5bc4" @@ -2486,6 +2817,18 @@ "@smithy/util-middleware" "^2.2.0" tslib "^2.6.2" +"@aws-sdk/region-config-resolver@3.567.0": + version "3.567.0" + resolved "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.567.0.tgz#c3ad943d3debcfb0c50ce3556ed183195f8590f9" + integrity sha512-VMDyYi5Dh2NydDiIARZ19DwMfbyq0llS736cp47qopmO6wzdeul7WRTx8NKfEYN0/AwEaqmTW0ohx58jSB1lYg== + dependencies: + "@aws-sdk/types" "3.567.0" + "@smithy/node-config-provider" "^2.3.0" + "@smithy/types" "^2.12.0" + "@smithy/util-config-provider" "^2.3.0" + "@smithy/util-middleware" "^2.2.0" + tslib "^2.6.2" + "@aws-sdk/s3-request-presigner@3.451.0": version "3.451.0" resolved "https://registry.npmjs.org/@aws-sdk/s3-request-presigner/-/s3-request-presigner-3.451.0.tgz#1728993a547017f739c9c24af2d8e058e8873c4f" @@ -2617,6 +2960,17 @@ "@smithy/types" "^2.12.0" tslib "^2.6.2" +"@aws-sdk/token-providers@3.568.0": + version "3.568.0" + resolved "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.568.0.tgz#8efe5a3d97e5346dd8cb473accdcbfec466f9cba" + integrity sha512-mCQElYzY5N2JlXB7LyjOoLvRN/JiSV+E9szLwhYN3dleTUCMbGqWb7RiAR2V3fO+mz8f9kR7DThTExKJbKogKw== + dependencies: + "@aws-sdk/types" "3.567.0" + "@smithy/property-provider" "^2.2.0" + "@smithy/shared-ini-file-loader" "^2.4.0" + "@smithy/types" "^2.12.0" + tslib "^2.6.2" + "@aws-sdk/types@3.418.0": version "3.418.0" resolved "https://registry.npmjs.org/@aws-sdk/types/-/types-3.418.0.tgz#c23213110b0c313d5546c810da032a441682f49a" @@ -2641,6 +2995,14 @@ "@smithy/types" "^2.12.0" tslib "^2.6.2" +"@aws-sdk/types@3.567.0": + version "3.567.0" + resolved "https://registry.npmjs.org/@aws-sdk/types/-/types-3.567.0.tgz#b2dc88e154140b1ff87e94f63c97447bdb1c1738" + integrity sha512-JBznu45cdgQb8+T/Zab7WpBmfEAh77gsk99xuF4biIb2Sw1mdseONdoGDjEJX57a25TzIv/WUJ2oABWumckz1A== + dependencies: + "@smithy/types" "^2.12.0" + tslib "^2.6.2" + "@aws-sdk/util-arn-parser@3.310.0": version "3.310.0" resolved "https://registry.npmjs.org/@aws-sdk/util-arn-parser/-/util-arn-parser-3.310.0.tgz#861ff8810851be52a320ec9e4786f15b5fc74fba" @@ -2675,6 +3037,16 @@ "@smithy/util-endpoints" "^1.2.0" tslib "^2.6.2" +"@aws-sdk/util-endpoints@3.567.0": + version "3.567.0" + resolved "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.567.0.tgz#c536ad8b9acf99ad762ab949fe0fed943c6f5a12" + integrity sha512-WVhot3qmi0BKL9ZKnUqsvCd++4RF2DsJIG32NlRaml1FT9KaqSzNv0RXeA6k/kYwiiNT7y3YWu3Lbzy7c6vG9g== + dependencies: + "@aws-sdk/types" "3.567.0" + "@smithy/types" "^2.12.0" + "@smithy/util-endpoints" "^1.2.0" + tslib "^2.6.2" + "@aws-sdk/util-format-url@3.418.0": version "3.418.0" resolved "https://registry.npmjs.org/@aws-sdk/util-format-url/-/util-format-url-3.418.0.tgz#85035e704f5996189aeec2a7bd08265bcd87f1e1" @@ -2732,6 +3104,16 @@ bowser "^2.11.0" tslib "^2.6.2" +"@aws-sdk/util-user-agent-browser@3.567.0": + version "3.567.0" + resolved "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.567.0.tgz#1ef37a87b28155274d62e31c1ac5c1c043dcd0b3" + integrity sha512-cqP0uXtZ7m7hRysf3fRyJwcY1jCgQTpJy7BHB5VpsE7DXlXHD5+Ur5L42CY7UrRPrB6lc6YGFqaAOs5ghMcLyA== + dependencies: + "@aws-sdk/types" "3.567.0" + "@smithy/types" "^2.12.0" + bowser "^2.11.0" + tslib "^2.6.2" + "@aws-sdk/util-user-agent-node@3.418.0": version "3.418.0" resolved "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.418.0.tgz#7d5a1c82ce3265ff0f70b13d58d08593113ab99a" @@ -2762,6 +3144,16 @@ "@smithy/types" "^2.12.0" tslib "^2.6.2" +"@aws-sdk/util-user-agent-node@3.568.0": + version "3.568.0" + resolved "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.568.0.tgz#8bfb81b23d4947462f1e49c70187b85e7cd3837a" + integrity sha512-NVoZoLnKF+eXPBvXg+KqixgJkPSrerR6Gqmbjwqbv14Ini+0KNKB0/MXas1mDGvvEgtNkHI/Cb9zlJ3KXpti2A== + dependencies: + "@aws-sdk/types" "3.567.0" + "@smithy/node-config-provider" "^2.3.0" + "@smithy/types" "^2.12.0" + tslib "^2.6.2" + "@aws-sdk/util-utf8-browser@^3.0.0": version "3.259.0" resolved "https://registry.npmjs.org/@aws-sdk/util-utf8-browser/-/util-utf8-browser-3.259.0.tgz#3275a6f5eb334f96ca76635b961d3c50259fd9ff" @@ -5403,7 +5795,7 @@ "@babel/parser" "^7.1.0" "@babel/types" "^7.0.0" -"@types/babel__traverse@*", "@types/babel__traverse@7.18.2", "@types/babel__traverse@^7.0.6": +"@types/babel__traverse@*", "@types/babel__traverse@^7.0.6": version "7.18.2" resolved "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.18.2.tgz#235bf339d17185bdec25e024ca19cce257cc7309" integrity sha512-FcFaxOr2V5KZCviw1TnutEMVUVsGt4D2hP1TAfXZAMKuHYW3xQhe3jTxNPWutgCJ3/X1c5yX8ZoGVEItxKbwBg== @@ -7059,6 +7451,11 @@ co@^4.6.0: resolved "https://registry.npmjs.org/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" integrity sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ== +code-point-at@^1.0.0: + version "1.1.0" + resolved "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + integrity sha512-RpAVKQA5T63xEj6/giIbUEtZwJ4UFIc3ZtvEkiaUERylqe8xb5IvqcgOurZLahv93CLKfxcw5YI+DZcUBRyLXA== + codemaker@^1.98.0: version "1.98.0" resolved "https://registry.npmjs.org/codemaker/-/codemaker-1.98.0.tgz#cd4f2667c69857162193fe1abbbaad90fe3eed38" @@ -7118,11 +7515,6 @@ color@^3.1.3: color-convert "^1.9.3" color-string "^1.6.0" -colors@1.4.0: - version "1.4.0" - resolved "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78" - integrity sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA== - colorspace@1.1.x: version "1.1.4" resolved "https://registry.npmjs.org/colorspace/-/colorspace-1.1.4.tgz#8d442d1186152f60453bf8070cd66eb364e59243" @@ -8085,6 +8477,11 @@ duplexer@^0.1.1: resolved "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz#3abe43aef3835f8ae077d136ddce0f276b0400e6" integrity sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg== +eastasianwidth@^0.2.0: + version "0.2.0" + resolved "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb" + integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA== + ejs@^3.1.7: version "3.1.10" resolved "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz#69ab8358b14e896f80cc39e62087b88500c3ac3b" @@ -8107,6 +8504,11 @@ emoji-regex@^8.0.0: resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== +emoji-regex@^9.2.2: + version "9.2.2" + resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz#840c8803b0d8047f4ff0cf963176b32d4ef3ed72" + integrity sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg== + enabled@2.0.x: version "2.0.0" resolved "https://registry.npmjs.org/enabled/-/enabled-2.0.0.tgz#f9dd92ec2d6f4bbc0d5d1e64e21d61cd4665e7c2" @@ -8149,16 +8551,16 @@ enquirer@~2.3.6: dependencies: ansi-colors "^4.1.1" +entities@^4.4.0: + version "4.5.0" + resolved "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz#5d268ea5e7113ec74c4d033b79ea5a35a488fb48" + integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw== + entities@~2.0: version "2.0.3" resolved "https://registry.npmjs.org/entities/-/entities-2.0.3.tgz#5c487e5742ab93c15abb5da22759b8590ec03b7f" integrity sha512-MyoZ0jgnLvB2X3Lg5HqpFmn1kybDiIfEQmKzTb5apr51Rb+T3KdmMiqa70T+bhGnyv7bQ6WMj2QMHpGMmlrUYQ== -entities@~2.1.0: - version "2.1.0" - resolved "https://registry.npmjs.org/entities/-/entities-2.1.0.tgz#992d3129cf7df6870b96c57858c249a120f8b8b5" - integrity sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w== - entities@~3.0.1: version "3.0.1" resolved "https://registry.npmjs.org/entities/-/entities-3.0.1.tgz#2b887ca62585e96db3903482d336c1006c3001d4" @@ -9945,6 +10347,13 @@ is-extglob@^2.1.1: resolved "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== +is-fullwidth-code-point@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + integrity sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw== + dependencies: + number-is-nan "^1.0.0" + is-fullwidth-code-point@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" @@ -11326,12 +11735,12 @@ lines-and-columns@~2.0.3: resolved "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-2.0.4.tgz#d00318855905d2660d8c0822e3f5a4715855fc42" integrity sha512-wM1+Z03eypVAVUCE7QdSqpVIvelbOakn1M0bPDoA4SGWPx3sNDVUiMo3L6To6WWGClB7VyXnhQ4Sn7gxiJbE6A== -linkify-it@^3.0.1: - version "3.0.3" - resolved "https://registry.npmjs.org/linkify-it/-/linkify-it-3.0.3.tgz#a98baf44ce45a550efb4d49c769d07524cc2fa2e" - integrity sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ== +linkify-it@^5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/linkify-it/-/linkify-it-5.0.0.tgz#9ef238bfa6dc70bd8e7f9572b52d369af569b421" + integrity sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ== dependencies: - uc.micro "^1.0.1" + uc.micro "^2.0.0" load-json-file@6.2.0, load-json-file@^6.2.0: version "6.2.0" @@ -11658,16 +12067,17 @@ map-obj@^4.0.0: resolved "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz#9304f906e93faae70880da102a9f1df0ea8bb05a" integrity sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ== -markdown-it@14.1.0, markdown-it@^12.3.2: - version "12.3.2" - resolved "https://registry.npmjs.org/markdown-it/-/markdown-it-12.3.2.tgz#bf92ac92283fe983fe4de8ff8abfb5ad72cd0c90" - integrity sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg== +markdown-it@14.1.0: + version "14.1.0" + resolved "https://registry.npmjs.org/markdown-it/-/markdown-it-14.1.0.tgz#3c3c5992883c633db4714ccb4d7b5935d98b7d45" + integrity sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg== dependencies: argparse "^2.0.1" - entities "~2.1.0" - linkify-it "^3.0.1" - mdurl "^1.0.1" - uc.micro "^1.0.5" + entities "^4.4.0" + linkify-it "^5.0.0" + mdurl "^2.0.0" + punycode.js "^2.3.1" + uc.micro "^2.1.0" markdownlint-cli@^0.40.0: version "0.40.0" @@ -11699,7 +12109,12 @@ markdownlint@~0.34.0: markdown-it "14.1.0" markdownlint-micromark "0.1.9" -mdurl@^1.0.1, mdurl@~1.0.1: +mdurl@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/mdurl/-/mdurl-2.0.0.tgz#80676ec0433025dd3e17ee983d0fe8de5a2237e0" + integrity sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w== + +mdurl@~1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e" integrity sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g== @@ -12645,6 +13060,11 @@ npmlog@^6.0.0, npmlog@^6.0.2: gauge "^4.0.3" set-blocking "^2.0.0" +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + integrity sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ== + nx@16.10.0: version "16.10.0" resolved "https://registry.npmjs.org/nx/-/nx-16.10.0.tgz#b070461f7de0a3d7988bd78558ea84cda3543ace" @@ -13618,6 +14038,11 @@ proxy-from-env@^1.1.0: resolved "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== +punycode.js@^2.3.1: + version "2.3.1" + resolved "https://registry.npmjs.org/punycode.js/-/punycode.js-2.3.1.tgz#6b53e56ad75588234e79f4affa90972c7dd8cdb7" + integrity sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA== + punycode@1.3.2: version "1.3.2" resolved "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" @@ -14704,7 +15129,7 @@ string-length@^4.0.1: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.1" -string-width@*, string-width@^1.0.1, "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3, string-width@^5.0.1, string-width@^5.1.2: +string-width@*, "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -14713,6 +15138,24 @@ string-width@*, string-width@^1.0.1, "string-width@^1.0.2 || 2 || 3 || 4", strin is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.1" +string-width@^1.0.1: + version "1.0.2" + resolved "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + integrity sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw== + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + strip-ansi "^3.0.0" + +string-width@^5.0.1, string-width@^5.1.2: + version "5.1.2" + resolved "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794" + integrity sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA== + dependencies: + eastasianwidth "^0.2.0" + emoji-regex "^9.2.2" + strip-ansi "^7.0.1" + string.prototype.repeat@^0.2.0: version "0.2.0" resolved "https://registry.npmjs.org/string.prototype.repeat/-/string.prototype.repeat-0.2.0.tgz#aba36de08dcee6a5a337d49b2ea1da1b28fc0ecf" @@ -14789,7 +15232,7 @@ stringify-package@^1.0.1: dependencies: ansi-regex "^5.0.1" -strip-ansi@^3.0.1: +strip-ansi@^3.0.0, strip-ansi@^3.0.1: version "3.0.1" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" integrity sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg== @@ -15383,10 +15826,10 @@ typescript@~5.1.0: resolved "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz#02f8ac202b6dad2c0dd5e0913745b47a37998274" integrity sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA== -uc.micro@^1.0.1, uc.micro@^1.0.5: - version "1.0.6" - resolved "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz#9c411a802a409a91fc6cf74081baba34b24499ac" - integrity sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA== +uc.micro@^2.0.0, uc.micro@^2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/uc.micro/-/uc.micro-2.1.0.tgz#f8d3f7d0ec4c3dea35a7e3c8efa4cb8b45c9e7ee" + integrity sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A== uglify-js@^3.1.4: version "3.17.4" From 4d7f958575077420d6a935053a4cbf26d35beb89 Mon Sep 17 00:00:00 2001 From: Jakob Berg Date: Wed, 8 May 2024 13:27:25 -0400 Subject: [PATCH 07/11] integ tests --- .../cli-integ/tests/cli-integ-tests/cli.integtest.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/cli.integtest.ts b/packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/cli.integtest.ts index b4b2800c8d6cc..bc5f8be6c412b 100644 --- a/packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/cli.integtest.ts +++ b/packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/cli.integtest.ts @@ -946,7 +946,6 @@ integTest('cdk diff --quiet does not print \'There were no differences\' message })); integTest('cdk diff picks up changes that are only present in changeset', withDefaultFixture(async (fixture) => { - // eslint-disable-next-line no-console const ssmClient = new SSM.SSMClient(); await ssmClient.send(new SSM.PutParameterCommand( { @@ -974,7 +973,6 @@ integTest('cdk diff picks up changes that are only present in changeset', withDe // WHEN const diff = await fixture.cdk(['diff', fixture.fullStackName('queue-name-defined-by-ssm-param')]); - ` Resources [~] AWS::SQS::Queue DiffFromChangeSetQueue DiffFromChangeSetQueue06622C07 replace From f1f0bc76116deb7bd811761545319cd98e9b9a47 Mon Sep 17 00:00:00 2001 From: Jakob Berg Date: Thu, 9 May 2024 11:46:23 -0400 Subject: [PATCH 08/11] made tests better --- .../tests/cli-integ-tests/cli.integtest.ts | 32 +++---- .../test/diff-template.test.ts | 96 +++++++++---------- 2 files changed, 60 insertions(+), 68 deletions(-) diff --git a/packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/cli.integtest.ts b/packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/cli.integtest.ts index bc5f8be6c412b..f9167f4eb9007 100644 --- a/packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/cli.integtest.ts +++ b/packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/cli.integtest.ts @@ -946,6 +946,7 @@ integTest('cdk diff --quiet does not print \'There were no differences\' message })); integTest('cdk diff picks up changes that are only present in changeset', withDefaultFixture(async (fixture) => { + // GIVEN const ssmClient = new SSM.SSMClient(); await ssmClient.send(new SSM.PutParameterCommand( { @@ -956,10 +957,10 @@ integTest('cdk diff picks up changes that are only present in changeset', withDe }, )); - // GIVEN try { await fixture.cdkDeploy('queue-name-defined-by-ssm-param'); + // WHEN // We want to change the ssm value. Then the CFN changeset will detect that the queue will be changed upon deploy. const newRandomValueForSsmParam = Math.floor(Math.random() * 100_000_000_000_001).toString(); await ssmClient.send(new SSM.PutParameterCommand( @@ -970,27 +971,24 @@ integTest('cdk diff picks up changes that are only present in changeset', withDe Overwrite: true, }, )); - - // WHEN const diff = await fixture.cdk(['diff', fixture.fullStackName('queue-name-defined-by-ssm-param')]); - ` + + // THEN + const normalizedPlainTextOutput = diff.replace(/\x1B\[[0-?]*[ -/]*[@-~]/g, '') // remove all color and formatting (bolding, italic, etc) + .replace(/ /g, '') // remove all spaces + .replace(/\n/g, '') // remove all new lines + .replace(/\d+/g, ''); // remove all digits + + const normalizedExpectedOutput = ` Resources [~] AWS::SQS::Queue DiffFromChangeSetQueue DiffFromChangeSetQueue06622C07 replace └─ [~] QueueName (requires replacement) [~] AWS::SSM::Parameter DiffFromChangeSetSSMParam DiffFromChangeSetSSMParam92A9A723 - └─ [~] Value - `; - - // THEN - // the reason these aren't just 1 line is because the terminal output includes colors, which comes up like \u001b[4m\u001b[1mResources\u001b - // which is not very human friendly... - expect(diff).toContain('AWS::SQS::Queue'); - expect(diff).toContain('DiffFromChangeSetQueue'); - expect(diff).toContain('QueueName (requires replacement)'); - expect(diff).toContain('AWS::SSM::Parameter'); - expect(diff).toContain('DiffFromChangeSetSSMParam'); - expect(diff).toContain('Value'); - expect(diff).toContain('Number of stacks with differences: 1'); + └─ [~] Value` + .replace(/ /g, '') + .replace(/\n/g, '') + .replace(/\d+/g, ''); + expect(normalizedPlainTextOutput).toContain(normalizedExpectedOutput); } finally { await fixture.cdkDestroy('queue-name-defined-by-ssm-param'); } diff --git a/packages/@aws-cdk/cloudformation-diff/test/diff-template.test.ts b/packages/@aws-cdk/cloudformation-diff/test/diff-template.test.ts index 41511f6b160e7..ed5359ac3f28d 100644 --- a/packages/@aws-cdk/cloudformation-diff/test/diff-template.test.ts +++ b/packages/@aws-cdk/cloudformation-diff/test/diff-template.test.ts @@ -1255,12 +1255,8 @@ describe('changeset', () => { }, }; - // Template diff misses the change: + // WHEN const diffWithoutChangeSet = fullDiff(currentTemplate, currentTemplate); - // THEN - expect(diffWithoutChangeSet.differenceCount).toBe(0); - expect(diffWithoutChangeSet.resources.changes).toEqual({}); - // AND THEN const diffWithChangeSet = fullDiff(currentTemplate, currentTemplate, { Changes: [ @@ -1290,6 +1286,9 @@ describe('changeset', () => { ); // THEN + expect(diffWithoutChangeSet.differenceCount).toBe(0); + expect(diffWithoutChangeSet.resources.changes).toEqual({}); + expect(diffWithChangeSet.differenceCount).toBe(1); expect(diffWithChangeSet.resources.changes).toEqual( { @@ -1376,13 +1375,8 @@ describe('changeset', () => { }, }; - // Template diff misses the change: + // WHEN const diffWithoutChangeSet = fullDiff(currentTemplate, currentTemplate); - // THEN - expect(diffWithoutChangeSet.differenceCount).toBe(0); - expect(diffWithoutChangeSet.resources.changes).toEqual({}); - - // AND THEN const diffWithChangeSet = fullDiff(currentTemplate, currentTemplate, { Changes: [ @@ -1410,10 +1404,12 @@ describe('changeset', () => { ResolvedValue: 'changedVal', }], }, - ); // THEN + expect(diffWithoutChangeSet.differenceCount).toBe(0); + expect(diffWithoutChangeSet.resources.changes).toEqual({}); + expect(diffWithChangeSet.differenceCount).toBe(1); expect(diffWithChangeSet.resources.changes).toEqual( { @@ -1523,8 +1519,44 @@ describe('changeset', () => { }, }; - // Template diff misses the change: + // WHEN const diffWithoutChangeSet = fullDiff(currentTemplate, newTemplate); + const diffWithChangeSet = fullDiff(currentTemplate, newTemplate, + { + Changes: [ + { + Type: 'Resource', + ResourceChange: { + PolicyAction: 'ReplaceAndDelete', + Action: 'Modify', + LogicalResourceId: 'Queue', + PhysicalResourceId: 'https://sqs.us-east-1.amazonaws.com/012345678901/newValueNEEEWWWEEERRRRR', + ResourceType: 'AWS::SQS::Queue', + Replacement: 'True', + Scope: [ + 'Properties', + ], + Details: [{ + Target: { Attribute: 'Properties', Name: 'QueueName', RequiresRecreation: 'Always' }, + Evaluation: 'Static', + ChangeSource: 'DirectModification', + }, + { + Target: { Attribute: 'Properties', Name: 'ReceiveMessageWaitTimeSeconds', RequiresRecreation: 'Never' }, + Evaluation: 'Static', + ChangeSource: 'DirectModification', + }], + }, + }, + ], + Parameters: [{ + ParameterKey: 'SsmParameterValuetestbugreportC9', + ParameterValue: 'goodJob', + ResolvedValue: 'changedddd', + }], + }, + ); + // THEN expect(diffWithoutChangeSet.differenceCount).toBe(1); expect(diffWithoutChangeSet.resources.changes).toEqual( @@ -1616,44 +1648,6 @@ describe('changeset', () => { }, ); - // AND THEN - const diffWithChangeSet = fullDiff(currentTemplate, newTemplate, - { - Changes: [ - { - Type: 'Resource', - ResourceChange: { - PolicyAction: 'ReplaceAndDelete', - Action: 'Modify', - LogicalResourceId: 'Queue', - PhysicalResourceId: 'https://sqs.us-east-1.amazonaws.com/012345678901/newValueNEEEWWWEEERRRRR', - ResourceType: 'AWS::SQS::Queue', - Replacement: 'True', - Scope: [ - 'Properties', - ], - Details: [{ - Target: { Attribute: 'Properties', Name: 'QueueName', RequiresRecreation: 'Always' }, - Evaluation: 'Static', - ChangeSource: 'DirectModification', - }, - { - Target: { Attribute: 'Properties', Name: 'ReceiveMessageWaitTimeSeconds', RequiresRecreation: 'Never' }, - Evaluation: 'Static', - ChangeSource: 'DirectModification', - }], - }, - }, - ], - Parameters: [{ - ParameterKey: 'SsmParameterValuetestbugreportC9', - ParameterValue: 'goodJob', - ResolvedValue: 'changedddd', - }], - }, - ); - - // THEN expect(diffWithChangeSet.differenceCount).toBe(1); // this is the count of how many resources have changed expect(diffWithChangeSet.resources.get('Queue').propertyUpdates).toEqual( { From 8e7737bac42391d23b0057d84c7e93c8a4b07868 Mon Sep 17 00:00:00 2001 From: Jakob Berg Date: Thu, 9 May 2024 12:21:50 -0400 Subject: [PATCH 09/11] implemented code suggestions --- .../cloudformation-diff/lib/diff-template.ts | 162 +++++++++--------- 1 file changed, 84 insertions(+), 78 deletions(-) diff --git a/packages/@aws-cdk/cloudformation-diff/lib/diff-template.ts b/packages/@aws-cdk/cloudformation-diff/lib/diff-template.ts index 81b88115f6437..025a707b62386 100644 --- a/packages/@aws-cdk/cloudformation-diff/lib/diff-template.ts +++ b/packages/@aws-cdk/cloudformation-diff/lib/diff-template.ts @@ -223,69 +223,102 @@ function makeAllResourceChangesImports(diff: types.TemplateDiff) { } function refineDiffWithChangeSet(diff: types.TemplateDiff, changeSet: DescribeChangeSetOutput, newTemplateResources: {[logicalId: string]: any}) { - const replacements = findResourceReplacements(changeSet); - - // Add resources and properties that aren't in the template diff but that ARE in the changeset diff - const resourceDiffLogicalIds = diff.resources.logicalIds; - for (const logicalId of Object.keys(replacements)) { - if (!(resourceDiffLogicalIds.includes(logicalId))) { - const noChangeResourceDiff = impl.diffResource(newTemplateResources[logicalId], newTemplateResources[logicalId]); - diff.resources.add(logicalId, noChangeResourceDiff); + const replacements = _findResourceReplacements(changeSet); + + _addChangeSetResourcesToDiff(replacements, newTemplateResources); + _enhanceChangeImpacts(replacements); + return; + + function _findResourceReplacements(_changeSet: DescribeChangeSetOutput): types.ResourceReplacements { + const _replacements: types.ResourceReplacements = {}; + for (const resourceChange of _changeSet.Changes ?? []) { + const propertiesReplaced: { [propName: string]: types.ChangeSetReplacement } = {}; + for (const propertyChange of resourceChange.ResourceChange?.Details ?? []) { + if (propertyChange.Target?.Attribute === 'Properties') { + const requiresReplacement = propertyChange.Target.RequiresRecreation === 'Always'; + if (requiresReplacement && propertyChange.Evaluation === 'Static') { + propertiesReplaced[propertyChange.Target.Name!] = 'Always'; + } else if (requiresReplacement && propertyChange.Evaluation === 'Dynamic') { + // If Evaluation is 'Dynamic', then this may cause replacement, or it may not. + // see 'Replacement': https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ResourceChange.html + propertiesReplaced[propertyChange.Target.Name!] = 'Conditionally'; + } else { + propertiesReplaced[propertyChange.Target.Name!] = propertyChange.Target.RequiresRecreation as types.ChangeSetReplacement; + } + } + } + _replacements[resourceChange.ResourceChange?.LogicalResourceId!] = { + resourceReplaced: resourceChange.ResourceChange?.Replacement === 'True', + propertiesReplaced, + }; } - for (const propertyName of Object.keys(replacements[logicalId].propertiesReplaced)) { - if (propertyName in diff.resources.get(logicalId).propertyUpdates) { - // If the property is already marked to be updated, then we don't need to do anything. - continue; + return _replacements; + } + + function _addChangeSetResourcesToDiff(_replacements: types.ResourceReplacements, _newTemplateResources: {[logicalId: string]: any}) { + const resourceDiffLogicalIds = diff.resources.logicalIds; + for (const logicalId of Object.keys(_replacements)) { + if (!(resourceDiffLogicalIds.includes(logicalId))) { + const noChangeResourceDiff = impl.diffResource(_newTemplateResources[logicalId], _newTemplateResources[logicalId]); + diff.resources.add(logicalId, noChangeResourceDiff); } - const newProp = new types.PropertyDifference( + for (const propertyName of Object.keys(_replacements[logicalId].propertiesReplaced)) { + if (propertyName in diff.resources.get(logicalId).propertyUpdates) { + // If the property is already marked to be updated, then we don't need to do anything. + continue; + } + + const newProp = new types.PropertyDifference( // these fields will be decided below - {}, {}, { changeImpact: undefined }, - ); - newProp.isDifferent = true; - diff.resources.get(logicalId).setPropertyChange(propertyName, newProp); - } - }; + {}, {}, { changeImpact: undefined }, + ); + newProp.isDifferent = true; + diff.resources.get(logicalId).setPropertyChange(propertyName, newProp); + } + }; + } - // Now use the changeset diff to make property changeImpact more accurate. - diff.resources.forEachDifference((logicalId: string, change: types.ResourceDifference) => { - if (change.resourceType.includes('AWS::Serverless')) { + function _enhanceChangeImpacts(_replacements: types.ResourceReplacements) { + diff.resources.forEachDifference((logicalId: string, change: types.ResourceDifference) => { + if (change.resourceType.includes('AWS::Serverless')) { // CFN applies the SAM transform before creating the changeset, so the changeset contains no information about SAM resources - return; - } - change.forEachDifference((type: 'Property' | 'Other', name: string, value: types.Difference | types.PropertyDifference) => { - if (type === 'Property') { - if (!replacements[logicalId]) { - (value as types.PropertyDifference).changeImpact = types.ResourceImpact.NO_CHANGE; - (value as types.PropertyDifference).isDifferent = false; - return; - } - switch (replacements[logicalId].propertiesReplaced[name]) { - case 'Always': - (value as types.PropertyDifference).changeImpact = types.ResourceImpact.WILL_REPLACE; - break; - case 'Never': - (value as types.PropertyDifference).changeImpact = types.ResourceImpact.WILL_UPDATE; - break; - case 'Conditionally': - (value as types.PropertyDifference).changeImpact = types.ResourceImpact.MAY_REPLACE; - break; - case undefined: + return; + } + change.forEachDifference((type: 'Property' | 'Other', name: string, value: types.Difference | types.PropertyDifference) => { + if (type === 'Property') { + if (!_replacements[logicalId]) { (value as types.PropertyDifference).changeImpact = types.ResourceImpact.NO_CHANGE; (value as types.PropertyDifference).isDifferent = false; - break; + return; + } + switch (_replacements[logicalId].propertiesReplaced[name]) { + case 'Always': + (value as types.PropertyDifference).changeImpact = types.ResourceImpact.WILL_REPLACE; + break; + case 'Never': + (value as types.PropertyDifference).changeImpact = types.ResourceImpact.WILL_UPDATE; + break; + case 'Conditionally': + (value as types.PropertyDifference).changeImpact = types.ResourceImpact.MAY_REPLACE; + break; + case undefined: + (value as types.PropertyDifference).changeImpact = types.ResourceImpact.NO_CHANGE; + (value as types.PropertyDifference).isDifferent = false; + break; // otherwise, defer to the changeImpact from `diffTemplate` + } + } else if (type === 'Other') { + switch (name) { + case 'Metadata': + change.setOtherChange('Metadata', new types.Difference(value.newValue, value.newValue)); + break; + } } - } else if (type === 'Other') { - switch (name) { - case 'Metadata': - change.setOtherChange('Metadata', new types.Difference(value.newValue, value.newValue)); - break; - } - } + }); }); - }); + } } function findResourceImports(changeSet: DescribeChangeSetOutput): string[] { @@ -299,33 +332,6 @@ function findResourceImports(changeSet: DescribeChangeSetOutput): string[] { return importedResourceLogicalIds; } -function findResourceReplacements(changeSet: DescribeChangeSetOutput): types.ResourceReplacements { - const replacements: types.ResourceReplacements = {}; - for (const resourceChange of changeSet.Changes ?? []) { - const propertiesReplaced: { [propName: string]: types.ChangeSetReplacement } = {}; - for (const propertyChange of resourceChange.ResourceChange?.Details ?? []) { - if (propertyChange.Target?.Attribute === 'Properties') { - const requiresReplacement = propertyChange.Target.RequiresRecreation === 'Always'; - if (requiresReplacement && propertyChange.Evaluation === 'Static') { - propertiesReplaced[propertyChange.Target.Name!] = 'Always'; - } else if (requiresReplacement && propertyChange.Evaluation === 'Dynamic') { - // If Evaluation is 'Dynamic', then this may cause replacement, or it may not. - // see 'Replacement': https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ResourceChange.html - propertiesReplaced[propertyChange.Target.Name!] = 'Conditionally'; - } else { - propertiesReplaced[propertyChange.Target.Name!] = propertyChange.Target.RequiresRecreation as types.ChangeSetReplacement; - } - } - } - replacements[resourceChange.ResourceChange?.LogicalResourceId!] = { - resourceReplaced: resourceChange.ResourceChange?.Replacement === 'True', - propertiesReplaced, - }; - } - - return replacements; -} - function normalize(template: any) { if (typeof template === 'object') { for (const key of (Object.keys(template ?? {}))) { From 0dad15887cc270e4f713b2b3cf1f47764d58e50c Mon Sep 17 00:00:00 2001 From: Jakob Berg Date: Fri, 10 May 2024 10:19:52 -0400 Subject: [PATCH 10/11] use fixture.aws --- .../@aws-cdk-testing/cli-integ/lib/aws.ts | 2 + .../@aws-cdk-testing/cli-integ/package.json | 1 - .../tests/cli-integ-tests/cli.integtest.ts | 34 +- yarn.lock | 505 ++---------------- 4 files changed, 47 insertions(+), 495 deletions(-) diff --git a/packages/@aws-cdk-testing/cli-integ/lib/aws.ts b/packages/@aws-cdk-testing/cli-integ/lib/aws.ts index bcf19f4a47e3f..cd06cad3b5e94 100644 --- a/packages/@aws-cdk-testing/cli-integ/lib/aws.ts +++ b/packages/@aws-cdk-testing/cli-integ/lib/aws.ts @@ -20,6 +20,7 @@ export class AwsClients { public readonly ecr: AwsCaller; public readonly ecs: AwsCaller; public readonly sso: AwsCaller; + public readonly ssm: AwsCaller; public readonly sns: AwsCaller; public readonly iam: AwsCaller; public readonly lambda: AwsCaller; @@ -39,6 +40,7 @@ export class AwsClients { this.ecs = makeAwsCaller(AWS.ECS, this.config); this.sso = makeAwsCaller(AWS.SSO, this.config); this.sns = makeAwsCaller(AWS.SNS, this.config); + this.ssm = makeAwsCaller(AWS.SSM, this.config); this.iam = makeAwsCaller(AWS.IAM, this.config); this.lambda = makeAwsCaller(AWS.Lambda, this.config); this.sts = makeAwsCaller(AWS.STS, this.config); diff --git a/packages/@aws-cdk-testing/cli-integ/package.json b/packages/@aws-cdk-testing/cli-integ/package.json index 31d04fe76dd7d..28a49bf5f0c0c 100644 --- a/packages/@aws-cdk-testing/cli-integ/package.json +++ b/packages/@aws-cdk-testing/cli-integ/package.json @@ -38,7 +38,6 @@ "@types/yargs": "^15.0.19" }, "dependencies": { - "@aws-sdk/client-ssm": "^3.569.0", "@octokit/rest": "^18.12.0", "aws-sdk": "^2.1610.0", "axios": "^1.6.8", diff --git a/packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/cli.integtest.ts b/packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/cli.integtest.ts index f9167f4eb9007..9fea9abc0d0b8 100644 --- a/packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/cli.integtest.ts +++ b/packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/cli.integtest.ts @@ -1,8 +1,7 @@ import { promises as fs, existsSync } from 'fs'; import * as os from 'os'; import * as path from 'path'; -import * as SSM from '@aws-sdk/client-ssm'; -import { integTest, cloneDirectory, shell, withDefaultFixture, retry, sleep, randomInteger, withSamIntegrationFixture, RESOURCES_DIR, withCDKMigrateFixture, withExtendedTimeoutFixture } from '../../lib'; +import { integTest, cloneDirectory, shell, withDefaultFixture, retry, sleep, randomInteger, withSamIntegrationFixture, RESOURCES_DIR, withCDKMigrateFixture, withExtendedTimeoutFixture, randomString } from '../../lib'; jest.setTimeout(2 * 60 * 60_000); // Includes the time to acquire locks, worst-case single-threaded runtime @@ -947,30 +946,25 @@ integTest('cdk diff --quiet does not print \'There were no differences\' message integTest('cdk diff picks up changes that are only present in changeset', withDefaultFixture(async (fixture) => { // GIVEN - const ssmClient = new SSM.SSMClient(); - await ssmClient.send(new SSM.PutParameterCommand( - { - Name: 'for-queue-name-defined-by-ssm-param', - Value: Math.floor(Math.random() * 100_000_000_000_001).toString(), - Overwrite: true, - Type: 'String', - }, - )); + await fixture.aws.ssm('putParameter', { + Name: 'for-queue-name-defined-by-ssm-param', + Value: randomString(), + Type: 'String', + Overwrite: true, + }); try { await fixture.cdkDeploy('queue-name-defined-by-ssm-param'); // WHEN // We want to change the ssm value. Then the CFN changeset will detect that the queue will be changed upon deploy. - const newRandomValueForSsmParam = Math.floor(Math.random() * 100_000_000_000_001).toString(); - await ssmClient.send(new SSM.PutParameterCommand( - { - Name: 'for-queue-name-defined-by-ssm-param', - Value: newRandomValueForSsmParam, - Type: 'String', - Overwrite: true, - }, - )); + await fixture.aws.ssm('putParameter', { + Name: 'for-queue-name-defined-by-ssm-param', + Value: randomString(), + Type: 'String', + Overwrite: true, + }); + const diff = await fixture.cdk(['diff', fixture.fullStackName('queue-name-defined-by-ssm-param')]); // THEN diff --git a/yarn.lock b/yarn.lock index 25b968db9994b..8b4c5897c2b27 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1529,101 +1529,6 @@ tslib "^2.5.0" uuid "^8.3.2" -"@aws-sdk/client-ssm@^3.569.0": - version "3.569.0" - resolved "https://registry.npmjs.org/@aws-sdk/client-ssm/-/client-ssm-3.569.0.tgz#c30e197ee1ed21cfe3007f8dc38bce7dc0c73566" - integrity sha512-SO/R0QxjApOC/Jvlx421JJjtCsApxSI+029IcVXTeaIWyNHlXtSTS3+E2NOap9s1YWCa5JCCceXEunoqeMM0XA== - dependencies: - "@aws-crypto/sha256-browser" "3.0.0" - "@aws-crypto/sha256-js" "3.0.0" - "@aws-sdk/client-sso-oidc" "3.569.0" - "@aws-sdk/client-sts" "3.569.0" - "@aws-sdk/core" "3.567.0" - "@aws-sdk/credential-provider-node" "3.569.0" - "@aws-sdk/middleware-host-header" "3.567.0" - "@aws-sdk/middleware-logger" "3.568.0" - "@aws-sdk/middleware-recursion-detection" "3.567.0" - "@aws-sdk/middleware-user-agent" "3.567.0" - "@aws-sdk/region-config-resolver" "3.567.0" - "@aws-sdk/types" "3.567.0" - "@aws-sdk/util-endpoints" "3.567.0" - "@aws-sdk/util-user-agent-browser" "3.567.0" - "@aws-sdk/util-user-agent-node" "3.568.0" - "@smithy/config-resolver" "^2.2.0" - "@smithy/core" "^1.4.2" - "@smithy/fetch-http-handler" "^2.5.0" - "@smithy/hash-node" "^2.2.0" - "@smithy/invalid-dependency" "^2.2.0" - "@smithy/middleware-content-length" "^2.2.0" - "@smithy/middleware-endpoint" "^2.5.1" - "@smithy/middleware-retry" "^2.3.1" - "@smithy/middleware-serde" "^2.3.0" - "@smithy/middleware-stack" "^2.2.0" - "@smithy/node-config-provider" "^2.3.0" - "@smithy/node-http-handler" "^2.5.0" - "@smithy/protocol-http" "^3.3.0" - "@smithy/smithy-client" "^2.5.1" - "@smithy/types" "^2.12.0" - "@smithy/url-parser" "^2.2.0" - "@smithy/util-base64" "^2.3.0" - "@smithy/util-body-length-browser" "^2.2.0" - "@smithy/util-body-length-node" "^2.3.0" - "@smithy/util-defaults-mode-browser" "^2.2.1" - "@smithy/util-defaults-mode-node" "^2.3.1" - "@smithy/util-endpoints" "^1.2.0" - "@smithy/util-middleware" "^2.2.0" - "@smithy/util-retry" "^2.2.0" - "@smithy/util-utf8" "^2.3.0" - "@smithy/util-waiter" "^2.2.0" - tslib "^2.6.2" - uuid "^9.0.1" - -"@aws-sdk/client-sso-oidc@3.569.0": - version "3.569.0" - resolved "https://registry.npmjs.org/@aws-sdk/client-sso-oidc/-/client-sso-oidc-3.569.0.tgz#4dc90be9a35119238112455f8d9080b2ccdf0e24" - integrity sha512-u5DEjNEvRvlKKh1QLCDuQ8GIrx+OFvJFLfhorsp4oCxDylvORs+KfyKKnJAw4wYEEHyxyz9GzHD7p6a8+HLVHw== - dependencies: - "@aws-crypto/sha256-browser" "3.0.0" - "@aws-crypto/sha256-js" "3.0.0" - "@aws-sdk/client-sts" "3.569.0" - "@aws-sdk/core" "3.567.0" - "@aws-sdk/credential-provider-node" "3.569.0" - "@aws-sdk/middleware-host-header" "3.567.0" - "@aws-sdk/middleware-logger" "3.568.0" - "@aws-sdk/middleware-recursion-detection" "3.567.0" - "@aws-sdk/middleware-user-agent" "3.567.0" - "@aws-sdk/region-config-resolver" "3.567.0" - "@aws-sdk/types" "3.567.0" - "@aws-sdk/util-endpoints" "3.567.0" - "@aws-sdk/util-user-agent-browser" "3.567.0" - "@aws-sdk/util-user-agent-node" "3.568.0" - "@smithy/config-resolver" "^2.2.0" - "@smithy/core" "^1.4.2" - "@smithy/fetch-http-handler" "^2.5.0" - "@smithy/hash-node" "^2.2.0" - "@smithy/invalid-dependency" "^2.2.0" - "@smithy/middleware-content-length" "^2.2.0" - "@smithy/middleware-endpoint" "^2.5.1" - "@smithy/middleware-retry" "^2.3.1" - "@smithy/middleware-serde" "^2.3.0" - "@smithy/middleware-stack" "^2.2.0" - "@smithy/node-config-provider" "^2.3.0" - "@smithy/node-http-handler" "^2.5.0" - "@smithy/protocol-http" "^3.3.0" - "@smithy/smithy-client" "^2.5.1" - "@smithy/types" "^2.12.0" - "@smithy/url-parser" "^2.2.0" - "@smithy/util-base64" "^2.3.0" - "@smithy/util-body-length-browser" "^2.2.0" - "@smithy/util-body-length-node" "^2.3.0" - "@smithy/util-defaults-mode-browser" "^2.2.1" - "@smithy/util-defaults-mode-node" "^2.3.1" - "@smithy/util-endpoints" "^1.2.0" - "@smithy/util-middleware" "^2.2.0" - "@smithy/util-retry" "^2.2.0" - "@smithy/util-utf8" "^2.3.0" - tslib "^2.6.2" - "@aws-sdk/client-sso@3.421.0": version "3.421.0" resolved "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.421.0.tgz#794350d63bd6b327f4919460ae908a1a39585165" @@ -1750,50 +1655,6 @@ "@smithy/util-utf8" "^2.3.0" tslib "^2.6.2" -"@aws-sdk/client-sso@3.568.0": - version "3.568.0" - resolved "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.568.0.tgz#4e06fa9c052931641921a0a723f58f81513c673c" - integrity sha512-LSD7k0ZBQNWouTN5dYpUkeestoQ+r5u6cp6o+FATKeiFQET85RNA3xJ4WPnOI5rBC1PETKhQXvF44863P3hCaQ== - dependencies: - "@aws-crypto/sha256-browser" "3.0.0" - "@aws-crypto/sha256-js" "3.0.0" - "@aws-sdk/core" "3.567.0" - "@aws-sdk/middleware-host-header" "3.567.0" - "@aws-sdk/middleware-logger" "3.568.0" - "@aws-sdk/middleware-recursion-detection" "3.567.0" - "@aws-sdk/middleware-user-agent" "3.567.0" - "@aws-sdk/region-config-resolver" "3.567.0" - "@aws-sdk/types" "3.567.0" - "@aws-sdk/util-endpoints" "3.567.0" - "@aws-sdk/util-user-agent-browser" "3.567.0" - "@aws-sdk/util-user-agent-node" "3.568.0" - "@smithy/config-resolver" "^2.2.0" - "@smithy/core" "^1.4.2" - "@smithy/fetch-http-handler" "^2.5.0" - "@smithy/hash-node" "^2.2.0" - "@smithy/invalid-dependency" "^2.2.0" - "@smithy/middleware-content-length" "^2.2.0" - "@smithy/middleware-endpoint" "^2.5.1" - "@smithy/middleware-retry" "^2.3.1" - "@smithy/middleware-serde" "^2.3.0" - "@smithy/middleware-stack" "^2.2.0" - "@smithy/node-config-provider" "^2.3.0" - "@smithy/node-http-handler" "^2.5.0" - "@smithy/protocol-http" "^3.3.0" - "@smithy/smithy-client" "^2.5.1" - "@smithy/types" "^2.12.0" - "@smithy/url-parser" "^2.2.0" - "@smithy/util-base64" "^2.3.0" - "@smithy/util-body-length-browser" "^2.2.0" - "@smithy/util-body-length-node" "^2.3.0" - "@smithy/util-defaults-mode-browser" "^2.2.1" - "@smithy/util-defaults-mode-node" "^2.3.1" - "@smithy/util-endpoints" "^1.2.0" - "@smithy/util-middleware" "^2.2.0" - "@smithy/util-retry" "^2.2.0" - "@smithy/util-utf8" "^2.3.0" - tslib "^2.6.2" - "@aws-sdk/client-sts@3.421.0": version "3.421.0" resolved "https://registry.npmjs.org/@aws-sdk/client-sts/-/client-sts-3.421.0.tgz#1c7b3265be3acb609159533c24421da4e9466570" @@ -1884,52 +1745,6 @@ fast-xml-parser "4.2.5" tslib "^2.5.0" -"@aws-sdk/client-sts@3.569.0": - version "3.569.0" - resolved "https://registry.npmjs.org/@aws-sdk/client-sts/-/client-sts-3.569.0.tgz#dc2e0e791081c37dede1b58a2057c26488fcddbf" - integrity sha512-3AyipQ2zHszkcTr8n1Sp7CiMUi28aMf1vOhEo0KKi0DWGo1Z1qJEpWeRP363KG0n9/8U3p1IkXGz5FRbpXZxIw== - dependencies: - "@aws-crypto/sha256-browser" "3.0.0" - "@aws-crypto/sha256-js" "3.0.0" - "@aws-sdk/client-sso-oidc" "3.569.0" - "@aws-sdk/core" "3.567.0" - "@aws-sdk/credential-provider-node" "3.569.0" - "@aws-sdk/middleware-host-header" "3.567.0" - "@aws-sdk/middleware-logger" "3.568.0" - "@aws-sdk/middleware-recursion-detection" "3.567.0" - "@aws-sdk/middleware-user-agent" "3.567.0" - "@aws-sdk/region-config-resolver" "3.567.0" - "@aws-sdk/types" "3.567.0" - "@aws-sdk/util-endpoints" "3.567.0" - "@aws-sdk/util-user-agent-browser" "3.567.0" - "@aws-sdk/util-user-agent-node" "3.568.0" - "@smithy/config-resolver" "^2.2.0" - "@smithy/core" "^1.4.2" - "@smithy/fetch-http-handler" "^2.5.0" - "@smithy/hash-node" "^2.2.0" - "@smithy/invalid-dependency" "^2.2.0" - "@smithy/middleware-content-length" "^2.2.0" - "@smithy/middleware-endpoint" "^2.5.1" - "@smithy/middleware-retry" "^2.3.1" - "@smithy/middleware-serde" "^2.3.0" - "@smithy/middleware-stack" "^2.2.0" - "@smithy/node-config-provider" "^2.3.0" - "@smithy/node-http-handler" "^2.5.0" - "@smithy/protocol-http" "^3.3.0" - "@smithy/smithy-client" "^2.5.1" - "@smithy/types" "^2.12.0" - "@smithy/url-parser" "^2.2.0" - "@smithy/util-base64" "^2.3.0" - "@smithy/util-body-length-browser" "^2.2.0" - "@smithy/util-body-length-node" "^2.3.0" - "@smithy/util-defaults-mode-browser" "^2.2.1" - "@smithy/util-defaults-mode-node" "^2.3.1" - "@smithy/util-endpoints" "^1.2.0" - "@smithy/util-middleware" "^2.2.0" - "@smithy/util-retry" "^2.2.0" - "@smithy/util-utf8" "^2.3.0" - tslib "^2.6.2" - "@aws-sdk/client-synthetics@3.421.0": version "3.421.0" resolved "https://registry.npmjs.org/@aws-sdk/client-synthetics/-/client-synthetics-3.421.0.tgz#fbc848916f51255d883c1b3b5240f8975842daba" @@ -1994,19 +1809,6 @@ fast-xml-parser "4.2.5" tslib "^2.6.2" -"@aws-sdk/core@3.567.0": - version "3.567.0" - resolved "https://registry.npmjs.org/@aws-sdk/core/-/core-3.567.0.tgz#f0b93ba1541dcc179438fb8d80b2a80ec865b623" - integrity sha512-zUDEQhC7blOx6sxhHdT75x98+SXQVdUIMu8z8AjqMWiYK2v4WkOS8i6dOS4E5OjL5J1Ac+ruy8op/Bk4AFqSIw== - dependencies: - "@smithy/core" "^1.4.2" - "@smithy/protocol-http" "^3.3.0" - "@smithy/signature-v4" "^2.3.0" - "@smithy/smithy-client" "^2.5.1" - "@smithy/types" "^2.12.0" - fast-xml-parser "4.2.5" - tslib "^2.6.2" - "@aws-sdk/credential-provider-cognito-identity@3.421.0": version "3.421.0" resolved "https://registry.npmjs.org/@aws-sdk/credential-provider-cognito-identity/-/credential-provider-cognito-identity-3.421.0.tgz#d06bf11df56896feb048e057b02e98b1870bd388" @@ -2048,16 +1850,6 @@ "@smithy/types" "^2.12.0" tslib "^2.6.2" -"@aws-sdk/credential-provider-env@3.568.0": - version "3.568.0" - resolved "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.568.0.tgz#fc7fda0bc48bbc75065a9084e41d429037e0e1c5" - integrity sha512-MVTQoZwPnP1Ev5A7LG+KzeU6sCB8BcGkZeDT1z1V5Wt7GPq0MgFQTSSjhImnB9jqRSZkl1079Bt3PbO6lfIS8g== - dependencies: - "@aws-sdk/types" "3.567.0" - "@smithy/property-provider" "^2.2.0" - "@smithy/types" "^2.12.0" - tslib "^2.6.2" - "@aws-sdk/credential-provider-http@3.552.0": version "3.552.0" resolved "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.552.0.tgz#ecc88d02cba95621887e6b85b2583e756ad29eb6" @@ -2073,21 +1865,6 @@ "@smithy/util-stream" "^2.2.0" tslib "^2.6.2" -"@aws-sdk/credential-provider-http@3.568.0": - version "3.568.0" - resolved "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.568.0.tgz#7f7239bed7c23db7356ebeae5f3b3bda9f751b08" - integrity sha512-gL0NlyI2eW17hnCrh45hZV+qjtBquB+Bckiip9R6DIVRKqYcoILyiFhuOgf2bXeF23gVh6j18pvUvIoTaFWs5w== - dependencies: - "@aws-sdk/types" "3.567.0" - "@smithy/fetch-http-handler" "^2.5.0" - "@smithy/node-http-handler" "^2.5.0" - "@smithy/property-provider" "^2.2.0" - "@smithy/protocol-http" "^3.3.0" - "@smithy/smithy-client" "^2.5.1" - "@smithy/types" "^2.12.0" - "@smithy/util-stream" "^2.2.0" - tslib "^2.6.2" - "@aws-sdk/credential-provider-ini@3.421.0": version "3.421.0" resolved "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.421.0.tgz#b58f8fd095c4389926d0e53ed2b775b184d03ec2" @@ -2136,22 +1913,6 @@ "@smithy/types" "^2.12.0" tslib "^2.6.2" -"@aws-sdk/credential-provider-ini@3.568.0": - version "3.568.0" - resolved "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.568.0.tgz#3ed29a48fb2f9f44f614d268f3f5a70daf22ba85" - integrity sha512-m5DUN9mpto5DhEvo6w3+8SS6q932ja37rTNvpPqWJIaWhj7OorAwVirSaJQAQB/M8+XCUIrUonxytphZB28qGQ== - dependencies: - "@aws-sdk/credential-provider-env" "3.568.0" - "@aws-sdk/credential-provider-process" "3.568.0" - "@aws-sdk/credential-provider-sso" "3.568.0" - "@aws-sdk/credential-provider-web-identity" "3.568.0" - "@aws-sdk/types" "3.567.0" - "@smithy/credential-provider-imds" "^2.3.0" - "@smithy/property-provider" "^2.2.0" - "@smithy/shared-ini-file-loader" "^2.4.0" - "@smithy/types" "^2.12.0" - tslib "^2.6.2" - "@aws-sdk/credential-provider-node@3.421.0": version "3.421.0" resolved "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.421.0.tgz#3d1793ee47d0335532eb01a23cbb7d5320dd3056" @@ -2204,24 +1965,6 @@ "@smithy/types" "^2.12.0" tslib "^2.6.2" -"@aws-sdk/credential-provider-node@3.569.0": - version "3.569.0" - resolved "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.569.0.tgz#714f3c3ccb4cec717f02535edde7c5eeb8bb8828" - integrity sha512-7jH4X2qlPU3PszZP1zvHJorhLARbU1tXvp8ngBe8ArXBrkFpl/dQ2Y/IRAICPm/pyC1IEt8L/CvKp+dz7v/eRw== - dependencies: - "@aws-sdk/credential-provider-env" "3.568.0" - "@aws-sdk/credential-provider-http" "3.568.0" - "@aws-sdk/credential-provider-ini" "3.568.0" - "@aws-sdk/credential-provider-process" "3.568.0" - "@aws-sdk/credential-provider-sso" "3.568.0" - "@aws-sdk/credential-provider-web-identity" "3.568.0" - "@aws-sdk/types" "3.567.0" - "@smithy/credential-provider-imds" "^2.3.0" - "@smithy/property-provider" "^2.2.0" - "@smithy/shared-ini-file-loader" "^2.4.0" - "@smithy/types" "^2.12.0" - tslib "^2.6.2" - "@aws-sdk/credential-provider-process@3.418.0": version "3.418.0" resolved "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.418.0.tgz#1cb6d816bd471db3f9724715b007035ef18b5b2b" @@ -2255,17 +1998,6 @@ "@smithy/types" "^2.12.0" tslib "^2.6.2" -"@aws-sdk/credential-provider-process@3.568.0": - version "3.568.0" - resolved "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.568.0.tgz#9c6202d64bd9bead77dc10fb6b61b2a64c819749" - integrity sha512-r01zbXbanP17D+bQUb7mD8Iu2SuayrrYZ0Slgvx32qgz47msocV9EPCSwI4Hkw2ZtEPCeLQR4XCqFJB1D9P50w== - dependencies: - "@aws-sdk/types" "3.567.0" - "@smithy/property-provider" "^2.2.0" - "@smithy/shared-ini-file-loader" "^2.4.0" - "@smithy/types" "^2.12.0" - tslib "^2.6.2" - "@aws-sdk/credential-provider-sso@3.421.0": version "3.421.0" resolved "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.421.0.tgz#1863eabf232dd6add900e045e36a0e6c1213e31c" @@ -2305,19 +2037,6 @@ "@smithy/types" "^2.12.0" tslib "^2.6.2" -"@aws-sdk/credential-provider-sso@3.568.0": - version "3.568.0" - resolved "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.568.0.tgz#7120d27181daeb7a2ca809e7f2c86b71a0595ed2" - integrity sha512-+TA77NWOEXMUcfLoOuim6xiyXFg1GqHj55ggI1goTKGVvdHYZ+rhxZbwjI29+ewzPt/qcItDJcvhrjOrg9lCag== - dependencies: - "@aws-sdk/client-sso" "3.568.0" - "@aws-sdk/token-providers" "3.568.0" - "@aws-sdk/types" "3.567.0" - "@smithy/property-provider" "^2.2.0" - "@smithy/shared-ini-file-loader" "^2.4.0" - "@smithy/types" "^2.12.0" - tslib "^2.6.2" - "@aws-sdk/credential-provider-web-identity@3.418.0": version "3.418.0" resolved "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.418.0.tgz#c2aed2a79bf193c1fef2b98391aaa9de7336aaaf" @@ -2348,16 +2067,6 @@ "@smithy/types" "^2.12.0" tslib "^2.6.2" -"@aws-sdk/credential-provider-web-identity@3.568.0": - version "3.568.0" - resolved "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.568.0.tgz#b4e7958dc92a6cbbf5e9fd065cecd76573d4b70f" - integrity sha512-ZJSmTmoIdg6WqAULjYzaJ3XcbgBzVy36lir6Y0UBMRGaxDgos1AARuX6EcYzXOl+ksLvxt/xMQ+3aYh1LWfKSw== - dependencies: - "@aws-sdk/types" "3.567.0" - "@smithy/property-provider" "^2.2.0" - "@smithy/types" "^2.12.0" - tslib "^2.6.2" - "@aws-sdk/credential-providers@3.421.0": version "3.421.0" resolved "https://registry.npmjs.org/@aws-sdk/credential-providers/-/credential-providers-3.421.0.tgz#567d4b7ae00809d7d4f8dce088e6ed5b5e622b7b" @@ -2503,16 +2212,6 @@ "@smithy/types" "^2.12.0" tslib "^2.6.2" -"@aws-sdk/middleware-host-header@3.567.0": - version "3.567.0" - resolved "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.567.0.tgz#52f278234458ec3035e9534fee582c95a8fec4f7" - integrity sha512-zQHHj2N3in9duKghH7AuRNrOMLnKhW6lnmb7dznou068DJtDr76w475sHp2TF0XELsOGENbbBsOlN/S5QBFBVQ== - dependencies: - "@aws-sdk/types" "3.567.0" - "@smithy/protocol-http" "^3.3.0" - "@smithy/types" "^2.12.0" - tslib "^2.6.2" - "@aws-sdk/middleware-location-constraint@3.418.0": version "3.418.0" resolved "https://registry.npmjs.org/@aws-sdk/middleware-location-constraint/-/middleware-location-constraint-3.418.0.tgz#e62e213a72ce583ba6135db51dcc60d07825b8ee" @@ -2558,15 +2257,6 @@ "@smithy/types" "^2.12.0" tslib "^2.6.2" -"@aws-sdk/middleware-logger@3.568.0": - version "3.568.0" - resolved "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.568.0.tgz#aeb85cc8f7da431442d0f5914f3a3e262eb55a09" - integrity sha512-BinH72RG7K3DHHC1/tCulocFv+ZlQ9SrPF9zYT0T1OT95JXuHhB7fH8gEABrc6DAtOdJJh2fgxQjPy5tzPtsrA== - dependencies: - "@aws-sdk/types" "3.567.0" - "@smithy/types" "^2.12.0" - tslib "^2.6.2" - "@aws-sdk/middleware-recursion-detection@3.418.0": version "3.418.0" resolved "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.418.0.tgz#2bb80d084f946846ad4907f3d6e0b451787d62b1" @@ -2597,16 +2287,6 @@ "@smithy/types" "^2.12.0" tslib "^2.6.2" -"@aws-sdk/middleware-recursion-detection@3.567.0": - version "3.567.0" - resolved "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.567.0.tgz#95d91f071b57fb5245d522db70df1652275f06ac" - integrity sha512-rFk3QhdT4IL6O/UWHmNdjJiURutBCy+ogGqaNHf/RELxgXH3KmYorLwCe0eFb5hq8f6vr3zl4/iH7YtsUOuo1w== - dependencies: - "@aws-sdk/types" "3.567.0" - "@smithy/protocol-http" "^3.3.0" - "@smithy/types" "^2.12.0" - tslib "^2.6.2" - "@aws-sdk/middleware-sdk-ec2@3.418.0": version "3.418.0" resolved "https://registry.npmjs.org/@aws-sdk/middleware-sdk-ec2/-/middleware-sdk-ec2-3.418.0.tgz#eac7054b128645c5a040c8e95b5cf92c7994d2fd" @@ -2764,17 +2444,6 @@ "@smithy/types" "^2.12.0" tslib "^2.6.2" -"@aws-sdk/middleware-user-agent@3.567.0": - version "3.567.0" - resolved "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.567.0.tgz#0dbedb18b33a7f490948f8b153301bd4bc7e825d" - integrity sha512-a7DBGMRBLWJU3BqrQjOtKS4/RcCh/BhhKqwjCE0FEhhm6A/GGuAs/DcBGOl6Y8Wfsby3vejSlppTLH/qtV1E9w== - dependencies: - "@aws-sdk/types" "3.567.0" - "@aws-sdk/util-endpoints" "3.567.0" - "@smithy/protocol-http" "^3.3.0" - "@smithy/types" "^2.12.0" - tslib "^2.6.2" - "@aws-sdk/node-http-handler@^3.370.0": version "3.374.0" resolved "https://registry.npmjs.org/@aws-sdk/node-http-handler/-/node-http-handler-3.374.0.tgz#8cd58b4d9814713e26034c12eabc119c113a5bc4" @@ -2817,18 +2486,6 @@ "@smithy/util-middleware" "^2.2.0" tslib "^2.6.2" -"@aws-sdk/region-config-resolver@3.567.0": - version "3.567.0" - resolved "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.567.0.tgz#c3ad943d3debcfb0c50ce3556ed183195f8590f9" - integrity sha512-VMDyYi5Dh2NydDiIARZ19DwMfbyq0llS736cp47qopmO6wzdeul7WRTx8NKfEYN0/AwEaqmTW0ohx58jSB1lYg== - dependencies: - "@aws-sdk/types" "3.567.0" - "@smithy/node-config-provider" "^2.3.0" - "@smithy/types" "^2.12.0" - "@smithy/util-config-provider" "^2.3.0" - "@smithy/util-middleware" "^2.2.0" - tslib "^2.6.2" - "@aws-sdk/s3-request-presigner@3.451.0": version "3.451.0" resolved "https://registry.npmjs.org/@aws-sdk/s3-request-presigner/-/s3-request-presigner-3.451.0.tgz#1728993a547017f739c9c24af2d8e058e8873c4f" @@ -2960,17 +2617,6 @@ "@smithy/types" "^2.12.0" tslib "^2.6.2" -"@aws-sdk/token-providers@3.568.0": - version "3.568.0" - resolved "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.568.0.tgz#8efe5a3d97e5346dd8cb473accdcbfec466f9cba" - integrity sha512-mCQElYzY5N2JlXB7LyjOoLvRN/JiSV+E9szLwhYN3dleTUCMbGqWb7RiAR2V3fO+mz8f9kR7DThTExKJbKogKw== - dependencies: - "@aws-sdk/types" "3.567.0" - "@smithy/property-provider" "^2.2.0" - "@smithy/shared-ini-file-loader" "^2.4.0" - "@smithy/types" "^2.12.0" - tslib "^2.6.2" - "@aws-sdk/types@3.418.0": version "3.418.0" resolved "https://registry.npmjs.org/@aws-sdk/types/-/types-3.418.0.tgz#c23213110b0c313d5546c810da032a441682f49a" @@ -2995,14 +2641,6 @@ "@smithy/types" "^2.12.0" tslib "^2.6.2" -"@aws-sdk/types@3.567.0": - version "3.567.0" - resolved "https://registry.npmjs.org/@aws-sdk/types/-/types-3.567.0.tgz#b2dc88e154140b1ff87e94f63c97447bdb1c1738" - integrity sha512-JBznu45cdgQb8+T/Zab7WpBmfEAh77gsk99xuF4biIb2Sw1mdseONdoGDjEJX57a25TzIv/WUJ2oABWumckz1A== - dependencies: - "@smithy/types" "^2.12.0" - tslib "^2.6.2" - "@aws-sdk/util-arn-parser@3.310.0": version "3.310.0" resolved "https://registry.npmjs.org/@aws-sdk/util-arn-parser/-/util-arn-parser-3.310.0.tgz#861ff8810851be52a320ec9e4786f15b5fc74fba" @@ -3037,16 +2675,6 @@ "@smithy/util-endpoints" "^1.2.0" tslib "^2.6.2" -"@aws-sdk/util-endpoints@3.567.0": - version "3.567.0" - resolved "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.567.0.tgz#c536ad8b9acf99ad762ab949fe0fed943c6f5a12" - integrity sha512-WVhot3qmi0BKL9ZKnUqsvCd++4RF2DsJIG32NlRaml1FT9KaqSzNv0RXeA6k/kYwiiNT7y3YWu3Lbzy7c6vG9g== - dependencies: - "@aws-sdk/types" "3.567.0" - "@smithy/types" "^2.12.0" - "@smithy/util-endpoints" "^1.2.0" - tslib "^2.6.2" - "@aws-sdk/util-format-url@3.418.0": version "3.418.0" resolved "https://registry.npmjs.org/@aws-sdk/util-format-url/-/util-format-url-3.418.0.tgz#85035e704f5996189aeec2a7bd08265bcd87f1e1" @@ -3104,16 +2732,6 @@ bowser "^2.11.0" tslib "^2.6.2" -"@aws-sdk/util-user-agent-browser@3.567.0": - version "3.567.0" - resolved "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.567.0.tgz#1ef37a87b28155274d62e31c1ac5c1c043dcd0b3" - integrity sha512-cqP0uXtZ7m7hRysf3fRyJwcY1jCgQTpJy7BHB5VpsE7DXlXHD5+Ur5L42CY7UrRPrB6lc6YGFqaAOs5ghMcLyA== - dependencies: - "@aws-sdk/types" "3.567.0" - "@smithy/types" "^2.12.0" - bowser "^2.11.0" - tslib "^2.6.2" - "@aws-sdk/util-user-agent-node@3.418.0": version "3.418.0" resolved "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.418.0.tgz#7d5a1c82ce3265ff0f70b13d58d08593113ab99a" @@ -3144,16 +2762,6 @@ "@smithy/types" "^2.12.0" tslib "^2.6.2" -"@aws-sdk/util-user-agent-node@3.568.0": - version "3.568.0" - resolved "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.568.0.tgz#8bfb81b23d4947462f1e49c70187b85e7cd3837a" - integrity sha512-NVoZoLnKF+eXPBvXg+KqixgJkPSrerR6Gqmbjwqbv14Ini+0KNKB0/MXas1mDGvvEgtNkHI/Cb9zlJ3KXpti2A== - dependencies: - "@aws-sdk/types" "3.567.0" - "@smithy/node-config-provider" "^2.3.0" - "@smithy/types" "^2.12.0" - tslib "^2.6.2" - "@aws-sdk/util-utf8-browser@^3.0.0": version "3.259.0" resolved "https://registry.npmjs.org/@aws-sdk/util-utf8-browser/-/util-utf8-browser-3.259.0.tgz#3275a6f5eb334f96ca76635b961d3c50259fd9ff" @@ -5795,7 +5403,7 @@ "@babel/parser" "^7.1.0" "@babel/types" "^7.0.0" -"@types/babel__traverse@*", "@types/babel__traverse@^7.0.6": +"@types/babel__traverse@*", "@types/babel__traverse@7.18.2", "@types/babel__traverse@^7.0.6": version "7.18.2" resolved "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.18.2.tgz#235bf339d17185bdec25e024ca19cce257cc7309" integrity sha512-FcFaxOr2V5KZCviw1TnutEMVUVsGt4D2hP1TAfXZAMKuHYW3xQhe3jTxNPWutgCJ3/X1c5yX8ZoGVEItxKbwBg== @@ -7451,11 +7059,6 @@ co@^4.6.0: resolved "https://registry.npmjs.org/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" integrity sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ== -code-point-at@^1.0.0: - version "1.1.0" - resolved "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" - integrity sha512-RpAVKQA5T63xEj6/giIbUEtZwJ4UFIc3ZtvEkiaUERylqe8xb5IvqcgOurZLahv93CLKfxcw5YI+DZcUBRyLXA== - codemaker@^1.98.0: version "1.98.0" resolved "https://registry.npmjs.org/codemaker/-/codemaker-1.98.0.tgz#cd4f2667c69857162193fe1abbbaad90fe3eed38" @@ -7515,6 +7118,11 @@ color@^3.1.3: color-convert "^1.9.3" color-string "^1.6.0" +colors@1.4.0: + version "1.4.0" + resolved "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78" + integrity sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA== + colorspace@1.1.x: version "1.1.4" resolved "https://registry.npmjs.org/colorspace/-/colorspace-1.1.4.tgz#8d442d1186152f60453bf8070cd66eb364e59243" @@ -8477,11 +8085,6 @@ duplexer@^0.1.1: resolved "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz#3abe43aef3835f8ae077d136ddce0f276b0400e6" integrity sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg== -eastasianwidth@^0.2.0: - version "0.2.0" - resolved "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb" - integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA== - ejs@^3.1.7: version "3.1.10" resolved "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz#69ab8358b14e896f80cc39e62087b88500c3ac3b" @@ -8504,11 +8107,6 @@ emoji-regex@^8.0.0: resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== -emoji-regex@^9.2.2: - version "9.2.2" - resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz#840c8803b0d8047f4ff0cf963176b32d4ef3ed72" - integrity sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg== - enabled@2.0.x: version "2.0.0" resolved "https://registry.npmjs.org/enabled/-/enabled-2.0.0.tgz#f9dd92ec2d6f4bbc0d5d1e64e21d61cd4665e7c2" @@ -8551,16 +8149,16 @@ enquirer@~2.3.6: dependencies: ansi-colors "^4.1.1" -entities@^4.4.0: - version "4.5.0" - resolved "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz#5d268ea5e7113ec74c4d033b79ea5a35a488fb48" - integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw== - entities@~2.0: version "2.0.3" resolved "https://registry.npmjs.org/entities/-/entities-2.0.3.tgz#5c487e5742ab93c15abb5da22759b8590ec03b7f" integrity sha512-MyoZ0jgnLvB2X3Lg5HqpFmn1kybDiIfEQmKzTb5apr51Rb+T3KdmMiqa70T+bhGnyv7bQ6WMj2QMHpGMmlrUYQ== +entities@~2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/entities/-/entities-2.1.0.tgz#992d3129cf7df6870b96c57858c249a120f8b8b5" + integrity sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w== + entities@~3.0.1: version "3.0.1" resolved "https://registry.npmjs.org/entities/-/entities-3.0.1.tgz#2b887ca62585e96db3903482d336c1006c3001d4" @@ -10347,13 +9945,6 @@ is-extglob@^2.1.1: resolved "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== -is-fullwidth-code-point@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" - integrity sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw== - dependencies: - number-is-nan "^1.0.0" - is-fullwidth-code-point@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" @@ -11735,12 +11326,12 @@ lines-and-columns@~2.0.3: resolved "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-2.0.4.tgz#d00318855905d2660d8c0822e3f5a4715855fc42" integrity sha512-wM1+Z03eypVAVUCE7QdSqpVIvelbOakn1M0bPDoA4SGWPx3sNDVUiMo3L6To6WWGClB7VyXnhQ4Sn7gxiJbE6A== -linkify-it@^5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/linkify-it/-/linkify-it-5.0.0.tgz#9ef238bfa6dc70bd8e7f9572b52d369af569b421" - integrity sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ== +linkify-it@^3.0.1: + version "3.0.3" + resolved "https://registry.npmjs.org/linkify-it/-/linkify-it-3.0.3.tgz#a98baf44ce45a550efb4d49c769d07524cc2fa2e" + integrity sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ== dependencies: - uc.micro "^2.0.0" + uc.micro "^1.0.1" load-json-file@6.2.0, load-json-file@^6.2.0: version "6.2.0" @@ -12067,17 +11658,16 @@ map-obj@^4.0.0: resolved "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz#9304f906e93faae70880da102a9f1df0ea8bb05a" integrity sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ== -markdown-it@14.1.0: - version "14.1.0" - resolved "https://registry.npmjs.org/markdown-it/-/markdown-it-14.1.0.tgz#3c3c5992883c633db4714ccb4d7b5935d98b7d45" - integrity sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg== +markdown-it@14.1.0, markdown-it@^12.3.2: + version "12.3.2" + resolved "https://registry.npmjs.org/markdown-it/-/markdown-it-12.3.2.tgz#bf92ac92283fe983fe4de8ff8abfb5ad72cd0c90" + integrity sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg== dependencies: argparse "^2.0.1" - entities "^4.4.0" - linkify-it "^5.0.0" - mdurl "^2.0.0" - punycode.js "^2.3.1" - uc.micro "^2.1.0" + entities "~2.1.0" + linkify-it "^3.0.1" + mdurl "^1.0.1" + uc.micro "^1.0.5" markdownlint-cli@^0.40.0: version "0.40.0" @@ -12109,12 +11699,7 @@ markdownlint@~0.34.0: markdown-it "14.1.0" markdownlint-micromark "0.1.9" -mdurl@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/mdurl/-/mdurl-2.0.0.tgz#80676ec0433025dd3e17ee983d0fe8de5a2237e0" - integrity sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w== - -mdurl@~1.0.1: +mdurl@^1.0.1, mdurl@~1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e" integrity sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g== @@ -13060,11 +12645,6 @@ npmlog@^6.0.0, npmlog@^6.0.2: gauge "^4.0.3" set-blocking "^2.0.0" -number-is-nan@^1.0.0: - version "1.0.1" - resolved "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" - integrity sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ== - nx@16.10.0: version "16.10.0" resolved "https://registry.npmjs.org/nx/-/nx-16.10.0.tgz#b070461f7de0a3d7988bd78558ea84cda3543ace" @@ -14038,11 +13618,6 @@ proxy-from-env@^1.1.0: resolved "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== -punycode.js@^2.3.1: - version "2.3.1" - resolved "https://registry.npmjs.org/punycode.js/-/punycode.js-2.3.1.tgz#6b53e56ad75588234e79f4affa90972c7dd8cdb7" - integrity sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA== - punycode@1.3.2: version "1.3.2" resolved "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" @@ -15129,7 +14704,7 @@ string-length@^4.0.1: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.1" -string-width@*, "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +string-width@*, string-width@^1.0.1, "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3, string-width@^5.0.1, string-width@^5.1.2: version "4.2.3" resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -15138,24 +14713,6 @@ string-width@*, "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, strin is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.1" -string-width@^1.0.1: - version "1.0.2" - resolved "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" - integrity sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw== - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - strip-ansi "^3.0.0" - -string-width@^5.0.1, string-width@^5.1.2: - version "5.1.2" - resolved "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794" - integrity sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA== - dependencies: - eastasianwidth "^0.2.0" - emoji-regex "^9.2.2" - strip-ansi "^7.0.1" - string.prototype.repeat@^0.2.0: version "0.2.0" resolved "https://registry.npmjs.org/string.prototype.repeat/-/string.prototype.repeat-0.2.0.tgz#aba36de08dcee6a5a337d49b2ea1da1b28fc0ecf" @@ -15232,7 +14789,7 @@ stringify-package@^1.0.1: dependencies: ansi-regex "^5.0.1" -strip-ansi@^3.0.0, strip-ansi@^3.0.1: +strip-ansi@^3.0.1: version "3.0.1" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" integrity sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg== @@ -15826,10 +15383,10 @@ typescript@~5.1.0: resolved "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz#02f8ac202b6dad2c0dd5e0913745b47a37998274" integrity sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA== -uc.micro@^2.0.0, uc.micro@^2.1.0: - version "2.1.0" - resolved "https://registry.npmjs.org/uc.micro/-/uc.micro-2.1.0.tgz#f8d3f7d0ec4c3dea35a7e3c8efa4cb8b45c9e7ee" - integrity sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A== +uc.micro@^1.0.1, uc.micro@^1.0.5: + version "1.0.6" + resolved "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz#9c411a802a409a91fc6cf74081baba34b24499ac" + integrity sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA== uglify-js@^3.1.4: version "3.17.4" From 8552b7485ea8e5db9f38811c6b7b608627a2065b Mon Sep 17 00:00:00 2001 From: Jakob Berg Date: Fri, 10 May 2024 11:01:05 -0400 Subject: [PATCH 11/11] making test code less redundant --- .../test/diff-template.test.ts | 210 ++---------------- .../@aws-cdk/cloudformation-diff/test/util.ts | 32 +++ 2 files changed, 50 insertions(+), 192 deletions(-) diff --git a/packages/@aws-cdk/cloudformation-diff/test/diff-template.test.ts b/packages/@aws-cdk/cloudformation-diff/test/diff-template.test.ts index ed5359ac3f28d..5490d9051c22a 100644 --- a/packages/@aws-cdk/cloudformation-diff/test/diff-template.test.ts +++ b/packages/@aws-cdk/cloudformation-diff/test/diff-template.test.ts @@ -1,5 +1,6 @@ import * as fc from 'fast-check'; import { arbitraryTemplate } from './test-arbitraries'; +import { sqsQueue, sqsQueueWithAargs, ssmParam } from './util'; import { fullDiff, ResourceImpact } from '../lib/diff-template'; const POLICY_DOCUMENT = { foo: 'Bar' }; // Obviously a fake one! @@ -1242,16 +1243,7 @@ describe('changeset', () => { }, }, Resources: { - mySsmParameter: { - Type: 'AWS::SSM::Parameter', - Properties: { - Name: 'mySsmParameterFromStack', - Type: 'String', - Value: { - Ref: 'SsmParameterValuetestbugreportC9', - }, - }, - }, + mySsmParameter: ssmParam, }, }; @@ -1293,26 +1285,8 @@ describe('changeset', () => { expect(diffWithChangeSet.resources.changes).toEqual( { mySsmParameter: { - oldValue: { - Type: 'AWS::SSM::Parameter', - Properties: { - Name: 'mySsmParameterFromStack', - Type: 'String', - Value: { - Ref: 'SsmParameterValuetestbugreportC9', - }, - }, - }, - newValue: { - Type: 'AWS::SSM::Parameter', - Properties: { - Name: 'mySsmParameterFromStack', - Type: 'String', - Value: { - Ref: 'SsmParameterValuetestbugreportC9', - }, - }, - }, + oldValue: ssmParam, + newValue: ssmParam, resourceTypes: { oldType: 'AWS::SSM::Parameter', newType: 'AWS::SSM::Parameter', @@ -1331,10 +1305,8 @@ describe('changeset', () => { changeImpact: 'NO_CHANGE', }, Value: { - oldValue: { - }, - newValue: { - }, + oldValue: {}, + newValue: {}, isDifferent: true, changeImpact: 'WILL_UPDATE', // this is what changed! }, @@ -1414,32 +1386,16 @@ describe('changeset', () => { expect(diffWithChangeSet.resources.changes).toEqual( { Queue: { - oldValue: { - Type: 'AWS::SQS::Queue', - Properties: { - QueueName: { - Ref: 'SsmParameterValuetestbugreportC9', - }, - }, - }, - newValue: { - Type: 'AWS::SQS::Queue', - Properties: { - QueueName: { - Ref: 'SsmParameterValuetestbugreportC9', - }, - }, - }, + oldValue: sqsQueue, + newValue: sqsQueue, resourceTypes: { oldType: 'AWS::SQS::Queue', newType: 'AWS::SQS::Queue', }, propertyDiffs: { QueueName: { - oldValue: { - }, - newValue: { - }, + oldValue: {}, + newValue: {}, isDifferent: true, changeImpact: 'WILL_REPLACE', // this is what changed! }, @@ -1471,23 +1427,7 @@ describe('changeset', () => { }, }, Resources: { - Queue: { - Type: 'AWS::SQS::Queue', - Properties: { - QueueName: { - 'Fn::Join': [ - '', - [ - 'newValue', - { - Ref: 'SsmParameterValuetestbugreportC9', - }, - ], - ], - }, - ReceiveMessageWaitTimeSeconds: 10, - }, - }, + Queue: sqsQueueWithAargs({ waitTime: 10 }), }, }; @@ -1499,23 +1439,7 @@ describe('changeset', () => { }, }, Resources: { - Queue: { - Type: 'AWS::SQS::Queue', - Properties: { - QueueName: { - 'Fn::Join': [ - '', - [ - 'newValue', - { - Ref: 'SsmParameterValuetestbugreportC9', - }, - ], - ], - }, - ReceiveMessageWaitTimeSeconds: 20, - }, - }, + Queue: sqsQueueWithAargs({ waitTime: 20 }), }, }; @@ -1562,40 +1486,8 @@ describe('changeset', () => { expect(diffWithoutChangeSet.resources.changes).toEqual( { Queue: { - oldValue: { - Type: 'AWS::SQS::Queue', - Properties: { - QueueName: { - 'Fn::Join': [ - '', - [ - 'newValue', - { - Ref: 'SsmParameterValuetestbugreportC9', - }, - ], - ], - }, - ReceiveMessageWaitTimeSeconds: 10, - }, - }, - newValue: { - Type: 'AWS::SQS::Queue', - Properties: { - QueueName: { - 'Fn::Join': [ - '', - [ - 'newValue', - { - Ref: 'SsmParameterValuetestbugreportC9', - }, - ], - ], - }, - ReceiveMessageWaitTimeSeconds: 20, - }, - }, + oldValue: sqsQueueWithAargs({ waitTime: 10 }), + newValue: sqsQueueWithAargs({ waitTime: 20 }), resourceTypes: { oldType: 'AWS::SQS::Queue', newType: 'AWS::SQS::Queue', @@ -1603,26 +1495,10 @@ describe('changeset', () => { propertyDiffs: { QueueName: { oldValue: { - 'Fn::Join': [ - '', - [ - 'newValue', - { - Ref: 'SsmParameterValuetestbugreportC9', - }, - ], - ], + Ref: 'SsmParameterValuetestbugreportC9', }, newValue: { - 'Fn::Join': [ - '', - [ - 'newValue', - { - Ref: 'SsmParameterValuetestbugreportC9', - }, - ], - ], + Ref: 'SsmParameterValuetestbugreportC9', }, isDifferent: false, changeImpact: 'NO_CHANGE', @@ -1649,61 +1525,11 @@ describe('changeset', () => { ); expect(diffWithChangeSet.differenceCount).toBe(1); // this is the count of how many resources have changed - expect(diffWithChangeSet.resources.get('Queue').propertyUpdates).toEqual( - { - QueueName: { - oldValue: { - }, - newValue: { - }, - isDifferent: true, - changeImpact: 'WILL_REPLACE', - }, - ReceiveMessageWaitTimeSeconds: { - oldValue: 10, - newValue: 20, - isDifferent: true, - changeImpact: 'WILL_UPDATE', - }, - }, - ); expect(diffWithChangeSet.resources.changes).toEqual( { Queue: { - oldValue: { - Type: 'AWS::SQS::Queue', - Properties: { - QueueName: { - 'Fn::Join': [ - '', - [ - 'newValue', - { - Ref: 'SsmParameterValuetestbugreportC9', - }, - ], - ], - }, - ReceiveMessageWaitTimeSeconds: 10, - }, - }, - newValue: { - Type: 'AWS::SQS::Queue', - Properties: { - QueueName: { - 'Fn::Join': [ - '', - [ - 'newValue', - { - Ref: 'SsmParameterValuetestbugreportC9', - }, - ], - ], - }, - ReceiveMessageWaitTimeSeconds: 20, - }, - }, + oldValue: sqsQueueWithAargs({ waitTime: 10 }), + newValue: sqsQueueWithAargs({ waitTime: 20 }), resourceTypes: { oldType: 'AWS::SQS::Queue', newType: 'AWS::SQS::Queue', diff --git a/packages/@aws-cdk/cloudformation-diff/test/util.ts b/packages/@aws-cdk/cloudformation-diff/test/util.ts index bce0b48b214eb..9c1bb4d4dfaed 100644 --- a/packages/@aws-cdk/cloudformation-diff/test/util.ts +++ b/packages/@aws-cdk/cloudformation-diff/test/util.ts @@ -73,3 +73,35 @@ export function largeSsoPermissionSet() { ), }); } + +export const ssmParam = { + Type: 'AWS::SSM::Parameter', + Properties: { + Name: 'mySsmParameterFromStack', + Type: 'String', + Value: { + Ref: 'SsmParameterValuetestbugreportC9', + }, + }, +}; + +export const sqsQueue = { + Type: 'AWS::SQS::Queue', + Properties: { + QueueName: { + Ref: 'SsmParameterValuetestbugreportC9', + }, + }, +}; + +export function sqsQueueWithAargs(args: { waitTime: number }) { + return { + Type: 'AWS::SQS::Queue', + Properties: { + QueueName: { + Ref: 'SsmParameterValuetestbugreportC9', + }, + ReceiveMessageWaitTimeSeconds: args.waitTime, + }, + }; +}