From 27f0d97cdc97a60d0a624bb4d707e209d9136da8 Mon Sep 17 00:00:00 2001 From: Momo Kornher Date: Thu, 20 Nov 2025 11:42:09 +0000 Subject: [PATCH 01/18] feat: add retry workflow for uninstallable packages Add a new state machine that allows operators to retry processing of all uninstallable packages with a single button click. The workflow reads the uninstallable packages report, triggers reprocessing for each package, and updates the inventory report. Changes: - Add RetryUninstallablePackages state machine - Add retry button to backend dashboard - Update operator runbook with troubleshooting guide - Wire inventory canary into orchestration --- docs/operator-runbook.md | 50 +++++++ src/backend-dashboard.ts | 7 + src/backend/orchestration/index.ts | 38 ++++- .../retry-uninstallable-packages.ts | 133 ++++++++++++++++++ src/construct-hub.ts | 15 +- 5 files changed, 232 insertions(+), 11 deletions(-) create mode 100644 src/backend/orchestration/retry-uninstallable-packages.ts diff --git a/docs/operator-runbook.md b/docs/operator-runbook.md index 29620554d..fed7bc628 100644 --- a/docs/operator-runbook.md +++ b/docs/operator-runbook.md @@ -681,6 +681,56 @@ Two workflows are available for reprocessing of individual items: } ``` +## :package: Missing Package Documentation + +### Description + +When documentation for a package is not available, it could be due to several reasons: + +1. **Uninstallable Package**: The package cannot be installed during the documentation generation process +2. **Corrupt Assembly**: The package's assembly.json file is corrupted or invalid +3. **Transliteration Error**: The documentation generation process failed for a specific language +4. **Missing Dependencies**: Required dependencies are not available + +### Investigation + +1. **Check the Uninstallable Packages Report**: In the backend dashboard, review the "Package Versions Report | Uninstallable" section to see if the package is listed as uninstallable. + +2. **Review Package Directory**: Check the package's S3 directory (`data//v/`) for error marker files: + - `uninstallable` - Package cannot be installed + - `*.corruptassembly` - Assembly file is corrupted + - `*.transliteration-failed` - Transliteration failed for a language + +3. **Check Orchestration Logs**: Review the orchestration state machine execution logs for the specific package to identify the failure point. + +4. **Examine ECS Task Logs**: If the failure occurred during documentation generation, check the ECS task logs in CloudWatch for detailed error messages. + +### Resolution + +1. **For Uninstallable Packages**: Use the "Retry Uninstallable Packages" button in the backend dashboard to automatically retry all uninstallable packages. This will: + - Read the current uninstallable packages report + - Trigger reprocessing for each uninstallable package + - Update the inventory report after completion + +2. **For Individual Packages**: Use the "ReprocessDocumentationPerPackage" state machine to retry a specific package: + ```json + { + "Prefix": "data//v" + } + ``` + +3. **For Systematic Issues**: If many packages are failing, investigate the root cause: + - Check if there are issues with the documentation generation tooling + - Verify that all required dependencies and services are available + - Review recent changes to the transliterator or documentation generator + +### Prevention + +- Monitor the uninstallable packages count metric regularly +- Set up alerts for increases in missing documentation +- Regularly review and update the documentation generation tooling +- Ensure proper testing of changes to the transliterator pipeline + -------------------------------------------------------------------------------- ### `ConstructHub/Sources/NpmJs/Canary/SLA-Breached` diff --git a/src/backend-dashboard.ts b/src/backend-dashboard.ts index cf67f4919..6f835ae0c 100644 --- a/src/backend-dashboard.ts +++ b/src/backend-dashboard.ts @@ -68,6 +68,10 @@ export class BackendDashboard extends Construct { "These packages could not be installed. Note that currently they will also appear in the 'missing' documentation reports.", '', "The specific error can be found in the package directory inside a file named 'uninstallable'", + '', + `[button:primary:Retry Uninstallable Packages](${stateMachineUrl( + props.orchestration.retryUninstallablePackages + )})`, ].join('\n'), bucket: props.packageData, key: UNINSTALLABLE_PACKAGES_REPORT, @@ -327,6 +331,9 @@ export class BackendDashboard extends Construct { `[button:Regenerate All Documentation](${stateMachineUrl( props.orchestration.regenerateAllDocumentation )})`, + `[button:Retry Uninstallable Packages](${stateMachineUrl( + props.orchestration.retryUninstallablePackages + )})`, ].join('\n'), }), ], diff --git a/src/backend/orchestration/index.ts b/src/backend/orchestration/index.ts index 7664f2afa..de61cdb6c 100644 --- a/src/backend/orchestration/index.ts +++ b/src/backend/orchestration/index.ts @@ -31,6 +31,8 @@ import * as tasks from 'aws-cdk-lib/aws-stepfunctions-tasks'; import { Construct } from 'constructs'; import { NeedsCatalogUpdate } from './needs-catalog-update'; import { RedriveStateMachine } from './redrive-state-machine'; +import { RetryUninstallablePackages } from './retry-uninstallable-packages'; +import { AlarmSeverities, AlarmSeverity } from '../../api'; import { Repository } from '../../codeartifact/repository'; import { sqsQueueUrl, stateMachineUrl } from '../../deep-link'; import { Monitoring, addAlarm } from '../../monitoring'; @@ -50,7 +52,6 @@ import { UNPROCESSABLE_PACKAGE_ERROR_NAME, } from '../shared/constants'; import { Transliterator, TransliteratorVpcEndpoints } from '../transliterator'; -import { AlarmSeverities, AlarmSeverity } from '../../api'; const REPROCESS_PER_PACKAGE_STATE_MACHINE_NAME = 'ReprocessDocumentationPerPackage'; @@ -105,6 +106,11 @@ export interface OrchestrationProps { */ readonly bucket: IBucket; + /** + * The inventory canary function. + */ + readonly inventory: { function: IFunction }; + /** * The CodeArtifact registry to use for regular operations. */ @@ -197,6 +203,11 @@ export class Orchestration extends Construct { */ public readonly regenerateAllDocumentationPerPackage: IStateMachine; + /** + * The state machine operators can use to retry processing uninstallable packages. + */ + public readonly retryUninstallablePackages: IStateMachine; + /** * The function that builds the catalog. */ @@ -479,8 +490,9 @@ export class Orchestration extends Construct { this.stateMachine .metricFailed() .createAlarm(this, 'OrchestrationFailed', { - alarmName: `${this.stateMachine.node.path}/${this.stateMachine.metricFailed().metricName - }`, + alarmName: `${this.stateMachine.node.path}/${ + this.stateMachine.metricFailed().metricName + }`, alarmDescription: [ 'Backend orchestration failed!', '', @@ -497,7 +509,8 @@ export class Orchestration extends Construct { threshold: 1, }), props.alarmSeverities?.backendOrchestrationFailed ?? AlarmSeverity.HIGH, - props.monitoring); + props.monitoring + ); props.monitoring.addHighSeverityAlarm( 'Execution Failure Rate above 75%', @@ -550,6 +563,23 @@ export class Orchestration extends Construct { this.regenerateAllDocumentationPerPackage = regenerateAllDocumentation.processPackageVersions; + // Create retry uninstallable packages workflow + const inventoryInvoke = new tasks.LambdaInvoke(this, 'Run Inventory', { + lambdaFunction: props.inventory.function, + resultPath: JsonPath.DISCARD, + }); + + const retryUninstallable = new RetryUninstallablePackages( + this, + 'RetryUninstallablePackages', + { + bucket: props.bucket, + reprocessStateMachine: this.regenerateAllDocumentationPerPackage, + inventoryFunction: inventoryInvoke, + } + ); + this.retryUninstallablePackages = retryUninstallable.stateMachine; + props.overviewDashboard.addConcurrentExecutionMetricToDashboard( needsCatalogUpdateFunction, 'NeedsCatalogUpdateLambda' diff --git a/src/backend/orchestration/retry-uninstallable-packages.ts b/src/backend/orchestration/retry-uninstallable-packages.ts new file mode 100644 index 000000000..077b0e3e3 --- /dev/null +++ b/src/backend/orchestration/retry-uninstallable-packages.ts @@ -0,0 +1,133 @@ +import { Duration } from 'aws-cdk-lib'; +import { IBucket } from 'aws-cdk-lib/aws-s3'; +import { + Choice, + Condition, + IntegrationPattern, + IStateMachine, + JsonPath, + Map, + Pass, + StateMachine, + Succeed, + TaskInput, +} from 'aws-cdk-lib/aws-stepfunctions'; +import * as tasks from 'aws-cdk-lib/aws-stepfunctions-tasks'; +import { Construct } from 'constructs'; +import { UNINSTALLABLE_PACKAGES_REPORT } from '../shared/constants'; + +export interface RetryUninstallablePackagesProps { + readonly bucket: IBucket; + readonly reprocessStateMachine: IStateMachine; + readonly inventoryFunction: tasks.LambdaInvoke; +} + +/** + * State machine that retries processing of uninstallable packages. + * + * This workflow: + * 1. Reads the uninstallable packages report + * 2. Triggers ReprocessDocumentationPerPackage for each entry + * 3. Re-runs the inventory canary to update the report + */ +export class RetryUninstallablePackages extends Construct { + public readonly stateMachine: StateMachine; + + public constructor( + scope: Construct, + id: string, + props: RetryUninstallablePackagesProps + ) { + super(scope, id); + + // Read the uninstallable packages report + const readReport = new tasks.CallAwsService( + this, + 'Read Uninstallable Report', + { + service: 's3', + action: 'getObject', + iamAction: 's3:GetObject', + iamResources: [ + `${props.bucket.bucketArn}/${UNINSTALLABLE_PACKAGES_REPORT}`, + ], + parameters: { + Bucket: props.bucket.bucketName, + Key: UNINSTALLABLE_PACKAGES_REPORT, + }, + resultPath: '$.reportResponse', + } + ) + .addRetry({ errors: ['S3.NoSuchKey'] }) + .addCatch(new Succeed(this, 'No Report Found'), { + errors: ['S3.NoSuchKey'], + }); + + // Parse the JSON content using intrinsic function + const parseReport = new Pass(this, 'Parse Report', { + parameters: { + 'packages.$': 'States.StringToJson($.reportResponse.Body)', + }, + resultPath: '$.parsedReport', + }); + + // Transform package@version to data/package/vversion format + const transformPackage = new Pass(this, 'Transform Package Format', { + parameters: { + 'packageName.$': 'States.ArrayGetItem(States.StringSplit($, "@"), 0)', + 'packageVersion.$': + 'States.ArrayGetItem(States.StringSplit($, "@"), 1)', + }, + resultPath: '$.transformed', + }); + + // Process each uninstallable package + const processPackages = new Map(this, 'Process Each Package', { + itemsPath: '$.parsedReport.packages', + resultPath: JsonPath.DISCARD, + }).iterator( + transformPackage.next( + new tasks.StepFunctionsStartExecution(this, 'Retry Package', { + stateMachine: props.reprocessStateMachine, + input: TaskInput.fromObject({ + Prefix: JsonPath.format( + 'data/{}/v{}', + JsonPath.stringAt('$.transformed.packageName'), + JsonPath.stringAt('$.transformed.packageVersion') + ), + }), + integrationPattern: IntegrationPattern.RUN_JOB, + }) + .addRetry({ errors: ['StepFunctions.ExecutionLimitExceeded'] }) + .addCatch(new Succeed(this, 'Package Retry Failed'), { + errors: ['States.TaskFailed'], + }) + ) + ); + + // Re-run inventory canary to update the report + const updateInventory = props.inventoryFunction.addRetry({ + errors: ['Lambda.TooManyRequestsException'], + }); + + const definition = readReport + .next(parseReport) + .next( + new Choice(this, 'Has Packages?') + .when( + Condition.isPresent('$.parsedReport.packages[0]'), + processPackages.next(updateInventory) + ) + .otherwise(new Succeed(this, 'No Packages to Retry')) + ); + + this.stateMachine = new StateMachine(this, 'Resource', { + definition, + stateMachineName: 'RetryUninstallablePackages', + timeout: Duration.hours(6), + tracingEnabled: true, + }); + + props.bucket.grantRead(this.stateMachine); + } +} diff --git a/src/construct-hub.ts b/src/construct-hub.ts index f63a01cb9..db38d1bc1 100644 --- a/src/construct-hub.ts +++ b/src/construct-hub.ts @@ -408,6 +408,13 @@ export class ConstructHub extends Construct implements iam.IGrantable { monitoring: this.monitoring, }); + const inventory = new Inventory(this, 'InventoryCanary', { + bucket: packageData, + logRetention: props.logRetention, + monitoring: this.monitoring, + overviewDashboard: overviewDashboard, + }); + const orchestration = new Orchestration(this, 'Orchestration', { bucket: packageData, codeArtifact, @@ -421,6 +428,7 @@ export class ConstructHub extends Construct implements iam.IGrantable { vpcSecurityGroups, feedBuilder, alarmSeverities: props.alarmSeverities, + inventory, }); this.regenerateAllDocumentationPerPackage = orchestration.regenerateAllDocumentationPerPackage; @@ -510,13 +518,6 @@ export class ConstructHub extends Construct implements iam.IGrantable { }) ); - const inventory = new Inventory(this, 'InventoryCanary', { - bucket: packageData, - logRetention: props.logRetention, - monitoring: this.monitoring, - overviewDashboard: overviewDashboard, - }); - new BackendDashboard(this, 'BackendDashboard', { packageData, dashboardName: props.backendDashboardName, From f7a048d0e5d76859a3177cd391ba566f9e88ac4b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 20 Nov 2025 11:48:06 +0000 Subject: [PATCH 02/18] chore: self mutation Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .../__snapshots__/construct-hub.test.ts.snap | 1495 +++++++++++++++-- .../__snapshots__/snapshot.test.ts.snap | 291 +++- 2 files changed, 1664 insertions(+), 122 deletions(-) diff --git a/src/__tests__/__snapshots__/construct-hub.test.ts.snap b/src/__tests__/__snapshots__/construct-hub.test.ts.snap index 09e12088e..15bf6bab0 100644 --- a/src/__tests__/__snapshots__/construct-hub.test.ts.snap +++ b/src/__tests__/__snapshots__/construct-hub.test.ts.snap @@ -926,6 +926,10 @@ def sort_filter_rules(json_obj): { "Ref": "ConstructHubOrchestrationRegenerateAllDocumentationE9FAB254", }, + ")\\n[button:Retry Uninstallable Packages](/states/home#/statemachines/view/", + { + "Ref": "ConstructHubOrchestrationRetryUninstallablePackagesA408F9B3", + }, ")"}},{"type":"metric","width":12,"height":6,"x":0,"y":99,"properties":{"view":"timeSeries","title":"State Machine Executions","region":"", { "Ref": "AWS::Region", @@ -1118,7 +1122,11 @@ def sort_filter_rules(json_obj): "Arn", ], }, - "","params":{"key":"uninstallable-objects/data.json","description":"These packages could not be installed. Note that currently they will also appear in the 'missing' documentation reports.\\n\\nThe specific error can be found in the package directory inside a file named 'uninstallable'\\n"},"title":"Package Versions Report | Uninstallable","updateOn":{"refresh":true,"resize":false,"timeRange":false}}},{"type":"custom","width":24,"height":6,"x":0,"y":6,"properties":{"endpoint":"", + "","params":{"key":"uninstallable-objects/data.json","description":"These packages could not be installed. Note that currently they will also appear in the 'missing' documentation reports.\\n\\nThe specific error can be found in the package directory inside a file named 'uninstallable'\\n\\n[button:primary:Retry Uninstallable Packages](/states/home#/statemachines/view/", + { + "Ref": "ConstructHubOrchestrationRetryUninstallablePackagesA408F9B3", + }, + ")\\n"},"title":"Package Versions Report | Uninstallable","updateOn":{"refresh":true,"resize":false,"timeRange":false}}},{"type":"custom","width":24,"height":6,"x":0,"y":6,"properties":{"endpoint":"", { "Fn::GetAtt": [ "PackageVersionsTableWidgetHandler5fa848259c1d5e388c0df69f05c016dfBE2C27C2", @@ -6826,6 +6834,255 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", }, "Type": "AWS::IAM::Policy", }, + "ConstructHubOrchestrationRetryUninstallablePackagesA408F9B3": { + "DeletionPolicy": "Delete", + "DependsOn": [ + "ConstructHubOrchestrationRetryUninstallablePackagesRoleDefaultPolicy7CB8A523", + "ConstructHubOrchestrationRetryUninstallablePackagesRole380D2573", + ], + "Properties": { + "DefinitionString": { + "Fn::Join": [ + "", + [ + "{"StartAt":"Read Uninstallable Report","States":{"Read Uninstallable Report":{"Next":"Parse Report","Retry":[{"ErrorEquals":["S3.NoSuchKey"]}],"Catch":[{"ErrorEquals":["S3.NoSuchKey"],"Next":"No Report Found"}],"Type":"Task","ResultPath":"$.reportResponse","Resource":"arn:", + { + "Ref": "AWS::Partition", + }, + ":states:::aws-sdk:s3:getObject","Parameters":{"Bucket":"", + { + "Ref": "ConstructHubPackageDataDC5EF35E", + }, + "","Key":"uninstallable-objects/data.json"}},"Parse Report":{"Type":"Pass","ResultPath":"$.parsedReport","Parameters":{"packages.$":"States.StringToJson($.reportResponse.Body)"},"Next":"Has Packages?"},"Has Packages?":{"Type":"Choice","Choices":[{"Variable":"$.parsedReport.packages[0]","IsPresent":true,"Next":"Process Each Package"}],"Default":"No Packages to Retry"},"No Packages to Retry":{"Type":"Succeed"},"Process Each Package":{"Type":"Map","ResultPath":null,"Next":"Run Inventory","ItemsPath":"$.parsedReport.packages","Iterator":{"StartAt":"Transform Package Format","States":{"Transform Package Format":{"Type":"Pass","ResultPath":"$.transformed","Parameters":{"packageName.$":"States.ArrayGetItem(States.StringSplit($, \\"@\\"), 0)","packageVersion.$":"States.ArrayGetItem(States.StringSplit($, \\"@\\"), 1)"},"Next":"Retry Package"},"Retry Package":{"End":true,"Retry":[{"ErrorEquals":["StepFunctions.ExecutionLimitExceeded"]}],"Catch":[{"ErrorEquals":["States.TaskFailed"],"Next":"Package Retry Failed"}],"Type":"Task","Resource":"arn:", + { + "Ref": "AWS::Partition", + }, + ":states:::states:startExecution.sync:2","Parameters":{"Input":{"Prefix.$":"States.Format('data/{}/v{}', $.transformed.packageName, $.transformed.packageVersion)"},"StateMachineArn":"", + { + "Ref": "ConstructHubOrchestrationRegenerateAllDocumentationPerPackage9CF0FFB7", + }, + ""}},"Package Retry Failed":{"Type":"Succeed"}}}},"Run Inventory":{"End":true,"Retry":[{"ErrorEquals":["Lambda.ClientExecutionTimeoutException","Lambda.ServiceException","Lambda.AWSLambdaException","Lambda.SdkClientException"],"IntervalSeconds":2,"MaxAttempts":6,"BackoffRate":2},{"ErrorEquals":["Lambda.TooManyRequestsException"]}],"Type":"Task","ResultPath":null,"Resource":"arn:", + { + "Ref": "AWS::Partition", + }, + ":states:::lambda:invoke","Parameters":{"FunctionName":"", + { + "Fn::GetAtt": [ + "ConstructHubInventoryCanary63D899BC", + "Arn", + ], + }, + "","Payload.$":"$"}},"No Report Found":{"Type":"Succeed"}},"TimeoutSeconds":21600}", + ], + ], + }, + "RoleArn": { + "Fn::GetAtt": [ + "ConstructHubOrchestrationRetryUninstallablePackagesRole380D2573", + "Arn", + ], + }, + "StateMachineName": "RetryUninstallablePackages", + "TracingConfiguration": { + "Enabled": true, + }, + }, + "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Delete", + }, + "ConstructHubOrchestrationRetryUninstallablePackagesRole380D2573": { + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "states.amazonaws.com", + }, + }, + ], + "Version": "2012-10-17", + }, + }, + "Type": "AWS::IAM::Role", + }, + "ConstructHubOrchestrationRetryUninstallablePackagesRoleDefaultPolicy7CB8A523": { + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "s3:GetObject", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "ConstructHubPackageDataDC5EF35E", + "Arn", + ], + }, + "/uninstallable-objects/data.json", + ], + ], + }, + }, + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "ConstructHubInventoryCanary63D899BC", + "Arn", + ], + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "ConstructHubInventoryCanary63D899BC", + "Arn", + ], + }, + ":*", + ], + ], + }, + ], + }, + { + "Action": "states:StartExecution", + "Effect": "Allow", + "Resource": { + "Ref": "ConstructHubOrchestrationRegenerateAllDocumentationPerPackage9CF0FFB7", + }, + }, + { + "Action": [ + "states:DescribeExecution", + "states:StopExecution", + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition", + }, + ":states:", + { + "Ref": "AWS::Region", + }, + ":", + { + "Ref": "AWS::AccountId", + }, + ":execution:", + { + "Fn::Select": [ + 6, + { + "Fn::Split": [ + ":", + { + "Ref": "ConstructHubOrchestrationRegenerateAllDocumentationPerPackage9CF0FFB7", + }, + ], + }, + ], + }, + "*", + ], + ], + }, + }, + { + "Action": [ + "events:PutTargets", + "events:PutRule", + "events:DescribeRule", + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition", + }, + ":events:", + { + "Ref": "AWS::Region", + }, + ":", + { + "Ref": "AWS::AccountId", + }, + ":rule/StepFunctionsGetEventsForStepFunctionsExecutionRule", + ], + ], + }, + }, + { + "Action": [ + "xray:PutTraceSegments", + "xray:PutTelemetryRecords", + "xray:GetSamplingRules", + "xray:GetSamplingTargets", + ], + "Effect": "Allow", + "Resource": "*", + }, + { + "Action": [ + "s3:GetObject*", + "s3:GetBucket*", + "s3:List*", + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "ConstructHubPackageDataDC5EF35E", + "Arn", + ], + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "ConstructHubPackageDataDC5EF35E", + "Arn", + ], + }, + "/*", + ], + ], + }, + ], + }, + ], + "Version": "2012-10-17", + }, + "PolicyName": "ConstructHubOrchestrationRetryUninstallablePackagesRoleDefaultPolicy7CB8A523", + "Roles": [ + { + "Ref": "ConstructHubOrchestrationRetryUninstallablePackagesRole380D2573", + }, + ], + }, + "Type": "AWS::IAM::Policy", + }, "ConstructHubOrchestrationRoleDefaultPolicyEACD181F": { "Properties": { "PolicyDocument": { @@ -9332,31 +9589,35 @@ Request a service quota increase for lambda functions", { "Ref": "ConstructHubFeedBuilderReleaseNotesUpdateFeedBB0BA91D", }, - "",{"label":"updateFeedFunction","stat":"Maximum","visible":false,"id":"m3"}],[{"label":"CatalogBuilderLambda quota usage %","expression":"m4 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"updateFeedFunction","stat":"Maximum","visible":false,"id":"m3"}],[{"label":"CanaryResourceLambda quota usage %","expression":"m4 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + { + "Ref": "ConstructHubInventoryCanary63D899BC", + }, + "",{"label":"CanaryResourceLambda","stat":"Maximum","visible":false,"id":"m4"}],[{"label":"CatalogBuilderLambda quota usage %","expression":"m5 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubOrchestrationCatalogBuilder7C964951", }, - "",{"label":"CatalogBuilderLambda","stat":"Maximum","visible":false,"id":"m4"}],[{"label":"NeedsCatalogUpdateLambda quota usage %","expression":"m5 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"CatalogBuilderLambda","stat":"Maximum","visible":false,"id":"m5"}],[{"label":"NeedsCatalogUpdateLambda quota usage %","expression":"m6 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubOrchestrationNeedsCatalogUpdate5D7370DC", }, - "",{"label":"NeedsCatalogUpdateLambda","stat":"Maximum","visible":false,"id":"m5"}],[{"label":"IngestionLambda quota usage %","expression":"m6 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"NeedsCatalogUpdateLambda","stat":"Maximum","visible":false,"id":"m6"}],[{"label":"IngestionLambda quota usage %","expression":"m7 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubIngestion407909CE", }, - "",{"label":"IngestionLambda","stat":"Maximum","visible":false,"id":"m6"}],[{"label":"NpmJsLambda quota usage %","expression":"m7 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"IngestionLambda","stat":"Maximum","visible":false,"id":"m7"}],[{"label":"NpmJsLambda quota usage %","expression":"m8 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubSourcesNpmJs15A77D2D", }, - "",{"label":"NpmJsLambda","stat":"Maximum","visible":false,"id":"m7"}],[{"label":"NpmJs-StageAndNotifyLambda quota usage %","expression":"m8 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"NpmJsLambda","stat":"Maximum","visible":false,"id":"m8"}],[{"label":"NpmJs-StageAndNotifyLambda quota usage %","expression":"m9 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubSourcesNpmJsStageAndNotify591C0CFA", }, - "",{"label":"NpmJs-StageAndNotifyLambda","stat":"Maximum","visible":false,"id":"m8"}],[{"label":"CanaryResourceLambda quota usage %","expression":"m9 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"NpmJs-StageAndNotifyLambda","stat":"Maximum","visible":false,"id":"m9"}]],"annotations":{"horizontal":[{"value":70,"yAxis":"right"}]},"yAxis":{"right":{"label":"Quota Percent","min":0,"max":100}}}},{"type":"metric","width":12,"height":8,"x":0,"y":8,"properties":{"view":"timeSeries","title":"Construct Hub Inventory","region":"", { - "Ref": "ConstructHubInventoryCanary63D899BC", + "Ref": "AWS::Region", }, - "",{"label":"CanaryResourceLambda","stat":"Maximum","visible":false,"id":"m9"}]],"annotations":{"horizontal":[{"value":70,"yAxis":"right"}]},"yAxis":{"right":{"label":"Quota Percent","min":0,"max":100}}}},{"type":"custom","width":12,"height":8,"x":0,"y":8,"properties":{"endpoint":"", + "","metrics":[["ConstructHub/Inventory","PackageCount",{"period":900,"stat":"Maximum"}],["ConstructHub/Inventory","PackageMajorVersionCount",{"period":900,"stat":"Maximum"}]],"yAxis":{"left":{"label":"Package count"}}}},{"type":"custom","width":12,"height":8,"x":0,"y":16,"properties":{"endpoint":"", { "Fn::GetAtt": [ "SQSDLQStatsWidgetHandlerfc176846044f5e56baf2c71723501885366DDBD5", @@ -9412,7 +9673,7 @@ Request a service quota increase for lambda functions", "QueueName", ], }, - ""}}},"title":"SQS DLQ","updateOn":{"refresh":true,"resize":false,"timeRange":false}}},{"type":"metric","width":12,"height":8,"x":0,"y":16,"properties":{"view":"timeSeries","title":"CloudFront Metrics","region":"", + ""}}},"title":"SQS DLQ","updateOn":{"refresh":true,"resize":false,"timeRange":false}}},{"type":"metric","width":12,"height":8,"x":0,"y":24,"properties":{"view":"timeSeries","title":"CloudFront Metrics","region":"", { "Ref": "AWS::Region", }, @@ -9428,11 +9689,7 @@ Request a service quota increase for lambda functions", { "Ref": "ConstructHubWebAppDistribution1F181DC9", }, - "","Region","Global",{"region":"us-east-1","period":86400,"yAxis":"right"}]],"yAxis":{"left":{"label":"Requests count","min":0},"right":{"label":"Request Percent","min":0,"max":100}}}},{"type":"metric","width":12,"height":8,"x":0,"y":24,"properties":{"view":"timeSeries","title":"Construct Hub Inventory","region":"", - { - "Ref": "AWS::Region", - }, - "","metrics":[["ConstructHub/Inventory","PackageCount",{"period":900,"stat":"Maximum"}],["ConstructHub/Inventory","PackageMajorVersionCount",{"period":900,"stat":"Maximum"}]],"yAxis":{"left":{"label":"Package count"}}}}]}", + "","Region","Global",{"region":"us-east-1","period":86400,"yAxis":"right"}]],"yAxis":{"left":{"label":"Requests count","min":0},"right":{"label":"Request Percent","min":0,"max":100}}}}]}", ], ], }, @@ -14650,6 +14907,10 @@ def sort_filter_rules(json_obj): { "Ref": "ConstructHubOrchestrationRegenerateAllDocumentationE9FAB254", }, + ")\\n[button:Retry Uninstallable Packages](/states/home#/statemachines/view/", + { + "Ref": "ConstructHubOrchestrationRetryUninstallablePackagesA408F9B3", + }, ")"}},{"type":"metric","width":12,"height":6,"x":0,"y":99,"properties":{"view":"timeSeries","title":"State Machine Executions","region":"", { "Ref": "AWS::Region", @@ -14842,7 +15103,11 @@ def sort_filter_rules(json_obj): "Arn", ], }, - "","params":{"key":"uninstallable-objects/data.json","description":"These packages could not be installed. Note that currently they will also appear in the 'missing' documentation reports.\\n\\nThe specific error can be found in the package directory inside a file named 'uninstallable'\\n"},"title":"Package Versions Report | Uninstallable","updateOn":{"refresh":true,"resize":false,"timeRange":false}}},{"type":"custom","width":24,"height":6,"x":0,"y":6,"properties":{"endpoint":"", + "","params":{"key":"uninstallable-objects/data.json","description":"These packages could not be installed. Note that currently they will also appear in the 'missing' documentation reports.\\n\\nThe specific error can be found in the package directory inside a file named 'uninstallable'\\n\\n[button:primary:Retry Uninstallable Packages](/states/home#/statemachines/view/", + { + "Ref": "ConstructHubOrchestrationRetryUninstallablePackagesA408F9B3", + }, + ")\\n"},"title":"Package Versions Report | Uninstallable","updateOn":{"refresh":true,"resize":false,"timeRange":false}}},{"type":"custom","width":24,"height":6,"x":0,"y":6,"properties":{"endpoint":"", { "Fn::GetAtt": [ "PackageVersionsTableWidgetHandler5fa848259c1d5e388c0df69f05c016dfBE2C27C2", @@ -20683,16 +20948,231 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", ], "Version": "2012-10-17", }, - "PolicyName": "ConstructHubOrchestrationRegenerateAllDocumentationPerPackageRoleDefaultPolicy001A4726", + "PolicyName": "ConstructHubOrchestrationRegenerateAllDocumentationPerPackageRoleDefaultPolicy001A4726", + "Roles": [ + { + "Ref": "ConstructHubOrchestrationRegenerateAllDocumentationPerPackageRoleD7CCFA73", + }, + ], + }, + "Type": "AWS::IAM::Policy", + }, + "ConstructHubOrchestrationRegenerateAllDocumentationRole1C7D3B5F": { + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "states.amazonaws.com", + }, + }, + ], + "Version": "2012-10-17", + }, + }, + "Type": "AWS::IAM::Role", + }, + "ConstructHubOrchestrationRegenerateAllDocumentationRoleDefaultPolicy2F4FBD86": { + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "s3:ListBucket", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "ConstructHubPackageDataDC5EF35E", + "Arn", + ], + }, + }, + { + "Action": "states:StartExecution", + "Effect": "Allow", + "Resource": { + "Ref": "ConstructHubOrchestrationRegenerateAllDocumentationPerPackage9CF0FFB7", + }, + }, + { + "Action": [ + "states:DescribeExecution", + "states:StopExecution", + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition", + }, + ":states:", + { + "Ref": "AWS::Region", + }, + ":", + { + "Ref": "AWS::AccountId", + }, + ":execution:", + { + "Fn::Select": [ + 6, + { + "Fn::Split": [ + ":", + { + "Ref": "ConstructHubOrchestrationRegenerateAllDocumentationPerPackage9CF0FFB7", + }, + ], + }, + ], + }, + "*", + ], + ], + }, + }, + { + "Action": [ + "events:PutTargets", + "events:PutRule", + "events:DescribeRule", + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition", + }, + ":events:", + { + "Ref": "AWS::Region", + }, + ":", + { + "Ref": "AWS::AccountId", + }, + ":rule/StepFunctionsGetEventsForStepFunctionsExecutionRule", + ], + ], + }, + }, + { + "Action": [ + "xray:PutTraceSegments", + "xray:PutTelemetryRecords", + "xray:GetSamplingRules", + "xray:GetSamplingTargets", + ], + "Effect": "Allow", + "Resource": "*", + }, + { + "Action": [ + "s3:GetObject*", + "s3:GetBucket*", + "s3:List*", + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "ConstructHubPackageDataDC5EF35E", + "Arn", + ], + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "ConstructHubPackageDataDC5EF35E", + "Arn", + ], + }, + "/*", + ], + ], + }, + ], + }, + ], + "Version": "2012-10-17", + }, + "PolicyName": "ConstructHubOrchestrationRegenerateAllDocumentationRoleDefaultPolicy2F4FBD86", "Roles": [ { - "Ref": "ConstructHubOrchestrationRegenerateAllDocumentationPerPackageRoleD7CCFA73", + "Ref": "ConstructHubOrchestrationRegenerateAllDocumentationRole1C7D3B5F", }, ], }, "Type": "AWS::IAM::Policy", }, - "ConstructHubOrchestrationRegenerateAllDocumentationRole1C7D3B5F": { + "ConstructHubOrchestrationRetryUninstallablePackagesA408F9B3": { + "DeletionPolicy": "Delete", + "DependsOn": [ + "ConstructHubOrchestrationRetryUninstallablePackagesRoleDefaultPolicy7CB8A523", + "ConstructHubOrchestrationRetryUninstallablePackagesRole380D2573", + ], + "Properties": { + "DefinitionString": { + "Fn::Join": [ + "", + [ + "{"StartAt":"Read Uninstallable Report","States":{"Read Uninstallable Report":{"Next":"Parse Report","Retry":[{"ErrorEquals":["S3.NoSuchKey"]}],"Catch":[{"ErrorEquals":["S3.NoSuchKey"],"Next":"No Report Found"}],"Type":"Task","ResultPath":"$.reportResponse","Resource":"arn:", + { + "Ref": "AWS::Partition", + }, + ":states:::aws-sdk:s3:getObject","Parameters":{"Bucket":"", + { + "Ref": "ConstructHubPackageDataDC5EF35E", + }, + "","Key":"uninstallable-objects/data.json"}},"Parse Report":{"Type":"Pass","ResultPath":"$.parsedReport","Parameters":{"packages.$":"States.StringToJson($.reportResponse.Body)"},"Next":"Has Packages?"},"Has Packages?":{"Type":"Choice","Choices":[{"Variable":"$.parsedReport.packages[0]","IsPresent":true,"Next":"Process Each Package"}],"Default":"No Packages to Retry"},"No Packages to Retry":{"Type":"Succeed"},"Process Each Package":{"Type":"Map","ResultPath":null,"Next":"Run Inventory","ItemsPath":"$.parsedReport.packages","Iterator":{"StartAt":"Transform Package Format","States":{"Transform Package Format":{"Type":"Pass","ResultPath":"$.transformed","Parameters":{"packageName.$":"States.ArrayGetItem(States.StringSplit($, \\"@\\"), 0)","packageVersion.$":"States.ArrayGetItem(States.StringSplit($, \\"@\\"), 1)"},"Next":"Retry Package"},"Retry Package":{"End":true,"Retry":[{"ErrorEquals":["StepFunctions.ExecutionLimitExceeded"]}],"Catch":[{"ErrorEquals":["States.TaskFailed"],"Next":"Package Retry Failed"}],"Type":"Task","Resource":"arn:", + { + "Ref": "AWS::Partition", + }, + ":states:::states:startExecution.sync:2","Parameters":{"Input":{"Prefix.$":"States.Format('data/{}/v{}', $.transformed.packageName, $.transformed.packageVersion)"},"StateMachineArn":"", + { + "Ref": "ConstructHubOrchestrationRegenerateAllDocumentationPerPackage9CF0FFB7", + }, + ""}},"Package Retry Failed":{"Type":"Succeed"}}}},"Run Inventory":{"End":true,"Retry":[{"ErrorEquals":["Lambda.ClientExecutionTimeoutException","Lambda.ServiceException","Lambda.AWSLambdaException","Lambda.SdkClientException"],"IntervalSeconds":2,"MaxAttempts":6,"BackoffRate":2},{"ErrorEquals":["Lambda.TooManyRequestsException"]}],"Type":"Task","ResultPath":null,"Resource":"arn:", + { + "Ref": "AWS::Partition", + }, + ":states:::lambda:invoke","Parameters":{"FunctionName":"", + { + "Fn::GetAtt": [ + "ConstructHubInventoryCanary63D899BC", + "Arn", + ], + }, + "","Payload.$":"$"}},"No Report Found":{"Type":"Succeed"}},"TimeoutSeconds":21600}", + ], + ], + }, + "RoleArn": { + "Fn::GetAtt": [ + "ConstructHubOrchestrationRetryUninstallablePackagesRole380D2573", + "Arn", + ], + }, + "StateMachineName": "RetryUninstallablePackages", + "TracingConfiguration": { + "Enabled": true, + }, + }, + "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Delete", + }, + "ConstructHubOrchestrationRetryUninstallablePackagesRole380D2573": { "Properties": { "AssumeRolePolicyDocument": { "Statement": [ @@ -20709,20 +21189,54 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", }, "Type": "AWS::IAM::Role", }, - "ConstructHubOrchestrationRegenerateAllDocumentationRoleDefaultPolicy2F4FBD86": { + "ConstructHubOrchestrationRetryUninstallablePackagesRoleDefaultPolicy7CB8A523": { "Properties": { "PolicyDocument": { "Statement": [ { - "Action": "s3:ListBucket", + "Action": "s3:GetObject", "Effect": "Allow", "Resource": { - "Fn::GetAtt": [ - "ConstructHubPackageDataDC5EF35E", - "Arn", + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "ConstructHubPackageDataDC5EF35E", + "Arn", + ], + }, + "/uninstallable-objects/data.json", + ], ], }, }, + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "ConstructHubInventoryCanary63D899BC", + "Arn", + ], + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "ConstructHubInventoryCanary63D899BC", + "Arn", + ], + }, + ":*", + ], + ], + }, + ], + }, { "Action": "states:StartExecution", "Effect": "Allow", @@ -20842,10 +21356,10 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", ], "Version": "2012-10-17", }, - "PolicyName": "ConstructHubOrchestrationRegenerateAllDocumentationRoleDefaultPolicy2F4FBD86", + "PolicyName": "ConstructHubOrchestrationRetryUninstallablePackagesRoleDefaultPolicy7CB8A523", "Roles": [ { - "Ref": "ConstructHubOrchestrationRegenerateAllDocumentationRole1C7D3B5F", + "Ref": "ConstructHubOrchestrationRetryUninstallablePackagesRole380D2573", }, ], }, @@ -23430,31 +23944,35 @@ Request a service quota increase for lambda functions", { "Ref": "ConstructHubFeedBuilderReleaseNotesUpdateFeedBB0BA91D", }, - "",{"label":"updateFeedFunction","stat":"Maximum","visible":false,"id":"m3"}],[{"label":"CatalogBuilderLambda quota usage %","expression":"m4 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"updateFeedFunction","stat":"Maximum","visible":false,"id":"m3"}],[{"label":"CanaryResourceLambda quota usage %","expression":"m4 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + { + "Ref": "ConstructHubInventoryCanary63D899BC", + }, + "",{"label":"CanaryResourceLambda","stat":"Maximum","visible":false,"id":"m4"}],[{"label":"CatalogBuilderLambda quota usage %","expression":"m5 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubOrchestrationCatalogBuilder7C964951", }, - "",{"label":"CatalogBuilderLambda","stat":"Maximum","visible":false,"id":"m4"}],[{"label":"NeedsCatalogUpdateLambda quota usage %","expression":"m5 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"CatalogBuilderLambda","stat":"Maximum","visible":false,"id":"m5"}],[{"label":"NeedsCatalogUpdateLambda quota usage %","expression":"m6 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubOrchestrationNeedsCatalogUpdate5D7370DC", }, - "",{"label":"NeedsCatalogUpdateLambda","stat":"Maximum","visible":false,"id":"m5"}],[{"label":"IngestionLambda quota usage %","expression":"m6 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"NeedsCatalogUpdateLambda","stat":"Maximum","visible":false,"id":"m6"}],[{"label":"IngestionLambda quota usage %","expression":"m7 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubIngestion407909CE", }, - "",{"label":"IngestionLambda","stat":"Maximum","visible":false,"id":"m6"}],[{"label":"NpmJsLambda quota usage %","expression":"m7 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"IngestionLambda","stat":"Maximum","visible":false,"id":"m7"}],[{"label":"NpmJsLambda quota usage %","expression":"m8 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubSourcesNpmJs15A77D2D", }, - "",{"label":"NpmJsLambda","stat":"Maximum","visible":false,"id":"m7"}],[{"label":"NpmJs-StageAndNotifyLambda quota usage %","expression":"m8 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"NpmJsLambda","stat":"Maximum","visible":false,"id":"m8"}],[{"label":"NpmJs-StageAndNotifyLambda quota usage %","expression":"m9 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubSourcesNpmJsStageAndNotify591C0CFA", }, - "",{"label":"NpmJs-StageAndNotifyLambda","stat":"Maximum","visible":false,"id":"m8"}],[{"label":"CanaryResourceLambda quota usage %","expression":"m9 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"NpmJs-StageAndNotifyLambda","stat":"Maximum","visible":false,"id":"m9"}]],"annotations":{"horizontal":[{"value":70,"yAxis":"right"}]},"yAxis":{"right":{"label":"Quota Percent","min":0,"max":100}}}},{"type":"metric","width":12,"height":8,"x":0,"y":8,"properties":{"view":"timeSeries","title":"Construct Hub Inventory","region":"", { - "Ref": "ConstructHubInventoryCanary63D899BC", + "Ref": "AWS::Region", }, - "",{"label":"CanaryResourceLambda","stat":"Maximum","visible":false,"id":"m9"}]],"annotations":{"horizontal":[{"value":70,"yAxis":"right"}]},"yAxis":{"right":{"label":"Quota Percent","min":0,"max":100}}}},{"type":"custom","width":12,"height":8,"x":0,"y":8,"properties":{"endpoint":"", + "","metrics":[["ConstructHub/Inventory","PackageCount",{"period":900,"stat":"Maximum"}],["ConstructHub/Inventory","PackageMajorVersionCount",{"period":900,"stat":"Maximum"}]],"yAxis":{"left":{"label":"Package count"}}}},{"type":"custom","width":12,"height":8,"x":0,"y":16,"properties":{"endpoint":"", { "Fn::GetAtt": [ "SQSDLQStatsWidgetHandlerfc176846044f5e56baf2c71723501885366DDBD5", @@ -23510,7 +24028,7 @@ Request a service quota increase for lambda functions", "QueueName", ], }, - ""}}},"title":"SQS DLQ","updateOn":{"refresh":true,"resize":false,"timeRange":false}}},{"type":"metric","width":12,"height":8,"x":0,"y":16,"properties":{"view":"timeSeries","title":"CloudFront Metrics","region":"", + ""}}},"title":"SQS DLQ","updateOn":{"refresh":true,"resize":false,"timeRange":false}}},{"type":"metric","width":12,"height":8,"x":0,"y":24,"properties":{"view":"timeSeries","title":"CloudFront Metrics","region":"", { "Ref": "AWS::Region", }, @@ -23526,11 +24044,7 @@ Request a service quota increase for lambda functions", { "Ref": "ConstructHubWebAppDistribution1F181DC9", }, - "","Region","Global",{"region":"us-east-1","period":86400,"yAxis":"right"}]],"yAxis":{"left":{"label":"Requests count","min":0},"right":{"label":"Request Percent","min":0,"max":100}}}},{"type":"metric","width":12,"height":8,"x":0,"y":24,"properties":{"view":"timeSeries","title":"Construct Hub Inventory","region":"", - { - "Ref": "AWS::Region", - }, - "","metrics":[["ConstructHub/Inventory","PackageCount",{"period":900,"stat":"Maximum"}],["ConstructHub/Inventory","PackageMajorVersionCount",{"period":900,"stat":"Maximum"}]],"yAxis":{"left":{"label":"Package count"}}}}]}", + "","Region","Global",{"region":"us-east-1","period":86400,"yAxis":"right"}]],"yAxis":{"left":{"label":"Requests count","min":0},"right":{"label":"Request Percent","min":0,"max":100}}}}]}", ], ], }, @@ -28686,6 +29200,10 @@ def sort_filter_rules(json_obj): { "Ref": "ConstructHubOrchestrationRegenerateAllDocumentationE9FAB254", }, + ")\\n[button:Retry Uninstallable Packages](/states/home#/statemachines/view/", + { + "Ref": "ConstructHubOrchestrationRetryUninstallablePackagesA408F9B3", + }, ")"}},{"type":"metric","width":12,"height":6,"x":0,"y":99,"properties":{"view":"timeSeries","title":"State Machine Executions","region":"", { "Ref": "AWS::Region", @@ -28878,7 +29396,11 @@ def sort_filter_rules(json_obj): "Arn", ], }, - "","params":{"key":"uninstallable-objects/data.json","description":"These packages could not be installed. Note that currently they will also appear in the 'missing' documentation reports.\\n\\nThe specific error can be found in the package directory inside a file named 'uninstallable'\\n"},"title":"Package Versions Report | Uninstallable","updateOn":{"refresh":true,"resize":false,"timeRange":false}}},{"type":"custom","width":24,"height":6,"x":0,"y":6,"properties":{"endpoint":"", + "","params":{"key":"uninstallable-objects/data.json","description":"These packages could not be installed. Note that currently they will also appear in the 'missing' documentation reports.\\n\\nThe specific error can be found in the package directory inside a file named 'uninstallable'\\n\\n[button:primary:Retry Uninstallable Packages](/states/home#/statemachines/view/", + { + "Ref": "ConstructHubOrchestrationRetryUninstallablePackagesA408F9B3", + }, + ")\\n"},"title":"Package Versions Report | Uninstallable","updateOn":{"refresh":true,"resize":false,"timeRange":false}}},{"type":"custom","width":24,"height":6,"x":0,"y":6,"properties":{"endpoint":"", { "Fn::GetAtt": [ "PackageVersionsTableWidgetHandler5fa848259c1d5e388c0df69f05c016dfBE2C27C2", @@ -34418,16 +34940,231 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", ], "Version": "2012-10-17", }, - "PolicyName": "ConstructHubOrchestrationRegenerateAllDocumentationPerPackageRoleDefaultPolicy001A4726", + "PolicyName": "ConstructHubOrchestrationRegenerateAllDocumentationPerPackageRoleDefaultPolicy001A4726", + "Roles": [ + { + "Ref": "ConstructHubOrchestrationRegenerateAllDocumentationPerPackageRoleD7CCFA73", + }, + ], + }, + "Type": "AWS::IAM::Policy", + }, + "ConstructHubOrchestrationRegenerateAllDocumentationRole1C7D3B5F": { + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "states.amazonaws.com", + }, + }, + ], + "Version": "2012-10-17", + }, + }, + "Type": "AWS::IAM::Role", + }, + "ConstructHubOrchestrationRegenerateAllDocumentationRoleDefaultPolicy2F4FBD86": { + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "s3:ListBucket", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "ConstructHubPackageDataDC5EF35E", + "Arn", + ], + }, + }, + { + "Action": "states:StartExecution", + "Effect": "Allow", + "Resource": { + "Ref": "ConstructHubOrchestrationRegenerateAllDocumentationPerPackage9CF0FFB7", + }, + }, + { + "Action": [ + "states:DescribeExecution", + "states:StopExecution", + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition", + }, + ":states:", + { + "Ref": "AWS::Region", + }, + ":", + { + "Ref": "AWS::AccountId", + }, + ":execution:", + { + "Fn::Select": [ + 6, + { + "Fn::Split": [ + ":", + { + "Ref": "ConstructHubOrchestrationRegenerateAllDocumentationPerPackage9CF0FFB7", + }, + ], + }, + ], + }, + "*", + ], + ], + }, + }, + { + "Action": [ + "events:PutTargets", + "events:PutRule", + "events:DescribeRule", + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition", + }, + ":events:", + { + "Ref": "AWS::Region", + }, + ":", + { + "Ref": "AWS::AccountId", + }, + ":rule/StepFunctionsGetEventsForStepFunctionsExecutionRule", + ], + ], + }, + }, + { + "Action": [ + "xray:PutTraceSegments", + "xray:PutTelemetryRecords", + "xray:GetSamplingRules", + "xray:GetSamplingTargets", + ], + "Effect": "Allow", + "Resource": "*", + }, + { + "Action": [ + "s3:GetObject*", + "s3:GetBucket*", + "s3:List*", + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "ConstructHubPackageDataDC5EF35E", + "Arn", + ], + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "ConstructHubPackageDataDC5EF35E", + "Arn", + ], + }, + "/*", + ], + ], + }, + ], + }, + ], + "Version": "2012-10-17", + }, + "PolicyName": "ConstructHubOrchestrationRegenerateAllDocumentationRoleDefaultPolicy2F4FBD86", "Roles": [ { - "Ref": "ConstructHubOrchestrationRegenerateAllDocumentationPerPackageRoleD7CCFA73", + "Ref": "ConstructHubOrchestrationRegenerateAllDocumentationRole1C7D3B5F", }, ], }, "Type": "AWS::IAM::Policy", }, - "ConstructHubOrchestrationRegenerateAllDocumentationRole1C7D3B5F": { + "ConstructHubOrchestrationRetryUninstallablePackagesA408F9B3": { + "DeletionPolicy": "Delete", + "DependsOn": [ + "ConstructHubOrchestrationRetryUninstallablePackagesRoleDefaultPolicy7CB8A523", + "ConstructHubOrchestrationRetryUninstallablePackagesRole380D2573", + ], + "Properties": { + "DefinitionString": { + "Fn::Join": [ + "", + [ + "{"StartAt":"Read Uninstallable Report","States":{"Read Uninstallable Report":{"Next":"Parse Report","Retry":[{"ErrorEquals":["S3.NoSuchKey"]}],"Catch":[{"ErrorEquals":["S3.NoSuchKey"],"Next":"No Report Found"}],"Type":"Task","ResultPath":"$.reportResponse","Resource":"arn:", + { + "Ref": "AWS::Partition", + }, + ":states:::aws-sdk:s3:getObject","Parameters":{"Bucket":"", + { + "Ref": "ConstructHubPackageDataDC5EF35E", + }, + "","Key":"uninstallable-objects/data.json"}},"Parse Report":{"Type":"Pass","ResultPath":"$.parsedReport","Parameters":{"packages.$":"States.StringToJson($.reportResponse.Body)"},"Next":"Has Packages?"},"Has Packages?":{"Type":"Choice","Choices":[{"Variable":"$.parsedReport.packages[0]","IsPresent":true,"Next":"Process Each Package"}],"Default":"No Packages to Retry"},"No Packages to Retry":{"Type":"Succeed"},"Process Each Package":{"Type":"Map","ResultPath":null,"Next":"Run Inventory","ItemsPath":"$.parsedReport.packages","Iterator":{"StartAt":"Transform Package Format","States":{"Transform Package Format":{"Type":"Pass","ResultPath":"$.transformed","Parameters":{"packageName.$":"States.ArrayGetItem(States.StringSplit($, \\"@\\"), 0)","packageVersion.$":"States.ArrayGetItem(States.StringSplit($, \\"@\\"), 1)"},"Next":"Retry Package"},"Retry Package":{"End":true,"Retry":[{"ErrorEquals":["StepFunctions.ExecutionLimitExceeded"]}],"Catch":[{"ErrorEquals":["States.TaskFailed"],"Next":"Package Retry Failed"}],"Type":"Task","Resource":"arn:", + { + "Ref": "AWS::Partition", + }, + ":states:::states:startExecution.sync:2","Parameters":{"Input":{"Prefix.$":"States.Format('data/{}/v{}', $.transformed.packageName, $.transformed.packageVersion)"},"StateMachineArn":"", + { + "Ref": "ConstructHubOrchestrationRegenerateAllDocumentationPerPackage9CF0FFB7", + }, + ""}},"Package Retry Failed":{"Type":"Succeed"}}}},"Run Inventory":{"End":true,"Retry":[{"ErrorEquals":["Lambda.ClientExecutionTimeoutException","Lambda.ServiceException","Lambda.AWSLambdaException","Lambda.SdkClientException"],"IntervalSeconds":2,"MaxAttempts":6,"BackoffRate":2},{"ErrorEquals":["Lambda.TooManyRequestsException"]}],"Type":"Task","ResultPath":null,"Resource":"arn:", + { + "Ref": "AWS::Partition", + }, + ":states:::lambda:invoke","Parameters":{"FunctionName":"", + { + "Fn::GetAtt": [ + "ConstructHubInventoryCanary63D899BC", + "Arn", + ], + }, + "","Payload.$":"$"}},"No Report Found":{"Type":"Succeed"}},"TimeoutSeconds":21600}", + ], + ], + }, + "RoleArn": { + "Fn::GetAtt": [ + "ConstructHubOrchestrationRetryUninstallablePackagesRole380D2573", + "Arn", + ], + }, + "StateMachineName": "RetryUninstallablePackages", + "TracingConfiguration": { + "Enabled": true, + }, + }, + "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Delete", + }, + "ConstructHubOrchestrationRetryUninstallablePackagesRole380D2573": { "Properties": { "AssumeRolePolicyDocument": { "Statement": [ @@ -34444,20 +35181,54 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", }, "Type": "AWS::IAM::Role", }, - "ConstructHubOrchestrationRegenerateAllDocumentationRoleDefaultPolicy2F4FBD86": { + "ConstructHubOrchestrationRetryUninstallablePackagesRoleDefaultPolicy7CB8A523": { "Properties": { "PolicyDocument": { "Statement": [ { - "Action": "s3:ListBucket", + "Action": "s3:GetObject", "Effect": "Allow", "Resource": { - "Fn::GetAtt": [ - "ConstructHubPackageDataDC5EF35E", - "Arn", + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "ConstructHubPackageDataDC5EF35E", + "Arn", + ], + }, + "/uninstallable-objects/data.json", + ], ], }, }, + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "ConstructHubInventoryCanary63D899BC", + "Arn", + ], + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "ConstructHubInventoryCanary63D899BC", + "Arn", + ], + }, + ":*", + ], + ], + }, + ], + }, { "Action": "states:StartExecution", "Effect": "Allow", @@ -34577,10 +35348,10 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", ], "Version": "2012-10-17", }, - "PolicyName": "ConstructHubOrchestrationRegenerateAllDocumentationRoleDefaultPolicy2F4FBD86", + "PolicyName": "ConstructHubOrchestrationRetryUninstallablePackagesRoleDefaultPolicy7CB8A523", "Roles": [ { - "Ref": "ConstructHubOrchestrationRegenerateAllDocumentationRole1C7D3B5F", + "Ref": "ConstructHubOrchestrationRetryUninstallablePackagesRole380D2573", }, ], }, @@ -37092,31 +37863,35 @@ Request a service quota increase for lambda functions", { "Ref": "ConstructHubFeedBuilderReleaseNotesUpdateFeedBB0BA91D", }, - "",{"label":"updateFeedFunction","stat":"Maximum","visible":false,"id":"m3"}],[{"label":"CatalogBuilderLambda quota usage %","expression":"m4 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"updateFeedFunction","stat":"Maximum","visible":false,"id":"m3"}],[{"label":"CanaryResourceLambda quota usage %","expression":"m4 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + { + "Ref": "ConstructHubInventoryCanary63D899BC", + }, + "",{"label":"CanaryResourceLambda","stat":"Maximum","visible":false,"id":"m4"}],[{"label":"CatalogBuilderLambda quota usage %","expression":"m5 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubOrchestrationCatalogBuilder7C964951", }, - "",{"label":"CatalogBuilderLambda","stat":"Maximum","visible":false,"id":"m4"}],[{"label":"NeedsCatalogUpdateLambda quota usage %","expression":"m5 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"CatalogBuilderLambda","stat":"Maximum","visible":false,"id":"m5"}],[{"label":"NeedsCatalogUpdateLambda quota usage %","expression":"m6 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubOrchestrationNeedsCatalogUpdate5D7370DC", }, - "",{"label":"NeedsCatalogUpdateLambda","stat":"Maximum","visible":false,"id":"m5"}],[{"label":"IngestionLambda quota usage %","expression":"m6 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"NeedsCatalogUpdateLambda","stat":"Maximum","visible":false,"id":"m6"}],[{"label":"IngestionLambda quota usage %","expression":"m7 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubIngestion407909CE", }, - "",{"label":"IngestionLambda","stat":"Maximum","visible":false,"id":"m6"}],[{"label":"NpmJsLambda quota usage %","expression":"m7 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"IngestionLambda","stat":"Maximum","visible":false,"id":"m7"}],[{"label":"NpmJsLambda quota usage %","expression":"m8 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubSourcesNpmJs15A77D2D", }, - "",{"label":"NpmJsLambda","stat":"Maximum","visible":false,"id":"m7"}],[{"label":"NpmJs-StageAndNotifyLambda quota usage %","expression":"m8 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"NpmJsLambda","stat":"Maximum","visible":false,"id":"m8"}],[{"label":"NpmJs-StageAndNotifyLambda quota usage %","expression":"m9 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubSourcesNpmJsStageAndNotify591C0CFA", }, - "",{"label":"NpmJs-StageAndNotifyLambda","stat":"Maximum","visible":false,"id":"m8"}],[{"label":"CanaryResourceLambda quota usage %","expression":"m9 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"NpmJs-StageAndNotifyLambda","stat":"Maximum","visible":false,"id":"m9"}]],"annotations":{"horizontal":[{"value":70,"yAxis":"right"}]},"yAxis":{"right":{"label":"Quota Percent","min":0,"max":100}}}},{"type":"metric","width":12,"height":8,"x":0,"y":8,"properties":{"view":"timeSeries","title":"Construct Hub Inventory","region":"", { - "Ref": "ConstructHubInventoryCanary63D899BC", + "Ref": "AWS::Region", }, - "",{"label":"CanaryResourceLambda","stat":"Maximum","visible":false,"id":"m9"}]],"annotations":{"horizontal":[{"value":70,"yAxis":"right"}]},"yAxis":{"right":{"label":"Quota Percent","min":0,"max":100}}}},{"type":"custom","width":12,"height":8,"x":0,"y":8,"properties":{"endpoint":"", + "","metrics":[["ConstructHub/Inventory","PackageCount",{"period":900,"stat":"Maximum"}],["ConstructHub/Inventory","PackageMajorVersionCount",{"period":900,"stat":"Maximum"}]],"yAxis":{"left":{"label":"Package count"}}}},{"type":"custom","width":12,"height":8,"x":0,"y":16,"properties":{"endpoint":"", { "Fn::GetAtt": [ "SQSDLQStatsWidgetHandlerfc176846044f5e56baf2c71723501885366DDBD5", @@ -37172,7 +37947,7 @@ Request a service quota increase for lambda functions", "QueueName", ], }, - ""}}},"title":"SQS DLQ","updateOn":{"refresh":true,"resize":false,"timeRange":false}}},{"type":"metric","width":12,"height":8,"x":0,"y":16,"properties":{"view":"timeSeries","title":"CloudFront Metrics","region":"", + ""}}},"title":"SQS DLQ","updateOn":{"refresh":true,"resize":false,"timeRange":false}}},{"type":"metric","width":12,"height":8,"x":0,"y":24,"properties":{"view":"timeSeries","title":"CloudFront Metrics","region":"", { "Ref": "AWS::Region", }, @@ -37188,11 +37963,7 @@ Request a service quota increase for lambda functions", { "Ref": "ConstructHubWebAppDistribution1F181DC9", }, - "","Region","Global",{"region":"us-east-1","period":86400,"yAxis":"right"}]],"yAxis":{"left":{"label":"Requests count","min":0},"right":{"label":"Request Percent","min":0,"max":100}}}},{"type":"metric","width":12,"height":8,"x":0,"y":24,"properties":{"view":"timeSeries","title":"Construct Hub Inventory","region":"", - { - "Ref": "AWS::Region", - }, - "","metrics":[["ConstructHub/Inventory","PackageCount",{"period":900,"stat":"Maximum"}],["ConstructHub/Inventory","PackageMajorVersionCount",{"period":900,"stat":"Maximum"}]],"yAxis":{"left":{"label":"Package count"}}}}]}", + "","Region","Global",{"region":"us-east-1","period":86400,"yAxis":"right"}]],"yAxis":{"left":{"label":"Requests count","min":0},"right":{"label":"Request Percent","min":0,"max":100}}}}]}", ], ], }, @@ -42496,6 +43267,10 @@ def sort_filter_rules(json_obj): { "Ref": "ConstructHubOrchestrationRegenerateAllDocumentationE9FAB254", }, + ")\\n[button:Retry Uninstallable Packages](/states/home#/statemachines/view/", + { + "Ref": "ConstructHubOrchestrationRetryUninstallablePackagesA408F9B3", + }, ")"}},{"type":"metric","width":12,"height":6,"x":0,"y":99,"properties":{"view":"timeSeries","title":"State Machine Executions","region":"", { "Ref": "AWS::Region", @@ -42688,7 +43463,11 @@ def sort_filter_rules(json_obj): "Arn", ], }, - "","params":{"key":"uninstallable-objects/data.json","description":"These packages could not be installed. Note that currently they will also appear in the 'missing' documentation reports.\\n\\nThe specific error can be found in the package directory inside a file named 'uninstallable'\\n"},"title":"Package Versions Report | Uninstallable","updateOn":{"refresh":true,"resize":false,"timeRange":false}}},{"type":"custom","width":24,"height":6,"x":0,"y":6,"properties":{"endpoint":"", + "","params":{"key":"uninstallable-objects/data.json","description":"These packages could not be installed. Note that currently they will also appear in the 'missing' documentation reports.\\n\\nThe specific error can be found in the package directory inside a file named 'uninstallable'\\n\\n[button:primary:Retry Uninstallable Packages](/states/home#/statemachines/view/", + { + "Ref": "ConstructHubOrchestrationRetryUninstallablePackagesA408F9B3", + }, + ")\\n"},"title":"Package Versions Report | Uninstallable","updateOn":{"refresh":true,"resize":false,"timeRange":false}}},{"type":"custom","width":24,"height":6,"x":0,"y":6,"properties":{"endpoint":"", { "Fn::GetAtt": [ "PackageVersionsTableWidgetHandler5fa848259c1d5e388c0df69f05c016dfBE2C27C2", @@ -48237,16 +49016,231 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", ], "Version": "2012-10-17", }, - "PolicyName": "ConstructHubOrchestrationRegenerateAllDocumentationPerPackageRoleDefaultPolicy001A4726", + "PolicyName": "ConstructHubOrchestrationRegenerateAllDocumentationPerPackageRoleDefaultPolicy001A4726", + "Roles": [ + { + "Ref": "ConstructHubOrchestrationRegenerateAllDocumentationPerPackageRoleD7CCFA73", + }, + ], + }, + "Type": "AWS::IAM::Policy", + }, + "ConstructHubOrchestrationRegenerateAllDocumentationRole1C7D3B5F": { + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "states.amazonaws.com", + }, + }, + ], + "Version": "2012-10-17", + }, + }, + "Type": "AWS::IAM::Role", + }, + "ConstructHubOrchestrationRegenerateAllDocumentationRoleDefaultPolicy2F4FBD86": { + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "s3:ListBucket", + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "ConstructHubPackageDataDC5EF35E", + "Arn", + ], + }, + }, + { + "Action": "states:StartExecution", + "Effect": "Allow", + "Resource": { + "Ref": "ConstructHubOrchestrationRegenerateAllDocumentationPerPackage9CF0FFB7", + }, + }, + { + "Action": [ + "states:DescribeExecution", + "states:StopExecution", + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition", + }, + ":states:", + { + "Ref": "AWS::Region", + }, + ":", + { + "Ref": "AWS::AccountId", + }, + ":execution:", + { + "Fn::Select": [ + 6, + { + "Fn::Split": [ + ":", + { + "Ref": "ConstructHubOrchestrationRegenerateAllDocumentationPerPackage9CF0FFB7", + }, + ], + }, + ], + }, + "*", + ], + ], + }, + }, + { + "Action": [ + "events:PutTargets", + "events:PutRule", + "events:DescribeRule", + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition", + }, + ":events:", + { + "Ref": "AWS::Region", + }, + ":", + { + "Ref": "AWS::AccountId", + }, + ":rule/StepFunctionsGetEventsForStepFunctionsExecutionRule", + ], + ], + }, + }, + { + "Action": [ + "xray:PutTraceSegments", + "xray:PutTelemetryRecords", + "xray:GetSamplingRules", + "xray:GetSamplingTargets", + ], + "Effect": "Allow", + "Resource": "*", + }, + { + "Action": [ + "s3:GetObject*", + "s3:GetBucket*", + "s3:List*", + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "ConstructHubPackageDataDC5EF35E", + "Arn", + ], + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "ConstructHubPackageDataDC5EF35E", + "Arn", + ], + }, + "/*", + ], + ], + }, + ], + }, + ], + "Version": "2012-10-17", + }, + "PolicyName": "ConstructHubOrchestrationRegenerateAllDocumentationRoleDefaultPolicy2F4FBD86", "Roles": [ { - "Ref": "ConstructHubOrchestrationRegenerateAllDocumentationPerPackageRoleD7CCFA73", + "Ref": "ConstructHubOrchestrationRegenerateAllDocumentationRole1C7D3B5F", }, ], }, "Type": "AWS::IAM::Policy", }, - "ConstructHubOrchestrationRegenerateAllDocumentationRole1C7D3B5F": { + "ConstructHubOrchestrationRetryUninstallablePackagesA408F9B3": { + "DeletionPolicy": "Delete", + "DependsOn": [ + "ConstructHubOrchestrationRetryUninstallablePackagesRoleDefaultPolicy7CB8A523", + "ConstructHubOrchestrationRetryUninstallablePackagesRole380D2573", + ], + "Properties": { + "DefinitionString": { + "Fn::Join": [ + "", + [ + "{"StartAt":"Read Uninstallable Report","States":{"Read Uninstallable Report":{"Next":"Parse Report","Retry":[{"ErrorEquals":["S3.NoSuchKey"]}],"Catch":[{"ErrorEquals":["S3.NoSuchKey"],"Next":"No Report Found"}],"Type":"Task","ResultPath":"$.reportResponse","Resource":"arn:", + { + "Ref": "AWS::Partition", + }, + ":states:::aws-sdk:s3:getObject","Parameters":{"Bucket":"", + { + "Ref": "ConstructHubPackageDataDC5EF35E", + }, + "","Key":"uninstallable-objects/data.json"}},"Parse Report":{"Type":"Pass","ResultPath":"$.parsedReport","Parameters":{"packages.$":"States.StringToJson($.reportResponse.Body)"},"Next":"Has Packages?"},"Has Packages?":{"Type":"Choice","Choices":[{"Variable":"$.parsedReport.packages[0]","IsPresent":true,"Next":"Process Each Package"}],"Default":"No Packages to Retry"},"No Packages to Retry":{"Type":"Succeed"},"Process Each Package":{"Type":"Map","ResultPath":null,"Next":"Run Inventory","ItemsPath":"$.parsedReport.packages","Iterator":{"StartAt":"Transform Package Format","States":{"Transform Package Format":{"Type":"Pass","ResultPath":"$.transformed","Parameters":{"packageName.$":"States.ArrayGetItem(States.StringSplit($, \\"@\\"), 0)","packageVersion.$":"States.ArrayGetItem(States.StringSplit($, \\"@\\"), 1)"},"Next":"Retry Package"},"Retry Package":{"End":true,"Retry":[{"ErrorEquals":["StepFunctions.ExecutionLimitExceeded"]}],"Catch":[{"ErrorEquals":["States.TaskFailed"],"Next":"Package Retry Failed"}],"Type":"Task","Resource":"arn:", + { + "Ref": "AWS::Partition", + }, + ":states:::states:startExecution.sync:2","Parameters":{"Input":{"Prefix.$":"States.Format('data/{}/v{}', $.transformed.packageName, $.transformed.packageVersion)"},"StateMachineArn":"", + { + "Ref": "ConstructHubOrchestrationRegenerateAllDocumentationPerPackage9CF0FFB7", + }, + ""}},"Package Retry Failed":{"Type":"Succeed"}}}},"Run Inventory":{"End":true,"Retry":[{"ErrorEquals":["Lambda.ClientExecutionTimeoutException","Lambda.ServiceException","Lambda.AWSLambdaException","Lambda.SdkClientException"],"IntervalSeconds":2,"MaxAttempts":6,"BackoffRate":2},{"ErrorEquals":["Lambda.TooManyRequestsException"]}],"Type":"Task","ResultPath":null,"Resource":"arn:", + { + "Ref": "AWS::Partition", + }, + ":states:::lambda:invoke","Parameters":{"FunctionName":"", + { + "Fn::GetAtt": [ + "ConstructHubInventoryCanary63D899BC", + "Arn", + ], + }, + "","Payload.$":"$"}},"No Report Found":{"Type":"Succeed"}},"TimeoutSeconds":21600}", + ], + ], + }, + "RoleArn": { + "Fn::GetAtt": [ + "ConstructHubOrchestrationRetryUninstallablePackagesRole380D2573", + "Arn", + ], + }, + "StateMachineName": "RetryUninstallablePackages", + "TracingConfiguration": { + "Enabled": true, + }, + }, + "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Delete", + }, + "ConstructHubOrchestrationRetryUninstallablePackagesRole380D2573": { "Properties": { "AssumeRolePolicyDocument": { "Statement": [ @@ -48263,20 +49257,54 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", }, "Type": "AWS::IAM::Role", }, - "ConstructHubOrchestrationRegenerateAllDocumentationRoleDefaultPolicy2F4FBD86": { + "ConstructHubOrchestrationRetryUninstallablePackagesRoleDefaultPolicy7CB8A523": { "Properties": { "PolicyDocument": { "Statement": [ { - "Action": "s3:ListBucket", + "Action": "s3:GetObject", "Effect": "Allow", "Resource": { - "Fn::GetAtt": [ - "ConstructHubPackageDataDC5EF35E", - "Arn", + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "ConstructHubPackageDataDC5EF35E", + "Arn", + ], + }, + "/uninstallable-objects/data.json", + ], ], }, }, + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "ConstructHubInventoryCanary63D899BC", + "Arn", + ], + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "ConstructHubInventoryCanary63D899BC", + "Arn", + ], + }, + ":*", + ], + ], + }, + ], + }, { "Action": "states:StartExecution", "Effect": "Allow", @@ -48396,10 +49424,10 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", ], "Version": "2012-10-17", }, - "PolicyName": "ConstructHubOrchestrationRegenerateAllDocumentationRoleDefaultPolicy2F4FBD86", + "PolicyName": "ConstructHubOrchestrationRetryUninstallablePackagesRoleDefaultPolicy7CB8A523", "Roles": [ { - "Ref": "ConstructHubOrchestrationRegenerateAllDocumentationRole1C7D3B5F", + "Ref": "ConstructHubOrchestrationRetryUninstallablePackagesRole380D2573", }, ], }, @@ -50911,31 +51939,35 @@ Request a service quota increase for lambda functions", { "Ref": "ConstructHubFeedBuilderReleaseNotesUpdateFeedBB0BA91D", }, - "",{"label":"updateFeedFunction","stat":"Maximum","visible":false,"id":"m3"}],[{"label":"CatalogBuilderLambda quota usage %","expression":"m4 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"updateFeedFunction","stat":"Maximum","visible":false,"id":"m3"}],[{"label":"CanaryResourceLambda quota usage %","expression":"m4 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + { + "Ref": "ConstructHubInventoryCanary63D899BC", + }, + "",{"label":"CanaryResourceLambda","stat":"Maximum","visible":false,"id":"m4"}],[{"label":"CatalogBuilderLambda quota usage %","expression":"m5 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubOrchestrationCatalogBuilder7C964951", }, - "",{"label":"CatalogBuilderLambda","stat":"Maximum","visible":false,"id":"m4"}],[{"label":"NeedsCatalogUpdateLambda quota usage %","expression":"m5 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"CatalogBuilderLambda","stat":"Maximum","visible":false,"id":"m5"}],[{"label":"NeedsCatalogUpdateLambda quota usage %","expression":"m6 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubOrchestrationNeedsCatalogUpdate5D7370DC", }, - "",{"label":"NeedsCatalogUpdateLambda","stat":"Maximum","visible":false,"id":"m5"}],[{"label":"IngestionLambda quota usage %","expression":"m6 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"NeedsCatalogUpdateLambda","stat":"Maximum","visible":false,"id":"m6"}],[{"label":"IngestionLambda quota usage %","expression":"m7 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubIngestion407909CE", }, - "",{"label":"IngestionLambda","stat":"Maximum","visible":false,"id":"m6"}],[{"label":"NpmJsLambda quota usage %","expression":"m7 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"IngestionLambda","stat":"Maximum","visible":false,"id":"m7"}],[{"label":"NpmJsLambda quota usage %","expression":"m8 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubSourcesNpmJs15A77D2D", }, - "",{"label":"NpmJsLambda","stat":"Maximum","visible":false,"id":"m7"}],[{"label":"NpmJs-StageAndNotifyLambda quota usage %","expression":"m8 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"NpmJsLambda","stat":"Maximum","visible":false,"id":"m8"}],[{"label":"NpmJs-StageAndNotifyLambda quota usage %","expression":"m9 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubSourcesNpmJsStageAndNotify591C0CFA", }, - "",{"label":"NpmJs-StageAndNotifyLambda","stat":"Maximum","visible":false,"id":"m8"}],[{"label":"CanaryResourceLambda quota usage %","expression":"m9 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"NpmJs-StageAndNotifyLambda","stat":"Maximum","visible":false,"id":"m9"}]],"annotations":{"horizontal":[{"value":70,"yAxis":"right"}]},"yAxis":{"right":{"label":"Quota Percent","min":0,"max":100}}}},{"type":"metric","width":12,"height":8,"x":0,"y":8,"properties":{"view":"timeSeries","title":"Construct Hub Inventory","region":"", { - "Ref": "ConstructHubInventoryCanary63D899BC", + "Ref": "AWS::Region", }, - "",{"label":"CanaryResourceLambda","stat":"Maximum","visible":false,"id":"m9"}]],"annotations":{"horizontal":[{"value":70,"yAxis":"right"}]},"yAxis":{"right":{"label":"Quota Percent","min":0,"max":100}}}},{"type":"custom","width":12,"height":8,"x":0,"y":8,"properties":{"endpoint":"", + "","metrics":[["ConstructHub/Inventory","PackageCount",{"period":900,"stat":"Maximum"}],["ConstructHub/Inventory","PackageMajorVersionCount",{"period":900,"stat":"Maximum"}]],"yAxis":{"left":{"label":"Package count"}}}},{"type":"custom","width":12,"height":8,"x":0,"y":16,"properties":{"endpoint":"", { "Fn::GetAtt": [ "SQSDLQStatsWidgetHandlerfc176846044f5e56baf2c71723501885366DDBD5", @@ -50991,7 +52023,7 @@ Request a service quota increase for lambda functions", "QueueName", ], }, - ""}}},"title":"SQS DLQ","updateOn":{"refresh":true,"resize":false,"timeRange":false}}},{"type":"metric","width":12,"height":8,"x":0,"y":16,"properties":{"view":"timeSeries","title":"CloudFront Metrics","region":"", + ""}}},"title":"SQS DLQ","updateOn":{"refresh":true,"resize":false,"timeRange":false}}},{"type":"metric","width":12,"height":8,"x":0,"y":24,"properties":{"view":"timeSeries","title":"CloudFront Metrics","region":"", { "Ref": "AWS::Region", }, @@ -51007,11 +52039,7 @@ Request a service quota increase for lambda functions", { "Ref": "ConstructHubWebAppDistribution1F181DC9", }, - "","Region","Global",{"region":"us-east-1","period":86400,"yAxis":"right"}]],"yAxis":{"left":{"label":"Requests count","min":0},"right":{"label":"Request Percent","min":0,"max":100}}}},{"type":"metric","width":12,"height":8,"x":0,"y":24,"properties":{"view":"timeSeries","title":"Construct Hub Inventory","region":"", - { - "Ref": "AWS::Region", - }, - "","metrics":[["ConstructHub/Inventory","PackageCount",{"period":900,"stat":"Maximum"}],["ConstructHub/Inventory","PackageMajorVersionCount",{"period":900,"stat":"Maximum"}]],"yAxis":{"left":{"label":"Package count"}}}}]}", + "","Region","Global",{"region":"us-east-1","period":86400,"yAxis":"right"}]],"yAxis":{"left":{"label":"Requests count","min":0},"right":{"label":"Request Percent","min":0,"max":100}}}}]}", ], ], }, @@ -56489,6 +57517,10 @@ def sort_filter_rules(json_obj): { "Ref": "ConstructHubOrchestrationRegenerateAllDocumentationE9FAB254", }, + ")\\n[button:Retry Uninstallable Packages](/states/home#/statemachines/view/", + { + "Ref": "ConstructHubOrchestrationRetryUninstallablePackagesA408F9B3", + }, ")"}},{"type":"metric","width":12,"height":6,"x":0,"y":99,"properties":{"view":"timeSeries","title":"State Machine Executions","region":"", { "Ref": "AWS::Region", @@ -56681,7 +57713,11 @@ def sort_filter_rules(json_obj): "Arn", ], }, - "","params":{"key":"uninstallable-objects/data.json","description":"These packages could not be installed. Note that currently they will also appear in the 'missing' documentation reports.\\n\\nThe specific error can be found in the package directory inside a file named 'uninstallable'\\n"},"title":"Package Versions Report | Uninstallable","updateOn":{"refresh":true,"resize":false,"timeRange":false}}},{"type":"custom","width":24,"height":6,"x":0,"y":6,"properties":{"endpoint":"", + "","params":{"key":"uninstallable-objects/data.json","description":"These packages could not be installed. Note that currently they will also appear in the 'missing' documentation reports.\\n\\nThe specific error can be found in the package directory inside a file named 'uninstallable'\\n\\n[button:primary:Retry Uninstallable Packages](/states/home#/statemachines/view/", + { + "Ref": "ConstructHubOrchestrationRetryUninstallablePackagesA408F9B3", + }, + ")\\n"},"title":"Package Versions Report | Uninstallable","updateOn":{"refresh":true,"resize":false,"timeRange":false}}},{"type":"custom","width":24,"height":6,"x":0,"y":6,"properties":{"endpoint":"", { "Fn::GetAtt": [ "PackageVersionsTableWidgetHandler5fa848259c1d5e388c0df69f05c016dfBE2C27C2", @@ -62137,6 +63173,255 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", }, "Type": "AWS::IAM::Policy", }, + "ConstructHubOrchestrationRetryUninstallablePackagesA408F9B3": { + "DeletionPolicy": "Delete", + "DependsOn": [ + "ConstructHubOrchestrationRetryUninstallablePackagesRoleDefaultPolicy7CB8A523", + "ConstructHubOrchestrationRetryUninstallablePackagesRole380D2573", + ], + "Properties": { + "DefinitionString": { + "Fn::Join": [ + "", + [ + "{"StartAt":"Read Uninstallable Report","States":{"Read Uninstallable Report":{"Next":"Parse Report","Retry":[{"ErrorEquals":["S3.NoSuchKey"]}],"Catch":[{"ErrorEquals":["S3.NoSuchKey"],"Next":"No Report Found"}],"Type":"Task","ResultPath":"$.reportResponse","Resource":"arn:", + { + "Ref": "AWS::Partition", + }, + ":states:::aws-sdk:s3:getObject","Parameters":{"Bucket":"", + { + "Ref": "ConstructHubPackageDataDC5EF35E", + }, + "","Key":"uninstallable-objects/data.json"}},"Parse Report":{"Type":"Pass","ResultPath":"$.parsedReport","Parameters":{"packages.$":"States.StringToJson($.reportResponse.Body)"},"Next":"Has Packages?"},"Has Packages?":{"Type":"Choice","Choices":[{"Variable":"$.parsedReport.packages[0]","IsPresent":true,"Next":"Process Each Package"}],"Default":"No Packages to Retry"},"No Packages to Retry":{"Type":"Succeed"},"Process Each Package":{"Type":"Map","ResultPath":null,"Next":"Run Inventory","ItemsPath":"$.parsedReport.packages","Iterator":{"StartAt":"Transform Package Format","States":{"Transform Package Format":{"Type":"Pass","ResultPath":"$.transformed","Parameters":{"packageName.$":"States.ArrayGetItem(States.StringSplit($, \\"@\\"), 0)","packageVersion.$":"States.ArrayGetItem(States.StringSplit($, \\"@\\"), 1)"},"Next":"Retry Package"},"Retry Package":{"End":true,"Retry":[{"ErrorEquals":["StepFunctions.ExecutionLimitExceeded"]}],"Catch":[{"ErrorEquals":["States.TaskFailed"],"Next":"Package Retry Failed"}],"Type":"Task","Resource":"arn:", + { + "Ref": "AWS::Partition", + }, + ":states:::states:startExecution.sync:2","Parameters":{"Input":{"Prefix.$":"States.Format('data/{}/v{}', $.transformed.packageName, $.transformed.packageVersion)"},"StateMachineArn":"", + { + "Ref": "ConstructHubOrchestrationRegenerateAllDocumentationPerPackage9CF0FFB7", + }, + ""}},"Package Retry Failed":{"Type":"Succeed"}}}},"Run Inventory":{"End":true,"Retry":[{"ErrorEquals":["Lambda.ClientExecutionTimeoutException","Lambda.ServiceException","Lambda.AWSLambdaException","Lambda.SdkClientException"],"IntervalSeconds":2,"MaxAttempts":6,"BackoffRate":2},{"ErrorEquals":["Lambda.TooManyRequestsException"]}],"Type":"Task","ResultPath":null,"Resource":"arn:", + { + "Ref": "AWS::Partition", + }, + ":states:::lambda:invoke","Parameters":{"FunctionName":"", + { + "Fn::GetAtt": [ + "ConstructHubInventoryCanary63D899BC", + "Arn", + ], + }, + "","Payload.$":"$"}},"No Report Found":{"Type":"Succeed"}},"TimeoutSeconds":21600}", + ], + ], + }, + "RoleArn": { + "Fn::GetAtt": [ + "ConstructHubOrchestrationRetryUninstallablePackagesRole380D2573", + "Arn", + ], + }, + "StateMachineName": "RetryUninstallablePackages", + "TracingConfiguration": { + "Enabled": true, + }, + }, + "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Delete", + }, + "ConstructHubOrchestrationRetryUninstallablePackagesRole380D2573": { + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "states.amazonaws.com", + }, + }, + ], + "Version": "2012-10-17", + }, + }, + "Type": "AWS::IAM::Role", + }, + "ConstructHubOrchestrationRetryUninstallablePackagesRoleDefaultPolicy7CB8A523": { + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "s3:GetObject", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "ConstructHubPackageDataDC5EF35E", + "Arn", + ], + }, + "/uninstallable-objects/data.json", + ], + ], + }, + }, + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "ConstructHubInventoryCanary63D899BC", + "Arn", + ], + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "ConstructHubInventoryCanary63D899BC", + "Arn", + ], + }, + ":*", + ], + ], + }, + ], + }, + { + "Action": "states:StartExecution", + "Effect": "Allow", + "Resource": { + "Ref": "ConstructHubOrchestrationRegenerateAllDocumentationPerPackage9CF0FFB7", + }, + }, + { + "Action": [ + "states:DescribeExecution", + "states:StopExecution", + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition", + }, + ":states:", + { + "Ref": "AWS::Region", + }, + ":", + { + "Ref": "AWS::AccountId", + }, + ":execution:", + { + "Fn::Select": [ + 6, + { + "Fn::Split": [ + ":", + { + "Ref": "ConstructHubOrchestrationRegenerateAllDocumentationPerPackage9CF0FFB7", + }, + ], + }, + ], + }, + "*", + ], + ], + }, + }, + { + "Action": [ + "events:PutTargets", + "events:PutRule", + "events:DescribeRule", + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition", + }, + ":events:", + { + "Ref": "AWS::Region", + }, + ":", + { + "Ref": "AWS::AccountId", + }, + ":rule/StepFunctionsGetEventsForStepFunctionsExecutionRule", + ], + ], + }, + }, + { + "Action": [ + "xray:PutTraceSegments", + "xray:PutTelemetryRecords", + "xray:GetSamplingRules", + "xray:GetSamplingTargets", + ], + "Effect": "Allow", + "Resource": "*", + }, + { + "Action": [ + "s3:GetObject*", + "s3:GetBucket*", + "s3:List*", + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "ConstructHubPackageDataDC5EF35E", + "Arn", + ], + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "ConstructHubPackageDataDC5EF35E", + "Arn", + ], + }, + "/*", + ], + ], + }, + ], + }, + ], + "Version": "2012-10-17", + }, + "PolicyName": "ConstructHubOrchestrationRetryUninstallablePackagesRoleDefaultPolicy7CB8A523", + "Roles": [ + { + "Ref": "ConstructHubOrchestrationRetryUninstallablePackagesRole380D2573", + }, + ], + }, + "Type": "AWS::IAM::Policy", + }, "ConstructHubOrchestrationRoleDefaultPolicyEACD181F": { "DependsOn": [ "ConstructHubVPCIGW935F4C28", @@ -64649,31 +65934,35 @@ Request a service quota increase for lambda functions", { "Ref": "ConstructHubFeedBuilderReleaseNotesUpdateFeedBB0BA91D", }, - "",{"label":"updateFeedFunction","stat":"Maximum","visible":false,"id":"m3"}],[{"label":"CatalogBuilderLambda quota usage %","expression":"m4 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"updateFeedFunction","stat":"Maximum","visible":false,"id":"m3"}],[{"label":"CanaryResourceLambda quota usage %","expression":"m4 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + { + "Ref": "ConstructHubInventoryCanary63D899BC", + }, + "",{"label":"CanaryResourceLambda","stat":"Maximum","visible":false,"id":"m4"}],[{"label":"CatalogBuilderLambda quota usage %","expression":"m5 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubOrchestrationCatalogBuilder7C964951", }, - "",{"label":"CatalogBuilderLambda","stat":"Maximum","visible":false,"id":"m4"}],[{"label":"NeedsCatalogUpdateLambda quota usage %","expression":"m5 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"CatalogBuilderLambda","stat":"Maximum","visible":false,"id":"m5"}],[{"label":"NeedsCatalogUpdateLambda quota usage %","expression":"m6 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubOrchestrationNeedsCatalogUpdate5D7370DC", }, - "",{"label":"NeedsCatalogUpdateLambda","stat":"Maximum","visible":false,"id":"m5"}],[{"label":"IngestionLambda quota usage %","expression":"m6 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"NeedsCatalogUpdateLambda","stat":"Maximum","visible":false,"id":"m6"}],[{"label":"IngestionLambda quota usage %","expression":"m7 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubIngestion407909CE", }, - "",{"label":"IngestionLambda","stat":"Maximum","visible":false,"id":"m6"}],[{"label":"NpmJsLambda quota usage %","expression":"m7 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"IngestionLambda","stat":"Maximum","visible":false,"id":"m7"}],[{"label":"NpmJsLambda quota usage %","expression":"m8 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubSourcesNpmJs15A77D2D", }, - "",{"label":"NpmJsLambda","stat":"Maximum","visible":false,"id":"m7"}],[{"label":"NpmJs-StageAndNotifyLambda quota usage %","expression":"m8 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"NpmJsLambda","stat":"Maximum","visible":false,"id":"m8"}],[{"label":"NpmJs-StageAndNotifyLambda quota usage %","expression":"m9 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubSourcesNpmJsStageAndNotify591C0CFA", }, - "",{"label":"NpmJs-StageAndNotifyLambda","stat":"Maximum","visible":false,"id":"m8"}],[{"label":"CanaryResourceLambda quota usage %","expression":"m9 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"NpmJs-StageAndNotifyLambda","stat":"Maximum","visible":false,"id":"m9"}]],"annotations":{"horizontal":[{"value":70,"yAxis":"right"}]},"yAxis":{"right":{"label":"Quota Percent","min":0,"max":100}}}},{"type":"metric","width":12,"height":8,"x":0,"y":8,"properties":{"view":"timeSeries","title":"Construct Hub Inventory","region":"", { - "Ref": "ConstructHubInventoryCanary63D899BC", + "Ref": "AWS::Region", }, - "",{"label":"CanaryResourceLambda","stat":"Maximum","visible":false,"id":"m9"}]],"annotations":{"horizontal":[{"value":70,"yAxis":"right"}]},"yAxis":{"right":{"label":"Quota Percent","min":0,"max":100}}}},{"type":"custom","width":12,"height":8,"x":0,"y":8,"properties":{"endpoint":"", + "","metrics":[["ConstructHub/Inventory","PackageCount",{"period":900,"stat":"Maximum"}],["ConstructHub/Inventory","PackageMajorVersionCount",{"period":900,"stat":"Maximum"}]],"yAxis":{"left":{"label":"Package count"}}}},{"type":"custom","width":12,"height":8,"x":0,"y":16,"properties":{"endpoint":"", { "Fn::GetAtt": [ "SQSDLQStatsWidgetHandlerfc176846044f5e56baf2c71723501885366DDBD5", @@ -64729,7 +66018,7 @@ Request a service quota increase for lambda functions", "QueueName", ], }, - ""}}},"title":"SQS DLQ","updateOn":{"refresh":true,"resize":false,"timeRange":false}}},{"type":"metric","width":12,"height":8,"x":0,"y":16,"properties":{"view":"timeSeries","title":"CloudFront Metrics","region":"", + ""}}},"title":"SQS DLQ","updateOn":{"refresh":true,"resize":false,"timeRange":false}}},{"type":"metric","width":12,"height":8,"x":0,"y":24,"properties":{"view":"timeSeries","title":"CloudFront Metrics","region":"", { "Ref": "AWS::Region", }, @@ -64745,11 +66034,7 @@ Request a service quota increase for lambda functions", { "Ref": "ConstructHubWebAppDistribution1F181DC9", }, - "","Region","Global",{"region":"us-east-1","period":86400,"yAxis":"right"}]],"yAxis":{"left":{"label":"Requests count","min":0},"right":{"label":"Request Percent","min":0,"max":100}}}},{"type":"metric","width":12,"height":8,"x":0,"y":24,"properties":{"view":"timeSeries","title":"Construct Hub Inventory","region":"", - { - "Ref": "AWS::Region", - }, - "","metrics":[["ConstructHub/Inventory","PackageCount",{"period":900,"stat":"Maximum"}],["ConstructHub/Inventory","PackageMajorVersionCount",{"period":900,"stat":"Maximum"}]],"yAxis":{"left":{"label":"Package count"}}}}]}", + "","Region","Global",{"region":"us-east-1","period":86400,"yAxis":"right"}]],"yAxis":{"left":{"label":"Requests count","min":0},"right":{"label":"Request Percent","min":0,"max":100}}}}]}", ], ], }, diff --git a/src/__tests__/devapp/__snapshots__/snapshot.test.ts.snap b/src/__tests__/devapp/__snapshots__/snapshot.test.ts.snap index 675d860ca..568771237 100644 --- a/src/__tests__/devapp/__snapshots__/snapshot.test.ts.snap +++ b/src/__tests__/devapp/__snapshots__/snapshot.test.ts.snap @@ -988,6 +988,10 @@ def sort_filter_rules(json_obj): { "Ref": "ConstructHubOrchestrationRegenerateAllDocumentationE9FAB254", }, + ")\\n[button:Retry Uninstallable Packages](/states/home#/statemachines/view/", + { + "Ref": "ConstructHubOrchestrationRetryUninstallablePackagesA408F9B3", + }, ")"}},{"type":"metric","width":12,"height":6,"x":0,"y":99,"properties":{"view":"timeSeries","title":"State Machine Executions","region":"", { "Ref": "AWS::Region", @@ -1253,7 +1257,11 @@ def sort_filter_rules(json_obj): "Arn", ], }, - "","params":{"key":"uninstallable-objects/data.json","description":"These packages could not be installed. Note that currently they will also appear in the 'missing' documentation reports.\\n\\nThe specific error can be found in the package directory inside a file named 'uninstallable'\\n"},"title":"Package Versions Report | Uninstallable","updateOn":{"refresh":true,"resize":false,"timeRange":false}}},{"type":"custom","width":24,"height":6,"x":0,"y":6,"properties":{"endpoint":"", + "","params":{"key":"uninstallable-objects/data.json","description":"These packages could not be installed. Note that currently they will also appear in the 'missing' documentation reports.\\n\\nThe specific error can be found in the package directory inside a file named 'uninstallable'\\n\\n[button:primary:Retry Uninstallable Packages](/states/home#/statemachines/view/", + { + "Ref": "ConstructHubOrchestrationRetryUninstallablePackagesA408F9B3", + }, + ")\\n"},"title":"Package Versions Report | Uninstallable","updateOn":{"refresh":true,"resize":false,"timeRange":false}}},{"type":"custom","width":24,"height":6,"x":0,"y":6,"properties":{"endpoint":"", { "Fn::GetAtt": [ "PackageVersionsTableWidgetHandler5fa848259c1d5e388c0df69f05c016dfBE2C27C2", @@ -7042,6 +7050,255 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", }, "Type": "AWS::IAM::Policy", }, + "ConstructHubOrchestrationRetryUninstallablePackagesA408F9B3": { + "DeletionPolicy": "Delete", + "DependsOn": [ + "ConstructHubOrchestrationRetryUninstallablePackagesRoleDefaultPolicy7CB8A523", + "ConstructHubOrchestrationRetryUninstallablePackagesRole380D2573", + ], + "Properties": { + "DefinitionString": { + "Fn::Join": [ + "", + [ + "{"StartAt":"Read Uninstallable Report","States":{"Read Uninstallable Report":{"Next":"Parse Report","Retry":[{"ErrorEquals":["S3.NoSuchKey"]}],"Catch":[{"ErrorEquals":["S3.NoSuchKey"],"Next":"No Report Found"}],"Type":"Task","ResultPath":"$.reportResponse","Resource":"arn:", + { + "Ref": "AWS::Partition", + }, + ":states:::aws-sdk:s3:getObject","Parameters":{"Bucket":"", + { + "Ref": "ConstructHubPackageDataDC5EF35E", + }, + "","Key":"uninstallable-objects/data.json"}},"Parse Report":{"Type":"Pass","ResultPath":"$.parsedReport","Parameters":{"packages.$":"States.StringToJson($.reportResponse.Body)"},"Next":"Has Packages?"},"Has Packages?":{"Type":"Choice","Choices":[{"Variable":"$.parsedReport.packages[0]","IsPresent":true,"Next":"Process Each Package"}],"Default":"No Packages to Retry"},"No Packages to Retry":{"Type":"Succeed"},"Process Each Package":{"Type":"Map","ResultPath":null,"Next":"Run Inventory","ItemsPath":"$.parsedReport.packages","Iterator":{"StartAt":"Transform Package Format","States":{"Transform Package Format":{"Type":"Pass","ResultPath":"$.transformed","Parameters":{"packageName.$":"States.ArrayGetItem(States.StringSplit($, \\"@\\"), 0)","packageVersion.$":"States.ArrayGetItem(States.StringSplit($, \\"@\\"), 1)"},"Next":"Retry Package"},"Retry Package":{"End":true,"Retry":[{"ErrorEquals":["StepFunctions.ExecutionLimitExceeded"]}],"Catch":[{"ErrorEquals":["States.TaskFailed"],"Next":"Package Retry Failed"}],"Type":"Task","Resource":"arn:", + { + "Ref": "AWS::Partition", + }, + ":states:::states:startExecution.sync:2","Parameters":{"Input":{"Prefix.$":"States.Format('data/{}/v{}', $.transformed.packageName, $.transformed.packageVersion)"},"StateMachineArn":"", + { + "Ref": "ConstructHubOrchestrationRegenerateAllDocumentationPerPackage9CF0FFB7", + }, + ""}},"Package Retry Failed":{"Type":"Succeed"}}}},"Run Inventory":{"End":true,"Retry":[{"ErrorEquals":["Lambda.ClientExecutionTimeoutException","Lambda.ServiceException","Lambda.AWSLambdaException","Lambda.SdkClientException"],"IntervalSeconds":2,"MaxAttempts":6,"BackoffRate":2},{"ErrorEquals":["Lambda.TooManyRequestsException"]}],"Type":"Task","ResultPath":null,"Resource":"arn:", + { + "Ref": "AWS::Partition", + }, + ":states:::lambda:invoke","Parameters":{"FunctionName":"", + { + "Fn::GetAtt": [ + "ConstructHubInventoryCanary63D899BC", + "Arn", + ], + }, + "","Payload.$":"$"}},"No Report Found":{"Type":"Succeed"}},"TimeoutSeconds":21600}", + ], + ], + }, + "RoleArn": { + "Fn::GetAtt": [ + "ConstructHubOrchestrationRetryUninstallablePackagesRole380D2573", + "Arn", + ], + }, + "StateMachineName": "RetryUninstallablePackages", + "TracingConfiguration": { + "Enabled": true, + }, + }, + "Type": "AWS::StepFunctions::StateMachine", + "UpdateReplacePolicy": "Delete", + }, + "ConstructHubOrchestrationRetryUninstallablePackagesRole380D2573": { + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "states.amazonaws.com", + }, + }, + ], + "Version": "2012-10-17", + }, + }, + "Type": "AWS::IAM::Role", + }, + "ConstructHubOrchestrationRetryUninstallablePackagesRoleDefaultPolicy7CB8A523": { + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "s3:GetObject", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "ConstructHubPackageDataDC5EF35E", + "Arn", + ], + }, + "/uninstallable-objects/data.json", + ], + ], + }, + }, + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "ConstructHubInventoryCanary63D899BC", + "Arn", + ], + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "ConstructHubInventoryCanary63D899BC", + "Arn", + ], + }, + ":*", + ], + ], + }, + ], + }, + { + "Action": "states:StartExecution", + "Effect": "Allow", + "Resource": { + "Ref": "ConstructHubOrchestrationRegenerateAllDocumentationPerPackage9CF0FFB7", + }, + }, + { + "Action": [ + "states:DescribeExecution", + "states:StopExecution", + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition", + }, + ":states:", + { + "Ref": "AWS::Region", + }, + ":", + { + "Ref": "AWS::AccountId", + }, + ":execution:", + { + "Fn::Select": [ + 6, + { + "Fn::Split": [ + ":", + { + "Ref": "ConstructHubOrchestrationRegenerateAllDocumentationPerPackage9CF0FFB7", + }, + ], + }, + ], + }, + "*", + ], + ], + }, + }, + { + "Action": [ + "events:PutTargets", + "events:PutRule", + "events:DescribeRule", + ], + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition", + }, + ":events:", + { + "Ref": "AWS::Region", + }, + ":", + { + "Ref": "AWS::AccountId", + }, + ":rule/StepFunctionsGetEventsForStepFunctionsExecutionRule", + ], + ], + }, + }, + { + "Action": [ + "xray:PutTraceSegments", + "xray:PutTelemetryRecords", + "xray:GetSamplingRules", + "xray:GetSamplingTargets", + ], + "Effect": "Allow", + "Resource": "*", + }, + { + "Action": [ + "s3:GetObject*", + "s3:GetBucket*", + "s3:List*", + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "ConstructHubPackageDataDC5EF35E", + "Arn", + ], + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "ConstructHubPackageDataDC5EF35E", + "Arn", + ], + }, + "/*", + ], + ], + }, + ], + }, + ], + "Version": "2012-10-17", + }, + "PolicyName": "ConstructHubOrchestrationRetryUninstallablePackagesRoleDefaultPolicy7CB8A523", + "Roles": [ + { + "Ref": "ConstructHubOrchestrationRetryUninstallablePackagesRole380D2573", + }, + ], + }, + "Type": "AWS::IAM::Policy", + }, "ConstructHubOrchestrationRoleDefaultPolicyEACD181F": { "Properties": { "PolicyDocument": { @@ -9654,39 +9911,43 @@ Request a service quota increase for lambda functions", { "Ref": "ConstructHubFeedBuilderReleaseNotesUpdateFeedBB0BA91D", }, - "",{"label":"updateFeedFunction","stat":"Maximum","visible":false,"id":"m3"}],[{"label":"CatalogBuilderLambda quota usage %","expression":"m4 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"updateFeedFunction","stat":"Maximum","visible":false,"id":"m3"}],[{"label":"CanaryResourceLambda quota usage %","expression":"m4 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + { + "Ref": "ConstructHubInventoryCanary63D899BC", + }, + "",{"label":"CanaryResourceLambda","stat":"Maximum","visible":false,"id":"m4"}],[{"label":"CatalogBuilderLambda quota usage %","expression":"m5 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubOrchestrationCatalogBuilder7C964951", }, - "",{"label":"CatalogBuilderLambda","stat":"Maximum","visible":false,"id":"m4"}],[{"label":"NeedsCatalogUpdateLambda quota usage %","expression":"m5 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"CatalogBuilderLambda","stat":"Maximum","visible":false,"id":"m5"}],[{"label":"NeedsCatalogUpdateLambda quota usage %","expression":"m6 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubOrchestrationNeedsCatalogUpdate5D7370DC", }, - "",{"label":"NeedsCatalogUpdateLambda","stat":"Maximum","visible":false,"id":"m5"}],[{"label":"releaseNotesTrigger quota usage %","expression":"m6 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"NeedsCatalogUpdateLambda","stat":"Maximum","visible":false,"id":"m6"}],[{"label":"releaseNotesTrigger quota usage %","expression":"m7 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubReleaseNotesReleaseNotesTriggerDD939C4F", }, - "",{"label":"releaseNotesTrigger","stat":"Maximum","visible":false,"id":"m6"}],[{"label":"releaseNoteGenerateForPackage quota usage %","expression":"m7 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"releaseNotesTrigger","stat":"Maximum","visible":false,"id":"m7"}],[{"label":"releaseNoteGenerateForPackage quota usage %","expression":"m8 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubReleaseNotesGithubChangelogFetcher1616748C", }, - "",{"label":"releaseNoteGenerateForPackage","stat":"Maximum","visible":false,"id":"m7"}],[{"label":"IngestionLambda quota usage %","expression":"m8 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"releaseNoteGenerateForPackage","stat":"Maximum","visible":false,"id":"m8"}],[{"label":"IngestionLambda quota usage %","expression":"m9 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubIngestion407909CE", }, - "",{"label":"IngestionLambda","stat":"Maximum","visible":false,"id":"m8"}],[{"label":"NpmJsLambda quota usage %","expression":"m9 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"IngestionLambda","stat":"Maximum","visible":false,"id":"m9"}],[{"label":"NpmJsLambda quota usage %","expression":"m10 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubSourcesNpmJs15A77D2D", }, - "",{"label":"NpmJsLambda","stat":"Maximum","visible":false,"id":"m9"}],[{"label":"NpmJs-StageAndNotifyLambda quota usage %","expression":"m10 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"NpmJsLambda","stat":"Maximum","visible":false,"id":"m10"}],[{"label":"NpmJs-StageAndNotifyLambda quota usage %","expression":"m11 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubSourcesNpmJsStageAndNotify591C0CFA", }, - "",{"label":"NpmJs-StageAndNotifyLambda","stat":"Maximum","visible":false,"id":"m10"}],[{"label":"CanaryResourceLambda quota usage %","expression":"m11 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"NpmJs-StageAndNotifyLambda","stat":"Maximum","visible":false,"id":"m11"}]],"annotations":{"horizontal":[{"value":70,"yAxis":"right"}]},"yAxis":{"right":{"label":"Quota Percent","min":0,"max":100}}}},{"type":"metric","width":12,"height":8,"x":0,"y":8,"properties":{"view":"timeSeries","title":"Construct Hub Inventory","region":"", { - "Ref": "ConstructHubInventoryCanary63D899BC", + "Ref": "AWS::Region", }, - "",{"label":"CanaryResourceLambda","stat":"Maximum","visible":false,"id":"m11"}]],"annotations":{"horizontal":[{"value":70,"yAxis":"right"}]},"yAxis":{"right":{"label":"Quota Percent","min":0,"max":100}}}},{"type":"custom","width":12,"height":8,"x":0,"y":8,"properties":{"endpoint":"", + "","metrics":[["ConstructHub/Inventory","PackageCount",{"period":900,"stat":"Maximum"}],["ConstructHub/Inventory","PackageMajorVersionCount",{"period":900,"stat":"Maximum"}]],"yAxis":{"left":{"label":"Package count"}}}},{"type":"custom","width":12,"height":8,"x":0,"y":16,"properties":{"endpoint":"", { "Fn::GetAtt": [ "SQSDLQStatsWidgetHandlerfc176846044f5e56baf2c71723501885366DDBD5", @@ -9756,7 +10017,7 @@ Request a service quota increase for lambda functions", "QueueName", ], }, - ""}}},"title":"SQS DLQ","updateOn":{"refresh":true,"resize":false,"timeRange":false}}},{"type":"metric","width":12,"height":8,"x":0,"y":16,"properties":{"view":"timeSeries","title":"CloudFront Metrics","region":"", + ""}}},"title":"SQS DLQ","updateOn":{"refresh":true,"resize":false,"timeRange":false}}},{"type":"metric","width":12,"height":8,"x":0,"y":24,"properties":{"view":"timeSeries","title":"CloudFront Metrics","region":"", { "Ref": "AWS::Region", }, @@ -9772,11 +10033,7 @@ Request a service quota increase for lambda functions", { "Ref": "ConstructHubWebAppDistribution1F181DC9", }, - "","Region","Global",{"region":"us-east-1","period":86400,"yAxis":"right"}]],"yAxis":{"left":{"label":"Requests count","min":0},"right":{"label":"Request Percent","min":0,"max":100}}}},{"type":"metric","width":12,"height":8,"x":0,"y":24,"properties":{"view":"timeSeries","title":"Construct Hub Inventory","region":"", - { - "Ref": "AWS::Region", - }, - "","metrics":[["ConstructHub/Inventory","PackageCount",{"period":900,"stat":"Maximum"}],["ConstructHub/Inventory","PackageMajorVersionCount",{"period":900,"stat":"Maximum"}]],"yAxis":{"left":{"label":"Package count"}}}}]}", + "","Region","Global",{"region":"us-east-1","period":86400,"yAxis":"right"}]],"yAxis":{"left":{"label":"Requests count","min":0},"right":{"label":"Request Percent","min":0,"max":100}}}}]}", ], ], }, From 0578d86580dafdae89f309b1363e56b6b4d6f326 Mon Sep 17 00:00:00 2001 From: Momo Kornher Date: Thu, 20 Nov 2025 12:14:43 +0000 Subject: [PATCH 03/18] fixup --- .../orchestration/retry-uninstallable-packages.ts | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/backend/orchestration/retry-uninstallable-packages.ts b/src/backend/orchestration/retry-uninstallable-packages.ts index 077b0e3e3..6e436ffa6 100644 --- a/src/backend/orchestration/retry-uninstallable-packages.ts +++ b/src/backend/orchestration/retry-uninstallable-packages.ts @@ -71,12 +71,11 @@ export class RetryUninstallablePackages extends Construct { resultPath: '$.parsedReport', }); - // Transform package@version to data/package/vversion format + // Transform package@version to data/package/v{version} format const transformPackage = new Pass(this, 'Transform Package Format', { parameters: { - 'packageName.$': 'States.ArrayGetItem(States.StringSplit($, "@"), 0)', - 'packageVersion.$': - 'States.ArrayGetItem(States.StringSplit($, "@"), 1)', + 'prefix.$': + 'States.Format("data/{}/v{}", States.ArrayGetItem(States.StringSplit($, "@"), 0), States.ArrayGetItem(States.StringSplit($, "@"), 1))', }, resultPath: '$.transformed', }); @@ -90,11 +89,7 @@ export class RetryUninstallablePackages extends Construct { new tasks.StepFunctionsStartExecution(this, 'Retry Package', { stateMachine: props.reprocessStateMachine, input: TaskInput.fromObject({ - Prefix: JsonPath.format( - 'data/{}/v{}', - JsonPath.stringAt('$.transformed.packageName'), - JsonPath.stringAt('$.transformed.packageVersion') - ), + Prefix: JsonPath.stringAt('$.transformed.prefix'), }), integrationPattern: IntegrationPattern.RUN_JOB, }) From b98ebdf9fc877fca42f8aa4536c69d7d678cc999 Mon Sep 17 00:00:00 2001 From: Momo Kornher Date: Thu, 20 Nov 2025 12:35:59 +0000 Subject: [PATCH 04/18] fix? --- .../retry-uninstallable-packages.ts | 41 +++++++++---------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/src/backend/orchestration/retry-uninstallable-packages.ts b/src/backend/orchestration/retry-uninstallable-packages.ts index 6e436ffa6..880a5d604 100644 --- a/src/backend/orchestration/retry-uninstallable-packages.ts +++ b/src/backend/orchestration/retry-uninstallable-packages.ts @@ -71,33 +71,32 @@ export class RetryUninstallablePackages extends Construct { resultPath: '$.parsedReport', }); - // Transform package@version to data/package/v{version} format - const transformPackage = new Pass(this, 'Transform Package Format', { - parameters: { - 'prefix.$': - 'States.Format("data/{}/v{}", States.ArrayGetItem(States.StringSplit($, "@"), 0), States.ArrayGetItem(States.StringSplit($, "@"), 1))', - }, - resultPath: '$.transformed', - }); - // Process each uninstallable package const processPackages = new Map(this, 'Process Each Package', { itemsPath: '$.parsedReport.packages', resultPath: JsonPath.DISCARD, }).iterator( - transformPackage.next( - new tasks.StepFunctionsStartExecution(this, 'Retry Package', { - stateMachine: props.reprocessStateMachine, - input: TaskInput.fromObject({ - Prefix: JsonPath.stringAt('$.transformed.prefix'), - }), - integrationPattern: IntegrationPattern.RUN_JOB, + new tasks.StepFunctionsStartExecution(this, 'Retry Package', { + stateMachine: props.reprocessStateMachine, + input: TaskInput.fromObject({ + Prefix: JsonPath.format( + 'data/{}/v{}', + JsonPath.arrayGetItem( + JsonPath.stringSplit(JsonPath.stringAt('$'), '@'), + 0 + ), + JsonPath.arrayGetItem( + JsonPath.stringSplit(JsonPath.stringAt('$'), '@'), + 1 + ) + ), + }), + integrationPattern: IntegrationPattern.RUN_JOB, + }) + .addRetry({ errors: ['StepFunctions.ExecutionLimitExceeded'] }) + .addCatch(new Succeed(this, 'Package Retry Failed'), { + errors: ['States.TaskFailed'], }) - .addRetry({ errors: ['StepFunctions.ExecutionLimitExceeded'] }) - .addCatch(new Succeed(this, 'Package Retry Failed'), { - errors: ['States.TaskFailed'], - }) - ) ); // Re-run inventory canary to update the report From 02d5e4b645a5678231c80a7607c75bd7ad96587e Mon Sep 17 00:00:00 2001 From: Momo Kornher Date: Thu, 20 Nov 2025 12:58:51 +0000 Subject: [PATCH 05/18] save --- retry-uninstallable-packages.json | 83 +++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 retry-uninstallable-packages.json diff --git a/retry-uninstallable-packages.json b/retry-uninstallable-packages.json new file mode 100644 index 000000000..1d2ea1081 --- /dev/null +++ b/retry-uninstallable-packages.json @@ -0,0 +1,83 @@ +{ + "Comment": "State machine that retries processing of uninstallable packages", + "StartAt": "Process Each Package", + "States": { + "Process Each Package": { + "Type": "Map", + "ItemReader": { + "Resource": "arn:aws:states:::s3:getObject", + "ReaderConfig": { + "InputType": "JSON" + }, + "Parameters": { + "Bucket": "constructhub-gamma-constructhubpackagedatadc5ef35-qde3kml6fwa5", + "Key": "uninstallable-objects/data.json" + } + }, + "ResultPath": null, + "Iterator": { + "StartAt": "Transform Package Format", + "States": { + "Transform Package Format": { + "Type": "Pass", + "Parameters": { + "packageName.$": "States.ArrayGetItem(States.StringSplit($, '@'), 0)", + "packageVersion.$": "States.ArrayGetItem(States.StringSplit($, '@'), 1)" + }, + "ResultPath": "$.transformed", + "Next": "Retry Package" + }, + "Retry Package": { + "Type": "Task", + "Resource": "arn:aws:states:::states:startExecution.sync:2", + "Parameters": { + "StateMachineArn": "arn:aws:states:us-east-1:363076331236:stateMachine:ReprocessDocumentationPerPackage", + "Input": { + "Prefix.$": "States.Format('data/{}/v{}', $.transformed.packageName, $.transformed.packageVersion)" + } + }, + "Retry": [ + { + "ErrorEquals": ["StepFunctions.ExecutionLimitExceeded"], + "IntervalSeconds": 60, + "MaxAttempts": 30, + "BackoffRate": 1.1 + } + ], + "Catch": [ + { + "ErrorEquals": ["States.TaskFailed"], + "Next": "Package Retry Failed" + } + ], + "End": true + }, + "Package Retry Failed": { + "Type": "Succeed" + } + } + }, + "Next": "Run Inventory" + }, + "Run Inventory": { + "Type": "Task", + "Resource": "arn:aws:states:::lambda:invoke", + "Parameters": { + "FunctionName": "arn:aws:lambda:us-east-1:363076331236:function:ConstructHub-Gamma-ConstructHubInventoryCanary63D8-qHHckzUXmDkk" + }, + "ResultPath": null, + "Retry": [ + { + "ErrorEquals": ["Lambda.TooManyRequestsException"], + "IntervalSeconds": 60, + "MaxAttempts": 30, + "BackoffRate": 1.1 + } + ], + "End": true + }, + "No Packages to Retry": { + "Type": "Succeed" + } + } +} From d9f4500230ca0aeb955cd36eca136a87f38262a9 Mon Sep 17 00:00:00 2001 From: Momo Kornher Date: Thu, 20 Nov 2025 13:27:18 +0000 Subject: [PATCH 06/18] this works --- retry-uninstallable-packages.json | 111 ++++++++++++++++++++---------- 1 file changed, 75 insertions(+), 36 deletions(-) diff --git a/retry-uninstallable-packages.json b/retry-uninstallable-packages.json index 1d2ea1081..532ea527d 100644 --- a/retry-uninstallable-packages.json +++ b/retry-uninstallable-packages.json @@ -1,19 +1,53 @@ { "Comment": "State machine that retries processing of uninstallable packages", - "StartAt": "Process Each Package", + "StartAt": "Read Uninstallable Report", "States": { - "Process Each Package": { - "Type": "Map", - "ItemReader": { - "Resource": "arn:aws:states:::s3:getObject", - "ReaderConfig": { - "InputType": "JSON" - }, - "Parameters": { - "Bucket": "constructhub-gamma-constructhubpackagedatadc5ef35-qde3kml6fwa5", - "Key": "uninstallable-objects/data.json" + "Read Uninstallable Report": { + "Type": "Task", + "Resource": "arn:aws:states:::aws-sdk:s3:getObject", + "Parameters": { + "Bucket": "constructhub-gamma-constructhubpackagedatadc5ef35-qde3kml6fwa5", + "Key": "uninstallable-objects/data.json" + }, + "ResultPath": "$.reportResponse", + "Retry": [ + { + "ErrorEquals": ["S3.NoSuchKey"], + "IntervalSeconds": 2, + "MaxAttempts": 3, + "BackoffRate": 2.0 } + ], + "Catch": [ + { + "ErrorEquals": ["S3.NoSuchKey"], + "Next": "No Report Found" + } + ], + "Next": "Parse Report" + }, + "Parse Report": { + "Type": "Pass", + "Parameters": { + "packages.$": "States.StringToJson($.reportResponse.Body)" }, + "ResultPath": "$.parsedReport", + "Next": "Has Packages?" + }, + "Has Packages?": { + "Type": "Choice", + "Choices": [ + { + "Variable": "$.parsedReport.packages[0]", + "IsPresent": true, + "Next": "Process Each Package" + } + ], + "Default": "No Packages to Retry" + }, + "Process Each Package": { + "Type": "Map", + "ItemsPath": "$.parsedReport.packages", "ResultPath": null, "Iterator": { "StartAt": "Transform Package Format", @@ -21,61 +55,66 @@ "Transform Package Format": { "Type": "Pass", "Parameters": { + "originalPackage.$": "$", "packageName.$": "States.ArrayGetItem(States.StringSplit($, '@'), 0)", "packageVersion.$": "States.ArrayGetItem(States.StringSplit($, '@'), 1)" }, - "ResultPath": "$.transformed", "Next": "Retry Package" }, "Retry Package": { "Type": "Task", "Resource": "arn:aws:states:::states:startExecution.sync:2", "Parameters": { - "StateMachineArn": "arn:aws:states:us-east-1:363076331236:stateMachine:ReprocessDocumentationPerPackage", + "StateMachineArn": "arn:aws:states:us-east-1:363076331236:stateMachine:ConstructHub-Gamma.ConstructHub.Orchestration", "Input": { - "Prefix.$": "States.Format('data/{}/v{}', $.transformed.packageName, $.transformed.packageVersion)" + "bucket": "constructhub-gamma-constructhubpackagedatadc5ef35-qde3kml6fwa5", + "assembly": { + "key.$": "States.Format('data/{}/v{}/assembly.json', $.packageName, $.packageVersion)" + }, + "metadata": { + "key.$": "States.Format('data/{}/v{}/metadata.json', $.packageName, $.packageVersion)" + }, + "package": { + "key.$": "States.Format('data/{}/v{}/package.tgz', $.packageName, $.packageVersion)" + } } }, "Retry": [ { "ErrorEquals": ["StepFunctions.ExecutionLimitExceeded"], "IntervalSeconds": 60, - "MaxAttempts": 30, - "BackoffRate": 1.1 + "MaxAttempts": 3, + "BackoffRate": 2.0 } ], "Catch": [ { - "ErrorEquals": ["States.TaskFailed"], - "Next": "Package Retry Failed" + "ErrorEquals": ["States.ALL"], + "Next": "Package Retry Failed", + "ResultPath": "$.error" } ], "End": true }, "Package Retry Failed": { - "Type": "Succeed" + "Type": "Pass", + "Parameters": { + "package.$": "$.originalPackage", + "prefix.$": "States.Format('data/{}/v{}', $.packageName, $.packageVersion)", + "error.$": "$.error" + }, + "End": true } } }, - "Next": "Run Inventory" - }, - "Run Inventory": { - "Type": "Task", - "Resource": "arn:aws:states:::lambda:invoke", - "Parameters": { - "FunctionName": "arn:aws:lambda:us-east-1:363076331236:function:ConstructHub-Gamma-ConstructHubInventoryCanary63D8-qHHckzUXmDkk" - }, - "ResultPath": null, - "Retry": [ - { - "ErrorEquals": ["Lambda.TooManyRequestsException"], - "IntervalSeconds": 60, - "MaxAttempts": 30, - "BackoffRate": 1.1 - } - ], "End": true }, + + "No Report Found": { + "Type": "Fail", + "Error": "NoReportFound", + "Cause": "Uninstallable packages report not found at uninstallable-objects/data.json" + }, "No Packages to Retry": { "Type": "Succeed" } From 3addc03d3b3b77d7495802d2bc3ef0901e8ada72 Mon Sep 17 00:00:00 2001 From: Momo Kornher Date: Thu, 20 Nov 2025 13:34:51 +0000 Subject: [PATCH 07/18] working --- src/backend/orchestration/index.ts | 8 +- .../retry-uninstallable-packages.ts | 156 +++++++++++------- 2 files changed, 97 insertions(+), 67 deletions(-) diff --git a/src/backend/orchestration/index.ts b/src/backend/orchestration/index.ts index de61cdb6c..5d2300c74 100644 --- a/src/backend/orchestration/index.ts +++ b/src/backend/orchestration/index.ts @@ -564,18 +564,12 @@ export class Orchestration extends Construct { regenerateAllDocumentation.processPackageVersions; // Create retry uninstallable packages workflow - const inventoryInvoke = new tasks.LambdaInvoke(this, 'Run Inventory', { - lambdaFunction: props.inventory.function, - resultPath: JsonPath.DISCARD, - }); - const retryUninstallable = new RetryUninstallablePackages( this, 'RetryUninstallablePackages', { bucket: props.bucket, - reprocessStateMachine: this.regenerateAllDocumentationPerPackage, - inventoryFunction: inventoryInvoke, + orchestrationStateMachine: this.stateMachine, } ); this.retryUninstallablePackages = retryUninstallable.stateMachine; diff --git a/src/backend/orchestration/retry-uninstallable-packages.ts b/src/backend/orchestration/retry-uninstallable-packages.ts index 880a5d604..df9f1c5da 100644 --- a/src/backend/orchestration/retry-uninstallable-packages.ts +++ b/src/backend/orchestration/retry-uninstallable-packages.ts @@ -1,25 +1,24 @@ import { Duration } from 'aws-cdk-lib'; import { IBucket } from 'aws-cdk-lib/aws-s3'; import { - Choice, - Condition, - IntegrationPattern, IStateMachine, - JsonPath, - Map, - Pass, StateMachine, Succeed, + Fail, + Pass, + Choice, + Condition, + Map, + JsonPath, + IntegrationPattern, TaskInput, } from 'aws-cdk-lib/aws-stepfunctions'; import * as tasks from 'aws-cdk-lib/aws-stepfunctions-tasks'; import { Construct } from 'constructs'; -import { UNINSTALLABLE_PACKAGES_REPORT } from '../shared/constants'; export interface RetryUninstallablePackagesProps { readonly bucket: IBucket; - readonly reprocessStateMachine: IStateMachine; - readonly inventoryFunction: tasks.LambdaInvoke; + readonly orchestrationStateMachine: IStateMachine; } /** @@ -27,8 +26,8 @@ export interface RetryUninstallablePackagesProps { * * This workflow: * 1. Reads the uninstallable packages report - * 2. Triggers ReprocessDocumentationPerPackage for each entry - * 3. Re-runs the inventory canary to update the report + * 2. Triggers main orchestration for each package + * 3. Ends after processing all packages */ export class RetryUninstallablePackages extends Construct { public readonly stateMachine: StateMachine; @@ -40,30 +39,40 @@ export class RetryUninstallablePackages extends Construct { ) { super(scope, id); - // Read the uninstallable packages report + const noReportFound = new Fail(this, 'No Report Found', { + error: 'NoReportFound', + cause: + 'Uninstallable packages report not found at uninstallable-objects/data.json', + }); + + const noPackagesToRetry = new Succeed(this, 'No Packages to Retry'); + const readReport = new tasks.CallAwsService( this, 'Read Uninstallable Report', { service: 's3', action: 'getObject', - iamAction: 's3:GetObject', - iamResources: [ - `${props.bucket.bucketArn}/${UNINSTALLABLE_PACKAGES_REPORT}`, - ], + iamResources: [props.bucket.arnForObjects('*')], parameters: { Bucket: props.bucket.bucketName, - Key: UNINSTALLABLE_PACKAGES_REPORT, + Key: 'uninstallable-objects/data.json', }, resultPath: '$.reportResponse', } - ) - .addRetry({ errors: ['S3.NoSuchKey'] }) - .addCatch(new Succeed(this, 'No Report Found'), { - errors: ['S3.NoSuchKey'], - }); + ); + + readReport.addRetry({ + errors: ['S3.NoSuchKey'], + interval: Duration.seconds(2), + maxAttempts: 3, + backoffRate: 2.0, + }); + + readReport.addCatch(noReportFound, { + errors: ['S3.NoSuchKey'], + }); - // Parse the JSON content using intrinsic function const parseReport = new Pass(this, 'Parse Report', { parameters: { 'packages.$': 'States.StringToJson($.reportResponse.Body)', @@ -71,49 +80,75 @@ export class RetryUninstallablePackages extends Construct { resultPath: '$.parsedReport', }); - // Process each uninstallable package - const processPackages = new Map(this, 'Process Each Package', { - itemsPath: '$.parsedReport.packages', - resultPath: JsonPath.DISCARD, - }).iterator( - new tasks.StepFunctionsStartExecution(this, 'Retry Package', { - stateMachine: props.reprocessStateMachine, + const transformPackage = new Pass(this, 'Transform Package Format', { + parameters: { + 'originalPackage.$': '$', + 'packageName.$': "States.ArrayGetItem(States.StringSplit($, '@'), 0)", + 'packageVersion.$': + "States.ArrayGetItem(States.StringSplit($, '@'), 1)", + }, + }); + + const packageRetryFailed = new Pass(this, 'Package Retry Failed', { + parameters: { + 'package.$': '$.originalPackage', + 'prefix.$': + "States.Format('data/{}/v{}', $.packageName, $.packageVersion)", + 'error.$': '$.error', + }, + }); + + const retryPackage = new tasks.StepFunctionsStartExecution( + this, + 'Retry Package', + { + stateMachine: props.orchestrationStateMachine, + integrationPattern: IntegrationPattern.RUN_JOB, input: TaskInput.fromObject({ - Prefix: JsonPath.format( - 'data/{}/v{}', - JsonPath.arrayGetItem( - JsonPath.stringSplit(JsonPath.stringAt('$'), '@'), - 0 - ), - JsonPath.arrayGetItem( - JsonPath.stringSplit(JsonPath.stringAt('$'), '@'), - 1 - ) - ), + bucket: props.bucket.bucketName, + assembly: { + 'key.$': + "States.Format('data/{}/v{}/assembly.json', $.packageName, $.packageVersion)", + }, + metadata: { + 'key.$': + "States.Format('data/{}/v{}/metadata.json', $.packageName, $.packageVersion)", + }, + package: { + 'key.$': + "States.Format('data/{}/v{}/package.tgz', $.packageName, $.packageVersion)", + }, }), - integrationPattern: IntegrationPattern.RUN_JOB, - }) - .addRetry({ errors: ['StepFunctions.ExecutionLimitExceeded'] }) - .addCatch(new Succeed(this, 'Package Retry Failed'), { - errors: ['States.TaskFailed'], - }) + } ); - // Re-run inventory canary to update the report - const updateInventory = props.inventoryFunction.addRetry({ - errors: ['Lambda.TooManyRequestsException'], + retryPackage.addRetry({ + errors: ['StepFunctions.ExecutionLimitExceeded'], + interval: Duration.seconds(60), + maxAttempts: 3, + backoffRate: 2.0, + }); + + retryPackage.addCatch(packageRetryFailed, { + errors: ['States.ALL'], + resultPath: '$.error', }); - const definition = readReport - .next(parseReport) - .next( - new Choice(this, 'Has Packages?') - .when( - Condition.isPresent('$.parsedReport.packages[0]'), - processPackages.next(updateInventory) - ) - .otherwise(new Succeed(this, 'No Packages to Retry')) - ); + const processEachPackage = new Map(this, 'Process Each Package', { + itemsPath: JsonPath.stringAt('$.parsedReport.packages'), + resultPath: JsonPath.DISCARD, + }); + + processEachPackage.itemProcessor(transformPackage.next(retryPackage)); + + const hasPackages = new Choice(this, 'Has Packages?') + .when( + Condition.isPresent('$.parsedReport.packages[0]'), + processEachPackage + ) + .otherwise(noPackagesToRetry); + + const definition = readReport.next(parseReport).next(hasPackages); this.stateMachine = new StateMachine(this, 'Resource', { definition, @@ -123,5 +158,6 @@ export class RetryUninstallablePackages extends Construct { }); props.bucket.grantRead(this.stateMachine); + props.orchestrationStateMachine.grantStartExecution(this.stateMachine); } } From 0a95d456b11aa45ced4954a2da0d1a3b5be86fb0 Mon Sep 17 00:00:00 2001 From: Momo Kornher Date: Thu, 20 Nov 2025 13:35:57 +0000 Subject: [PATCH 08/18] run --- docs/operator-runbook.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/operator-runbook.md b/docs/operator-runbook.md index fed7bc628..5feff724c 100644 --- a/docs/operator-runbook.md +++ b/docs/operator-runbook.md @@ -710,7 +710,7 @@ When documentation for a package is not available, it could be due to several re 1. **For Uninstallable Packages**: Use the "Retry Uninstallable Packages" button in the backend dashboard to automatically retry all uninstallable packages. This will: - Read the current uninstallable packages report - Trigger reprocessing for each uninstallable package - - Update the inventory report after completion + - Note: The inventory report will be updated automatically by the scheduled inventory canary, but it processes packages incrementally, so it may take a few hours for all changes to be fully reflected in the dashboard 2. **For Individual Packages**: Use the "ReprocessDocumentationPerPackage" state machine to retry a specific package: ```json From 1d5316ed057094039e7b5a5282af9fddf8b4b814 Mon Sep 17 00:00:00 2001 From: Momo Kornher Date: Thu, 20 Nov 2025 13:43:10 +0000 Subject: [PATCH 09/18] better --- .gitattributes | 1 + .gitignore | 1 + .prettierignore | 1 + .projen/files.json | 1 + .projen/tasks.json | 26 +++++++++++++- package.json | 2 ++ .../read-uninstallable-report.lambda.ts | 35 +++++++++++++++++++ .../read-uninstallable-report.ts | 20 +++++++++++ .../retry-uninstallable-packages.ts | 34 ++++++++++++------ 9 files changed, 109 insertions(+), 12 deletions(-) create mode 100644 src/backend/orchestration/read-uninstallable-report.lambda.ts create mode 100644 src/backend/orchestration/read-uninstallable-report.ts diff --git a/.gitattributes b/.gitattributes index 989136c25..616f04d9a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -42,6 +42,7 @@ /src/backend/inventory/canary.ts linguist-generated /src/backend/inventory/package-versions-table-widget-function.ts linguist-generated /src/backend/orchestration/needs-catalog-update.ts linguist-generated +/src/backend/orchestration/read-uninstallable-report.ts linguist-generated /src/backend/orchestration/redrive-state-machine.ts linguist-generated /src/backend/package-stats/package-stats-aggregator.ts linguist-generated /src/backend/package-stats/package-stats-chunker.ts linguist-generated diff --git a/.gitignore b/.gitignore index 6a4cbd31e..4b29e8184 100644 --- a/.gitignore +++ b/.gitignore @@ -85,6 +85,7 @@ lib/__tests__/devapp/cdk.out !/src/backend/package-stats/package-stats-chunker.ts !/src/backend/package-stats/package-stats-aggregator.ts !/src/backend/orchestration/redrive-state-machine.ts +!/src/backend/orchestration/read-uninstallable-report.ts !/src/backend/orchestration/needs-catalog-update.ts !/src/backend/inventory/package-versions-table-widget-function.ts !/src/backend/inventory/canary.ts diff --git a/.prettierignore b/.prettierignore index 3333bff2e..fe590039e 100644 --- a/.prettierignore +++ b/.prettierignore @@ -15,6 +15,7 @@ src/backend/package-stats/package-stats-processor.ts src/backend/package-stats/package-stats-chunker.ts src/backend/package-stats/package-stats-aggregator.ts src/backend/orchestration/redrive-state-machine.ts +src/backend/orchestration/read-uninstallable-report.ts src/backend/orchestration/needs-catalog-update.ts src/backend/inventory/package-versions-table-widget-function.ts src/backend/inventory/canary.ts diff --git a/.projen/files.json b/.projen/files.json index 2183f5664..ba9973500 100644 --- a/.projen/files.json +++ b/.projen/files.json @@ -36,6 +36,7 @@ "src/backend/inventory/canary.ts", "src/backend/inventory/package-versions-table-widget-function.ts", "src/backend/orchestration/needs-catalog-update.ts", + "src/backend/orchestration/read-uninstallable-report.ts", "src/backend/orchestration/redrive-state-machine.ts", "src/backend/package-stats/package-stats-aggregator.ts", "src/backend/package-stats/package-stats-chunker.ts", diff --git a/.projen/tasks.json b/.projen/tasks.json index c41f6d7fd..9a40ffd48 100644 --- a/.projen/tasks.json +++ b/.projen/tasks.json @@ -95,6 +95,9 @@ { "spawn": "bundle:redrive-state-machine" }, + { + "spawn": "bundle:read-uninstallable-report" + }, { "spawn": "bundle:needs-catalog-update" }, @@ -333,7 +336,7 @@ "description": "Continuously bundle all AWS Lambda functions", "steps": [ { - "exec": "esbuild --bundle src/package-sources/npmjs/stage-and-notify.lambda.ts src/package-sources/npmjs/re-stage-package-version.lambda.ts src/package-sources/npmjs/npm-js-follower.lambda.ts src/package-sources/npmjs/canary/npmjs-package-canary.lambda.ts src/package-sources/codeartifact/code-artifact-forwarder.lambda.ts src/overview-dashboard/sqs-dlq-stats-widget-function.lambda.ts src/monitoring/http-get-function.lambda.ts src/monitored-certificate/certificate-monitor.lambda.ts src/backend/version-tracker/version-tracker.lambda.ts src/backend/release-notes/release-notes-trigger.lambda.ts src/backend/release-notes/get-messages-from-worker-queue.lambda.ts src/backend/release-notes/generate-release-notes.lambda.ts src/backend/package-stats/package-stats-processor.lambda.ts src/backend/package-stats/package-stats-chunker.lambda.ts src/backend/package-stats/package-stats-aggregator.lambda.ts src/backend/orchestration/redrive-state-machine.lambda.ts src/backend/orchestration/needs-catalog-update.lambda.ts src/backend/inventory/package-versions-table-widget-function.lambda.ts src/backend/inventory/canary.lambda.ts src/backend/ingestion/re-ingest.lambda.ts src/backend/ingestion/ingestion.lambda.ts src/backend/feed-builder/update-feed.lambda.ts src/backend/ecs-task-monitor/monitor.lambda.ts src/backend/deny-list/prune-queue-handler.lambda.ts src/backend/deny-list/prune-handler.lambda.ts src/backend/catalog-builder/catalog-builder.lambda.ts src/__tests__/backend/deny-list/mocks/prune-test.lambda.ts src/__tests__/backend/deny-list/mocks/client-test.lambda.ts src/__tests__/backend/deny-list/mocks/catalog-builder-mock.lambda.ts --target=\"node22 --platform=\"node\" --outbase=\"src\" --outdir=\"lib\" --entry-names=\"[dir]/[name].bundle/index\" --external:aws-sdk --sourcemap --watch --tsconfig=tsconfig.dev.json" + "exec": "esbuild --bundle src/package-sources/npmjs/stage-and-notify.lambda.ts src/package-sources/npmjs/re-stage-package-version.lambda.ts src/package-sources/npmjs/npm-js-follower.lambda.ts src/package-sources/npmjs/canary/npmjs-package-canary.lambda.ts src/package-sources/codeartifact/code-artifact-forwarder.lambda.ts src/overview-dashboard/sqs-dlq-stats-widget-function.lambda.ts src/monitoring/http-get-function.lambda.ts src/monitored-certificate/certificate-monitor.lambda.ts src/backend/version-tracker/version-tracker.lambda.ts src/backend/release-notes/release-notes-trigger.lambda.ts src/backend/release-notes/get-messages-from-worker-queue.lambda.ts src/backend/release-notes/generate-release-notes.lambda.ts src/backend/package-stats/package-stats-processor.lambda.ts src/backend/package-stats/package-stats-chunker.lambda.ts src/backend/package-stats/package-stats-aggregator.lambda.ts src/backend/orchestration/redrive-state-machine.lambda.ts src/backend/orchestration/read-uninstallable-report.lambda.ts src/backend/orchestration/needs-catalog-update.lambda.ts src/backend/inventory/package-versions-table-widget-function.lambda.ts src/backend/inventory/canary.lambda.ts src/backend/ingestion/re-ingest.lambda.ts src/backend/ingestion/ingestion.lambda.ts src/backend/feed-builder/update-feed.lambda.ts src/backend/ecs-task-monitor/monitor.lambda.ts src/backend/deny-list/prune-queue-handler.lambda.ts src/backend/deny-list/prune-handler.lambda.ts src/backend/catalog-builder/catalog-builder.lambda.ts src/__tests__/backend/deny-list/mocks/prune-test.lambda.ts src/__tests__/backend/deny-list/mocks/client-test.lambda.ts src/__tests__/backend/deny-list/mocks/catalog-builder-mock.lambda.ts --target=\"node22 --platform=\"node\" --outbase=\"src\" --outdir=\"lib\" --entry-names=\"[dir]/[name].bundle/index\" --external:aws-sdk --sourcemap --watch --tsconfig=tsconfig.dev.json" } ] }, @@ -571,6 +574,24 @@ } ] }, + "bundle:read-uninstallable-report": { + "name": "bundle:read-uninstallable-report", + "description": "Create an AWS Lambda bundle from src/backend/orchestration/read-uninstallable-report.lambda.ts", + "steps": [ + { + "exec": "esbuild --bundle src/backend/orchestration/read-uninstallable-report.lambda.ts --target=\"node22\" --platform=\"node\" --outfile=\"lib/backend/orchestration/read-uninstallable-report.lambda.bundle/index.js\" --external:aws-sdk --sourcemap --tsconfig=tsconfig.dev.json" + } + ] + }, + "bundle:read-uninstallable-report:watch": { + "name": "bundle:read-uninstallable-report:watch", + "description": "Continuously update an AWS Lambda bundle from src/backend/orchestration/read-uninstallable-report.lambda.ts", + "steps": [ + { + "exec": "esbuild --bundle src/backend/orchestration/read-uninstallable-report.lambda.ts --target=\"node22\" --platform=\"node\" --outfile=\"lib/backend/orchestration/read-uninstallable-report.lambda.bundle/index.js\" --external:aws-sdk --sourcemap --tsconfig=tsconfig.dev.json --watch" + } + ] + }, "bundle:redrive-state-machine": { "name": "bundle:redrive-state-machine", "description": "Create an AWS Lambda bundle from src/backend/orchestration/redrive-state-machine.lambda.ts", @@ -811,6 +832,9 @@ { "spawn": "bundle:redrive-state-machine" }, + { + "spawn": "bundle:read-uninstallable-report" + }, { "spawn": "bundle:needs-catalog-update" }, diff --git a/package.json b/package.json index 839f61229..8e001f9a8 100644 --- a/package.json +++ b/package.json @@ -57,6 +57,8 @@ "bundle:re-ingest:watch": "npx projen bundle:re-ingest:watch", "bundle:re-stage-package-version": "npx projen bundle:re-stage-package-version", "bundle:re-stage-package-version:watch": "npx projen bundle:re-stage-package-version:watch", + "bundle:read-uninstallable-report": "npx projen bundle:read-uninstallable-report", + "bundle:read-uninstallable-report:watch": "npx projen bundle:read-uninstallable-report:watch", "bundle:redrive-state-machine": "npx projen bundle:redrive-state-machine", "bundle:redrive-state-machine:watch": "npx projen bundle:redrive-state-machine:watch", "bundle:release-notes-trigger": "npx projen bundle:release-notes-trigger", diff --git a/src/backend/orchestration/read-uninstallable-report.lambda.ts b/src/backend/orchestration/read-uninstallable-report.lambda.ts new file mode 100644 index 000000000..ef974826b --- /dev/null +++ b/src/backend/orchestration/read-uninstallable-report.lambda.ts @@ -0,0 +1,35 @@ +import { GetObjectCommand } from '@aws-sdk/client-s3'; +import { S3_CLIENT } from '../shared/aws.lambda-shared'; +import { decompressContent } from '../shared/compress-content.lambda-shared'; + +export interface ReadUninstallableReportEvent { + readonly bucket: string; + readonly key: string; +} + +export interface ReadUninstallableReportResult { + readonly packages: string[]; +} + +export async function handler( + event: ReadUninstallableReportEvent +): Promise { + const response = await S3_CLIENT.send( + new GetObjectCommand({ + Bucket: event.bucket, + Key: event.key, + }) + ); + + if (!response.Body) { + throw new Error(`Object not found: s3://${event.bucket}/${event.key}`); + } + + const decompressed = await decompressContent( + response.Body as any, + response.ContentEncoding + ); + + const packages = JSON.parse(decompressed); + return { packages }; +} diff --git a/src/backend/orchestration/read-uninstallable-report.ts b/src/backend/orchestration/read-uninstallable-report.ts new file mode 100644 index 000000000..fb09fe89c --- /dev/null +++ b/src/backend/orchestration/read-uninstallable-report.ts @@ -0,0 +1,20 @@ +// ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". +import * as path from 'path'; +import * as lambda from 'aws-cdk-lib/aws-lambda'; +import { Construct } from 'constructs'; + +export interface ReadUninstallableReportProps extends lambda.FunctionOptions { +} + +export class ReadUninstallableReport extends lambda.Function { + constructor(scope: Construct, id: string, props?: ReadUninstallableReportProps) { + super(scope, id, { + description: 'backend/orchestration/read-uninstallable-report.lambda.ts', + ...props, + architecture: lambda.Architecture.ARM_64, + runtime: lambda.Runtime.NODEJS_22_X, + handler: 'index.handler', + code: lambda.Code.fromAsset(path.join(__dirname, '/read-uninstallable-report.lambda.bundle')), + }); + } +} \ No newline at end of file diff --git a/src/backend/orchestration/retry-uninstallable-packages.ts b/src/backend/orchestration/retry-uninstallable-packages.ts index df9f1c5da..193be4722 100644 --- a/src/backend/orchestration/retry-uninstallable-packages.ts +++ b/src/backend/orchestration/retry-uninstallable-packages.ts @@ -1,4 +1,6 @@ import { Duration } from 'aws-cdk-lib'; +import { Function, Runtime, Code } from 'aws-cdk-lib/aws-lambda'; +import { RetentionDays } from 'aws-cdk-lib/aws-logs'; import { IBucket } from 'aws-cdk-lib/aws-s3'; import { IStateMachine, @@ -15,6 +17,7 @@ import { } from 'aws-cdk-lib/aws-stepfunctions'; import * as tasks from 'aws-cdk-lib/aws-stepfunctions-tasks'; import { Construct } from 'constructs'; +import { gravitonLambdaIfAvailable } from '../_lambda-architecture'; export interface RetryUninstallablePackagesProps { readonly bucket: IBucket; @@ -47,35 +50,44 @@ export class RetryUninstallablePackages extends Construct { const noPackagesToRetry = new Succeed(this, 'No Packages to Retry'); - const readReport = new tasks.CallAwsService( + const readReportFunction = new Function(this, 'ReadReportFunction', { + runtime: Runtime.NODEJS_18_X, + handler: 'read-uninstallable-report.lambda.handler', + code: Code.fromAsset('lib/backend/orchestration'), + architecture: gravitonLambdaIfAvailable(this), + timeout: Duration.minutes(1), + logRetention: RetentionDays.ONE_YEAR, + }); + + props.bucket.grantRead(readReportFunction); + + const readReport = new tasks.LambdaInvoke( this, 'Read Uninstallable Report', { - service: 's3', - action: 'getObject', - iamResources: [props.bucket.arnForObjects('*')], - parameters: { - Bucket: props.bucket.bucketName, - Key: 'uninstallable-objects/data.json', - }, + lambdaFunction: readReportFunction, + payload: TaskInput.fromObject({ + bucket: props.bucket.bucketName, + key: 'uninstallable-objects/data.json', + }), resultPath: '$.reportResponse', } ); readReport.addRetry({ - errors: ['S3.NoSuchKey'], + errors: ['Lambda.Unknown'], interval: Duration.seconds(2), maxAttempts: 3, backoffRate: 2.0, }); readReport.addCatch(noReportFound, { - errors: ['S3.NoSuchKey'], + errors: ['States.TaskFailed'], }); const parseReport = new Pass(this, 'Parse Report', { parameters: { - 'packages.$': 'States.StringToJson($.reportResponse.Body)', + 'packages.$': '$.reportResponse.Payload.packages', }, resultPath: '$.parsedReport', }); From 703fb2d1b88d3a8c0dd218067c20d77677e345a2 Mon Sep 17 00:00:00 2001 From: Momo Kornher Date: Thu, 20 Nov 2025 13:47:22 +0000 Subject: [PATCH 10/18] run again --- docs/operator-runbook.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/operator-runbook.md b/docs/operator-runbook.md index 5feff724c..2ba54daa5 100644 --- a/docs/operator-runbook.md +++ b/docs/operator-runbook.md @@ -711,6 +711,7 @@ When documentation for a package is not available, it could be due to several re - Read the current uninstallable packages report - Trigger reprocessing for each uninstallable package - Note: The inventory report will be updated automatically by the scheduled inventory canary, but it processes packages incrementally, so it may take a few hours for all changes to be fully reflected in the dashboard + - Warning: This may trigger `Orchestration/Resource/ExecutionsFailed` and `Orchestration/DLQ/NotEmpty` alarms since some packages may still fail on retry and be sent to the dead letter queue 2. **For Individual Packages**: Use the "ReprocessDocumentationPerPackage" state machine to retry a specific package: ```json From e98bc54cddf114200e09152b582cff9eb9933467 Mon Sep 17 00:00:00 2001 From: Momo Kornher Date: Thu, 20 Nov 2025 13:50:07 +0000 Subject: [PATCH 11/18] fix --- .../retry-uninstallable-packages.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/backend/orchestration/retry-uninstallable-packages.ts b/src/backend/orchestration/retry-uninstallable-packages.ts index 193be4722..f73337c13 100644 --- a/src/backend/orchestration/retry-uninstallable-packages.ts +++ b/src/backend/orchestration/retry-uninstallable-packages.ts @@ -18,6 +18,7 @@ import { import * as tasks from 'aws-cdk-lib/aws-stepfunctions-tasks'; import { Construct } from 'constructs'; import { gravitonLambdaIfAvailable } from '../_lambda-architecture'; +import { ReadUninstallableReport } from './read-uninstallable-report'; export interface RetryUninstallablePackagesProps { readonly bucket: IBucket; @@ -50,14 +51,13 @@ export class RetryUninstallablePackages extends Construct { const noPackagesToRetry = new Succeed(this, 'No Packages to Retry'); - const readReportFunction = new Function(this, 'ReadReportFunction', { - runtime: Runtime.NODEJS_18_X, - handler: 'read-uninstallable-report.lambda.handler', - code: Code.fromAsset('lib/backend/orchestration'), - architecture: gravitonLambdaIfAvailable(this), - timeout: Duration.minutes(1), - logRetention: RetentionDays.ONE_YEAR, - }); + const readReportFunction = new ReadUninstallableReport( + this, + 'ReadReportFunction', + { + logRetention: RetentionDays.THREE_MONTHS, + } + ); props.bucket.grantRead(readReportFunction); From 875e86dbcdcf95db396f469529448f7022af793e Mon Sep 17 00:00:00 2001 From: Momo Kornher Date: Thu, 20 Nov 2025 14:00:36 +0000 Subject: [PATCH 12/18] this is it --- .../read-uninstallable-report.lambda.test.ts | 49 +++++++++++++++++++ .../retry-uninstallable-packages.test.ts | 37 ++++++++++++++ .../retry-uninstallable-packages.ts | 2 - 3 files changed, 86 insertions(+), 2 deletions(-) create mode 100644 src/__tests__/backend/orchestration/read-uninstallable-report.lambda.test.ts create mode 100644 src/__tests__/backend/orchestration/retry-uninstallable-packages.test.ts diff --git a/src/__tests__/backend/orchestration/read-uninstallable-report.lambda.test.ts b/src/__tests__/backend/orchestration/read-uninstallable-report.lambda.test.ts new file mode 100644 index 000000000..6c8e9d829 --- /dev/null +++ b/src/__tests__/backend/orchestration/read-uninstallable-report.lambda.test.ts @@ -0,0 +1,49 @@ +import { GetObjectCommand } from '@aws-sdk/client-s3'; +import { mockClient } from 'aws-sdk-client-mock'; +import { handler } from '../../../backend/orchestration/read-uninstallable-report.lambda'; +import { S3_CLIENT } from '../../../backend/shared/aws.lambda-shared'; + +const s3Mock = mockClient(S3_CLIENT); + +beforeEach(() => { + s3Mock.reset(); +}); + +test('reads and decompresses uninstallable packages report', async () => { + const packages = ['package1@1.0.0', 'package2@2.0.0']; + const mockBody = { + transformToString: jest.fn().mockResolvedValue(JSON.stringify(packages)), + }; + + s3Mock.on(GetObjectCommand).resolves({ + Body: mockBody as any, + ContentEncoding: undefined, + }); + + const result = await handler({ + bucket: 'test-bucket', + key: 'uninstallable-objects/data.json', + }); + + expect(result).toEqual({ packages }); + expect(s3Mock.calls()).toHaveLength(1); + expect(s3Mock.call(0).args[0].input).toEqual({ + Bucket: 'test-bucket', + Key: 'uninstallable-objects/data.json', + }); +}); + +test('throws error when object not found', async () => { + s3Mock.on(GetObjectCommand).resolves({ + Body: undefined, + }); + + await expect( + handler({ + bucket: 'test-bucket', + key: 'uninstallable-objects/data.json', + }) + ).rejects.toThrow( + 'Object not found: s3://test-bucket/uninstallable-objects/data.json' + ); +}); diff --git a/src/__tests__/backend/orchestration/retry-uninstallable-packages.test.ts b/src/__tests__/backend/orchestration/retry-uninstallable-packages.test.ts new file mode 100644 index 000000000..613da14a6 --- /dev/null +++ b/src/__tests__/backend/orchestration/retry-uninstallable-packages.test.ts @@ -0,0 +1,37 @@ +import { Stack } from 'aws-cdk-lib'; +import { Template } from 'aws-cdk-lib/assertions'; +import * as s3 from 'aws-cdk-lib/aws-s3'; +import * as sfn from 'aws-cdk-lib/aws-stepfunctions'; +import { RetryUninstallablePackages } from '../../../backend/orchestration/retry-uninstallable-packages'; + +test('creates required resources', () => { + const stack = new Stack(); + const bucket = new s3.Bucket(stack, 'TestBucket'); + const orchestrationStateMachine = new sfn.StateMachine( + stack, + 'OrchestrationStateMachine', + { + definition: new sfn.Pass(stack, 'TestPass'), + } + ); + + new RetryUninstallablePackages(stack, 'RetryUninstallablePackages', { + bucket, + orchestrationStateMachine, + }); + + const template = Template.fromStack(stack); + + // Verify state machine is created with correct name + template.hasResourceProperties('AWS::StepFunctions::StateMachine', { + StateMachineName: 'RetryUninstallablePackages', + }); + + // Verify Lambda function is created + template.hasResourceProperties('AWS::Lambda::Function', { + Runtime: 'nodejs22.x', + }); + + // Verify IAM policies exist + template.resourceCountIs('AWS::IAM::Policy', 3); +}); diff --git a/src/backend/orchestration/retry-uninstallable-packages.ts b/src/backend/orchestration/retry-uninstallable-packages.ts index f73337c13..317244306 100644 --- a/src/backend/orchestration/retry-uninstallable-packages.ts +++ b/src/backend/orchestration/retry-uninstallable-packages.ts @@ -1,5 +1,4 @@ import { Duration } from 'aws-cdk-lib'; -import { Function, Runtime, Code } from 'aws-cdk-lib/aws-lambda'; import { RetentionDays } from 'aws-cdk-lib/aws-logs'; import { IBucket } from 'aws-cdk-lib/aws-s3'; import { @@ -17,7 +16,6 @@ import { } from 'aws-cdk-lib/aws-stepfunctions'; import * as tasks from 'aws-cdk-lib/aws-stepfunctions-tasks'; import { Construct } from 'constructs'; -import { gravitonLambdaIfAvailable } from '../_lambda-architecture'; import { ReadUninstallableReport } from './read-uninstallable-report'; export interface RetryUninstallablePackagesProps { From d9cb5dac9ba0706178425522a6b3c14b260e74b3 Mon Sep 17 00:00:00 2001 From: Momo Kornher Date: Thu, 20 Nov 2025 14:07:13 +0000 Subject: [PATCH 13/18] for real --- src/backend/orchestration/retry-uninstallable-packages.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/backend/orchestration/retry-uninstallable-packages.ts b/src/backend/orchestration/retry-uninstallable-packages.ts index 317244306..f0c0d2c3d 100644 --- a/src/backend/orchestration/retry-uninstallable-packages.ts +++ b/src/backend/orchestration/retry-uninstallable-packages.ts @@ -93,9 +93,10 @@ export class RetryUninstallablePackages extends Construct { const transformPackage = new Pass(this, 'Transform Package Format', { parameters: { 'originalPackage.$': '$', - 'packageName.$': "States.ArrayGetItem(States.StringSplit($, '@'), 0)", 'packageVersion.$': - "States.ArrayGetItem(States.StringSplit($, '@'), 1)", + "States.ArrayGetItem(States.StringSplit($, '@'), -1)", + 'packageName.$': + "States.ArrayJoin(States.ArraySlice(States.StringSplit($, '@'), 0, -1), '@')", }, }); From a256f2b7e189e3c9446f499f01c21285df21e4e2 Mon Sep 17 00:00:00 2001 From: Momo Kornher Date: Thu, 20 Nov 2025 14:17:03 +0000 Subject: [PATCH 14/18] now maybe? --- .../read-uninstallable-report.lambda.test.ts | 19 +++++++++++-- .../read-uninstallable-report.lambda.ts | 28 +++++++++++++++++-- .../retry-uninstallable-packages.ts | 25 +++-------------- 3 files changed, 46 insertions(+), 26 deletions(-) diff --git a/src/__tests__/backend/orchestration/read-uninstallable-report.lambda.test.ts b/src/__tests__/backend/orchestration/read-uninstallable-report.lambda.test.ts index 6c8e9d829..69d42f351 100644 --- a/src/__tests__/backend/orchestration/read-uninstallable-report.lambda.test.ts +++ b/src/__tests__/backend/orchestration/read-uninstallable-report.lambda.test.ts @@ -10,9 +10,9 @@ beforeEach(() => { }); test('reads and decompresses uninstallable packages report', async () => { - const packages = ['package1@1.0.0', 'package2@2.0.0']; + const rawPackages = ['package1@1.0.0', '@aws-cdk/core@2.0.0']; const mockBody = { - transformToString: jest.fn().mockResolvedValue(JSON.stringify(packages)), + transformToString: jest.fn().mockResolvedValue(JSON.stringify(rawPackages)), }; s3Mock.on(GetObjectCommand).resolves({ @@ -25,7 +25,20 @@ test('reads and decompresses uninstallable packages report', async () => { key: 'uninstallable-objects/data.json', }); - expect(result).toEqual({ packages }); + expect(result).toEqual({ + packages: [ + { + originalPackage: 'package1@1.0.0', + packageName: 'package1', + packageVersion: '1.0.0', + }, + { + originalPackage: '@aws-cdk/core@2.0.0', + packageName: '@aws-cdk/core', + packageVersion: '2.0.0', + }, + ], + }); expect(s3Mock.calls()).toHaveLength(1); expect(s3Mock.call(0).args[0].input).toEqual({ Bucket: 'test-bucket', diff --git a/src/backend/orchestration/read-uninstallable-report.lambda.ts b/src/backend/orchestration/read-uninstallable-report.lambda.ts index ef974826b..ce1e885cb 100644 --- a/src/backend/orchestration/read-uninstallable-report.lambda.ts +++ b/src/backend/orchestration/read-uninstallable-report.lambda.ts @@ -7,8 +7,30 @@ export interface ReadUninstallableReportEvent { readonly key: string; } +export interface PackageInfo { + readonly originalPackage: string; + readonly packageName: string; + readonly packageVersion: string; +} + export interface ReadUninstallableReportResult { - readonly packages: string[]; + readonly packages: PackageInfo[]; +} + +function parsePackageName(packageString: string): PackageInfo { + const lastAtIndex = packageString.lastIndexOf('@'); + if (lastAtIndex === -1) { + throw new Error(`Invalid package format: ${packageString}`); + } + + const packageName = packageString.substring(0, lastAtIndex); + const packageVersion = packageString.substring(lastAtIndex + 1); + + return { + originalPackage: packageString, + packageName, + packageVersion, + }; } export async function handler( @@ -30,6 +52,8 @@ export async function handler( response.ContentEncoding ); - const packages = JSON.parse(decompressed); + const rawPackages = JSON.parse(decompressed); + const packages = rawPackages.map(parsePackageName); + return { packages }; } diff --git a/src/backend/orchestration/retry-uninstallable-packages.ts b/src/backend/orchestration/retry-uninstallable-packages.ts index f0c0d2c3d..54f51285c 100644 --- a/src/backend/orchestration/retry-uninstallable-packages.ts +++ b/src/backend/orchestration/retry-uninstallable-packages.ts @@ -83,23 +83,6 @@ export class RetryUninstallablePackages extends Construct { errors: ['States.TaskFailed'], }); - const parseReport = new Pass(this, 'Parse Report', { - parameters: { - 'packages.$': '$.reportResponse.Payload.packages', - }, - resultPath: '$.parsedReport', - }); - - const transformPackage = new Pass(this, 'Transform Package Format', { - parameters: { - 'originalPackage.$': '$', - 'packageVersion.$': - "States.ArrayGetItem(States.StringSplit($, '@'), -1)", - 'packageName.$': - "States.ArrayJoin(States.ArraySlice(States.StringSplit($, '@'), 0, -1), '@')", - }, - }); - const packageRetryFailed = new Pass(this, 'Package Retry Failed', { parameters: { 'package.$': '$.originalPackage', @@ -146,20 +129,20 @@ export class RetryUninstallablePackages extends Construct { }); const processEachPackage = new Map(this, 'Process Each Package', { - itemsPath: JsonPath.stringAt('$.parsedReport.packages'), + itemsPath: JsonPath.stringAt('$.reportResponse.Payload.packages'), resultPath: JsonPath.DISCARD, }); - processEachPackage.itemProcessor(transformPackage.next(retryPackage)); + processEachPackage.itemProcessor(retryPackage); const hasPackages = new Choice(this, 'Has Packages?') .when( - Condition.isPresent('$.parsedReport.packages[0]'), + Condition.isPresent('$.reportResponse.Payload.packages[0]'), processEachPackage ) .otherwise(noPackagesToRetry); - const definition = readReport.next(parseReport).next(hasPackages); + const definition = readReport.next(hasPackages); this.stateMachine = new StateMachine(this, 'Resource', { definition, From f6366de332d07217d3c599c5cd877d53b245e8c3 Mon Sep 17 00:00:00 2001 From: Momo Kornher Date: Thu, 20 Nov 2025 14:33:49 +0000 Subject: [PATCH 15/18] remove sm file --- retry-uninstallable-packages.json | 122 ------------------------------ 1 file changed, 122 deletions(-) delete mode 100644 retry-uninstallable-packages.json diff --git a/retry-uninstallable-packages.json b/retry-uninstallable-packages.json deleted file mode 100644 index 532ea527d..000000000 --- a/retry-uninstallable-packages.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "Comment": "State machine that retries processing of uninstallable packages", - "StartAt": "Read Uninstallable Report", - "States": { - "Read Uninstallable Report": { - "Type": "Task", - "Resource": "arn:aws:states:::aws-sdk:s3:getObject", - "Parameters": { - "Bucket": "constructhub-gamma-constructhubpackagedatadc5ef35-qde3kml6fwa5", - "Key": "uninstallable-objects/data.json" - }, - "ResultPath": "$.reportResponse", - "Retry": [ - { - "ErrorEquals": ["S3.NoSuchKey"], - "IntervalSeconds": 2, - "MaxAttempts": 3, - "BackoffRate": 2.0 - } - ], - "Catch": [ - { - "ErrorEquals": ["S3.NoSuchKey"], - "Next": "No Report Found" - } - ], - "Next": "Parse Report" - }, - "Parse Report": { - "Type": "Pass", - "Parameters": { - "packages.$": "States.StringToJson($.reportResponse.Body)" - }, - "ResultPath": "$.parsedReport", - "Next": "Has Packages?" - }, - "Has Packages?": { - "Type": "Choice", - "Choices": [ - { - "Variable": "$.parsedReport.packages[0]", - "IsPresent": true, - "Next": "Process Each Package" - } - ], - "Default": "No Packages to Retry" - }, - "Process Each Package": { - "Type": "Map", - "ItemsPath": "$.parsedReport.packages", - "ResultPath": null, - "Iterator": { - "StartAt": "Transform Package Format", - "States": { - "Transform Package Format": { - "Type": "Pass", - "Parameters": { - "originalPackage.$": "$", - "packageName.$": "States.ArrayGetItem(States.StringSplit($, '@'), 0)", - "packageVersion.$": "States.ArrayGetItem(States.StringSplit($, '@'), 1)" - }, - "Next": "Retry Package" - }, - "Retry Package": { - "Type": "Task", - "Resource": "arn:aws:states:::states:startExecution.sync:2", - "Parameters": { - "StateMachineArn": "arn:aws:states:us-east-1:363076331236:stateMachine:ConstructHub-Gamma.ConstructHub.Orchestration", - "Input": { - "bucket": "constructhub-gamma-constructhubpackagedatadc5ef35-qde3kml6fwa5", - "assembly": { - "key.$": "States.Format('data/{}/v{}/assembly.json', $.packageName, $.packageVersion)" - }, - "metadata": { - "key.$": "States.Format('data/{}/v{}/metadata.json', $.packageName, $.packageVersion)" - }, - "package": { - "key.$": "States.Format('data/{}/v{}/package.tgz', $.packageName, $.packageVersion)" - } - } - }, - "Retry": [ - { - "ErrorEquals": ["StepFunctions.ExecutionLimitExceeded"], - "IntervalSeconds": 60, - "MaxAttempts": 3, - "BackoffRate": 2.0 - } - ], - "Catch": [ - { - "ErrorEquals": ["States.ALL"], - "Next": "Package Retry Failed", - "ResultPath": "$.error" - } - ], - "End": true - }, - "Package Retry Failed": { - "Type": "Pass", - "Parameters": { - "package.$": "$.originalPackage", - "prefix.$": "States.Format('data/{}/v{}', $.packageName, $.packageVersion)", - "error.$": "$.error" - }, - "End": true - } - } - }, - "End": true - }, - - "No Report Found": { - "Type": "Fail", - "Error": "NoReportFound", - "Cause": "Uninstallable packages report not found at uninstallable-objects/data.json" - }, - "No Packages to Retry": { - "Type": "Succeed" - } - } -} From 0ea35165a45559b58c90c68783f9856d345e5b12 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 20 Nov 2025 14:36:45 +0000 Subject: [PATCH 16/18] chore: self mutation Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .../__snapshots__/construct-hub.test.ts.snap | 899 ++++++++++++++---- .../__snapshots__/snapshot.test.ts.snap | 179 +++- 2 files changed, 866 insertions(+), 212 deletions(-) diff --git a/src/__tests__/__snapshots__/construct-hub.test.ts.snap b/src/__tests__/__snapshots__/construct-hub.test.ts.snap index 15bf6bab0..846cd0571 100644 --- a/src/__tests__/__snapshots__/construct-hub.test.ts.snap +++ b/src/__tests__/__snapshots__/construct-hub.test.ts.snap @@ -6845,34 +6845,34 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", "Fn::Join": [ "", [ - "{"StartAt":"Read Uninstallable Report","States":{"Read Uninstallable Report":{"Next":"Parse Report","Retry":[{"ErrorEquals":["S3.NoSuchKey"]}],"Catch":[{"ErrorEquals":["S3.NoSuchKey"],"Next":"No Report Found"}],"Type":"Task","ResultPath":"$.reportResponse","Resource":"arn:", + "{"StartAt":"Read Uninstallable Report","States":{"Read Uninstallable Report":{"Next":"Has Packages?","Retry":[{"ErrorEquals":["Lambda.ClientExecutionTimeoutException","Lambda.ServiceException","Lambda.AWSLambdaException","Lambda.SdkClientException"],"IntervalSeconds":2,"MaxAttempts":6,"BackoffRate":2},{"ErrorEquals":["Lambda.Unknown"],"IntervalSeconds":2,"MaxAttempts":3,"BackoffRate":2}],"Catch":[{"ErrorEquals":["States.TaskFailed"],"Next":"No Report Found"}],"Type":"Task","ResultPath":"$.reportResponse","Resource":"arn:", { "Ref": "AWS::Partition", }, - ":states:::aws-sdk:s3:getObject","Parameters":{"Bucket":"", + ":states:::lambda:invoke","Parameters":{"FunctionName":"", { - "Ref": "ConstructHubPackageDataDC5EF35E", + "Fn::GetAtt": [ + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionF9851BD2", + "Arn", + ], }, - "","Key":"uninstallable-objects/data.json"}},"Parse Report":{"Type":"Pass","ResultPath":"$.parsedReport","Parameters":{"packages.$":"States.StringToJson($.reportResponse.Body)"},"Next":"Has Packages?"},"Has Packages?":{"Type":"Choice","Choices":[{"Variable":"$.parsedReport.packages[0]","IsPresent":true,"Next":"Process Each Package"}],"Default":"No Packages to Retry"},"No Packages to Retry":{"Type":"Succeed"},"Process Each Package":{"Type":"Map","ResultPath":null,"Next":"Run Inventory","ItemsPath":"$.parsedReport.packages","Iterator":{"StartAt":"Transform Package Format","States":{"Transform Package Format":{"Type":"Pass","ResultPath":"$.transformed","Parameters":{"packageName.$":"States.ArrayGetItem(States.StringSplit($, \\"@\\"), 0)","packageVersion.$":"States.ArrayGetItem(States.StringSplit($, \\"@\\"), 1)"},"Next":"Retry Package"},"Retry Package":{"End":true,"Retry":[{"ErrorEquals":["StepFunctions.ExecutionLimitExceeded"]}],"Catch":[{"ErrorEquals":["States.TaskFailed"],"Next":"Package Retry Failed"}],"Type":"Task","Resource":"arn:", + "","Payload":{"bucket":"", { - "Ref": "AWS::Partition", + "Ref": "ConstructHubPackageDataDC5EF35E", }, - ":states:::states:startExecution.sync:2","Parameters":{"Input":{"Prefix.$":"States.Format('data/{}/v{}', $.transformed.packageName, $.transformed.packageVersion)"},"StateMachineArn":"", + "","key":"uninstallable-objects/data.json"}}},"Has Packages?":{"Type":"Choice","Choices":[{"Variable":"$.reportResponse.Payload.packages[0]","IsPresent":true,"Next":"Process Each Package"}],"Default":"No Packages to Retry"},"No Packages to Retry":{"Type":"Succeed"},"Process Each Package":{"Type":"Map","ResultPath":null,"End":true,"ItemsPath":"$.reportResponse.Payload.packages","ItemProcessor":{"ProcessorConfig":{"Mode":"INLINE"},"StartAt":"Retry Package","States":{"Retry Package":{"End":true,"Retry":[{"ErrorEquals":["StepFunctions.ExecutionLimitExceeded"],"IntervalSeconds":60,"MaxAttempts":3,"BackoffRate":2}],"Catch":[{"ErrorEquals":["States.ALL"],"ResultPath":"$.error","Next":"Package Retry Failed"}],"Type":"Task","Resource":"arn:", { - "Ref": "ConstructHubOrchestrationRegenerateAllDocumentationPerPackage9CF0FFB7", + "Ref": "AWS::Partition", }, - ""}},"Package Retry Failed":{"Type":"Succeed"}}}},"Run Inventory":{"End":true,"Retry":[{"ErrorEquals":["Lambda.ClientExecutionTimeoutException","Lambda.ServiceException","Lambda.AWSLambdaException","Lambda.SdkClientException"],"IntervalSeconds":2,"MaxAttempts":6,"BackoffRate":2},{"ErrorEquals":["Lambda.TooManyRequestsException"]}],"Type":"Task","ResultPath":null,"Resource":"arn:", + ":states:::states:startExecution.sync:2","Parameters":{"Input":{"bucket":"", { - "Ref": "AWS::Partition", + "Ref": "ConstructHubPackageDataDC5EF35E", }, - ":states:::lambda:invoke","Parameters":{"FunctionName":"", + "","assembly":{"key.$":"States.Format('data/{}/v{}/assembly.json', $.packageName, $.packageVersion)"},"metadata":{"key.$":"States.Format('data/{}/v{}/metadata.json', $.packageName, $.packageVersion)"},"package":{"key.$":"States.Format('data/{}/v{}/package.tgz', $.packageName, $.packageVersion)"}},"StateMachineArn":"", { - "Fn::GetAtt": [ - "ConstructHubInventoryCanary63D899BC", - "Arn", - ], + "Ref": "ConstructHubOrchestration39161A46", }, - "","Payload.$":"$"}},"No Report Found":{"Type":"Succeed"}},"TimeoutSeconds":21600}", + ""}},"Package Retry Failed":{"Type":"Pass","Parameters":{"package.$":"$.originalPackage","prefix.$":"States.Format('data/{}/v{}', $.packageName, $.packageVersion)","error.$":"$.error"},"End":true}}}},"No Report Found":{"Type":"Fail","Error":"NoReportFound","Cause":"Uninstallable packages report not found at uninstallable-objects/data.json"}},"TimeoutSeconds":21600}", ], ], }, @@ -6890,7 +6890,57 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", "Type": "AWS::StepFunctions::StateMachine", "UpdateReplacePolicy": "Delete", }, - "ConstructHubOrchestrationRetryUninstallablePackagesRole380D2573": { + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionF9851BD2": { + "DependsOn": [ + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionServiceRoleDefaultPolicyCAAF8F73", + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionServiceRole528C403B", + ], + "Properties": { + "Architectures": [ + "arm64", + ], + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", + }, + "S3Key": "fb54708aff141c6bb8f32a52c2c3ae5928620794390e5ea974fcb07cc588ffef.zip", + }, + "Description": "backend/orchestration/read-uninstallable-report.lambda.ts", + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionServiceRole528C403B", + "Arn", + ], + }, + "Runtime": "nodejs22.x", + }, + "Type": "AWS::Lambda::Function", + }, + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionLogRetentionBDF7ED83": { + "Properties": { + "LogGroupName": { + "Fn::Join": [ + "", + [ + "/aws/lambda/", + { + "Ref": "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionF9851BD2", + }, + ], + ], + }, + "RetentionInDays": 90, + "ServiceToken": { + "Fn::GetAtt": [ + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aFD4BFC8A", + "Arn", + ], + }, + }, + "Type": "Custom::LogRetention", + }, + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionServiceRole528C403B": { "Properties": { "AssumeRolePolicyDocument": { "Statement": [ @@ -6898,44 +6948,103 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": { - "Service": "states.amazonaws.com", + "Service": "lambda.amazonaws.com", }, }, ], "Version": "2012-10-17", }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition", + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", + ], + ], + }, + ], }, "Type": "AWS::IAM::Role", }, - "ConstructHubOrchestrationRetryUninstallablePackagesRoleDefaultPolicy7CB8A523": { + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionServiceRoleDefaultPolicyCAAF8F73": { "Properties": { "PolicyDocument": { "Statement": [ { - "Action": "s3:GetObject", + "Action": [ + "s3:GetObject*", + "s3:GetBucket*", + "s3:List*", + ], "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - { - "Fn::GetAtt": [ - "ConstructHubPackageDataDC5EF35E", - "Arn", - ], - }, - "/uninstallable-objects/data.json", + "Resource": [ + { + "Fn::GetAtt": [ + "ConstructHubPackageDataDC5EF35E", + "Arn", ], - ], + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "ConstructHubPackageDataDC5EF35E", + "Arn", + ], + }, + "/*", + ], + ], + }, + ], + }, + ], + "Version": "2012-10-17", + }, + "PolicyName": "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionServiceRoleDefaultPolicyCAAF8F73", + "Roles": [ + { + "Ref": "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionServiceRole528C403B", + }, + ], + }, + "Type": "AWS::IAM::Policy", + }, + "ConstructHubOrchestrationRetryUninstallablePackagesRole380D2573": { + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "states.amazonaws.com", }, }, + ], + "Version": "2012-10-17", + }, + }, + "Type": "AWS::IAM::Role", + }, + "ConstructHubOrchestrationRetryUninstallablePackagesRoleDefaultPolicy7CB8A523": { + "Properties": { + "PolicyDocument": { + "Statement": [ { "Action": "lambda:InvokeFunction", "Effect": "Allow", "Resource": [ { "Fn::GetAtt": [ - "ConstructHubInventoryCanary63D899BC", + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionF9851BD2", "Arn", ], }, @@ -6945,7 +7054,7 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", [ { "Fn::GetAtt": [ - "ConstructHubInventoryCanary63D899BC", + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionF9851BD2", "Arn", ], }, @@ -6959,7 +7068,7 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", "Action": "states:StartExecution", "Effect": "Allow", "Resource": { - "Ref": "ConstructHubOrchestrationRegenerateAllDocumentationPerPackage9CF0FFB7", + "Ref": "ConstructHubOrchestration39161A46", }, }, { @@ -6992,7 +7101,7 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", "Fn::Split": [ ":", { - "Ref": "ConstructHubOrchestrationRegenerateAllDocumentationPerPackage9CF0FFB7", + "Ref": "ConstructHubOrchestration39161A46", }, ], }, @@ -21127,34 +21236,34 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", "Fn::Join": [ "", [ - "{"StartAt":"Read Uninstallable Report","States":{"Read Uninstallable Report":{"Next":"Parse Report","Retry":[{"ErrorEquals":["S3.NoSuchKey"]}],"Catch":[{"ErrorEquals":["S3.NoSuchKey"],"Next":"No Report Found"}],"Type":"Task","ResultPath":"$.reportResponse","Resource":"arn:", + "{"StartAt":"Read Uninstallable Report","States":{"Read Uninstallable Report":{"Next":"Has Packages?","Retry":[{"ErrorEquals":["Lambda.ClientExecutionTimeoutException","Lambda.ServiceException","Lambda.AWSLambdaException","Lambda.SdkClientException"],"IntervalSeconds":2,"MaxAttempts":6,"BackoffRate":2},{"ErrorEquals":["Lambda.Unknown"],"IntervalSeconds":2,"MaxAttempts":3,"BackoffRate":2}],"Catch":[{"ErrorEquals":["States.TaskFailed"],"Next":"No Report Found"}],"Type":"Task","ResultPath":"$.reportResponse","Resource":"arn:", { "Ref": "AWS::Partition", }, - ":states:::aws-sdk:s3:getObject","Parameters":{"Bucket":"", + ":states:::lambda:invoke","Parameters":{"FunctionName":"", { - "Ref": "ConstructHubPackageDataDC5EF35E", + "Fn::GetAtt": [ + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionF9851BD2", + "Arn", + ], }, - "","Key":"uninstallable-objects/data.json"}},"Parse Report":{"Type":"Pass","ResultPath":"$.parsedReport","Parameters":{"packages.$":"States.StringToJson($.reportResponse.Body)"},"Next":"Has Packages?"},"Has Packages?":{"Type":"Choice","Choices":[{"Variable":"$.parsedReport.packages[0]","IsPresent":true,"Next":"Process Each Package"}],"Default":"No Packages to Retry"},"No Packages to Retry":{"Type":"Succeed"},"Process Each Package":{"Type":"Map","ResultPath":null,"Next":"Run Inventory","ItemsPath":"$.parsedReport.packages","Iterator":{"StartAt":"Transform Package Format","States":{"Transform Package Format":{"Type":"Pass","ResultPath":"$.transformed","Parameters":{"packageName.$":"States.ArrayGetItem(States.StringSplit($, \\"@\\"), 0)","packageVersion.$":"States.ArrayGetItem(States.StringSplit($, \\"@\\"), 1)"},"Next":"Retry Package"},"Retry Package":{"End":true,"Retry":[{"ErrorEquals":["StepFunctions.ExecutionLimitExceeded"]}],"Catch":[{"ErrorEquals":["States.TaskFailed"],"Next":"Package Retry Failed"}],"Type":"Task","Resource":"arn:", + "","Payload":{"bucket":"", { - "Ref": "AWS::Partition", + "Ref": "ConstructHubPackageDataDC5EF35E", }, - ":states:::states:startExecution.sync:2","Parameters":{"Input":{"Prefix.$":"States.Format('data/{}/v{}', $.transformed.packageName, $.transformed.packageVersion)"},"StateMachineArn":"", + "","key":"uninstallable-objects/data.json"}}},"Has Packages?":{"Type":"Choice","Choices":[{"Variable":"$.reportResponse.Payload.packages[0]","IsPresent":true,"Next":"Process Each Package"}],"Default":"No Packages to Retry"},"No Packages to Retry":{"Type":"Succeed"},"Process Each Package":{"Type":"Map","ResultPath":null,"End":true,"ItemsPath":"$.reportResponse.Payload.packages","ItemProcessor":{"ProcessorConfig":{"Mode":"INLINE"},"StartAt":"Retry Package","States":{"Retry Package":{"End":true,"Retry":[{"ErrorEquals":["StepFunctions.ExecutionLimitExceeded"],"IntervalSeconds":60,"MaxAttempts":3,"BackoffRate":2}],"Catch":[{"ErrorEquals":["States.ALL"],"ResultPath":"$.error","Next":"Package Retry Failed"}],"Type":"Task","Resource":"arn:", { - "Ref": "ConstructHubOrchestrationRegenerateAllDocumentationPerPackage9CF0FFB7", + "Ref": "AWS::Partition", }, - ""}},"Package Retry Failed":{"Type":"Succeed"}}}},"Run Inventory":{"End":true,"Retry":[{"ErrorEquals":["Lambda.ClientExecutionTimeoutException","Lambda.ServiceException","Lambda.AWSLambdaException","Lambda.SdkClientException"],"IntervalSeconds":2,"MaxAttempts":6,"BackoffRate":2},{"ErrorEquals":["Lambda.TooManyRequestsException"]}],"Type":"Task","ResultPath":null,"Resource":"arn:", + ":states:::states:startExecution.sync:2","Parameters":{"Input":{"bucket":"", { - "Ref": "AWS::Partition", + "Ref": "ConstructHubPackageDataDC5EF35E", }, - ":states:::lambda:invoke","Parameters":{"FunctionName":"", + "","assembly":{"key.$":"States.Format('data/{}/v{}/assembly.json', $.packageName, $.packageVersion)"},"metadata":{"key.$":"States.Format('data/{}/v{}/metadata.json', $.packageName, $.packageVersion)"},"package":{"key.$":"States.Format('data/{}/v{}/package.tgz', $.packageName, $.packageVersion)"}},"StateMachineArn":"", { - "Fn::GetAtt": [ - "ConstructHubInventoryCanary63D899BC", - "Arn", - ], + "Ref": "ConstructHubOrchestration39161A46", }, - "","Payload.$":"$"}},"No Report Found":{"Type":"Succeed"}},"TimeoutSeconds":21600}", + ""}},"Package Retry Failed":{"Type":"Pass","Parameters":{"package.$":"$.originalPackage","prefix.$":"States.Format('data/{}/v{}', $.packageName, $.packageVersion)","error.$":"$.error"},"End":true}}}},"No Report Found":{"Type":"Fail","Error":"NoReportFound","Cause":"Uninstallable packages report not found at uninstallable-objects/data.json"}},"TimeoutSeconds":21600}", ], ], }, @@ -21172,6 +21281,133 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", "Type": "AWS::StepFunctions::StateMachine", "UpdateReplacePolicy": "Delete", }, + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionF9851BD2": { + "DependsOn": [ + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionServiceRoleDefaultPolicyCAAF8F73", + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionServiceRole528C403B", + ], + "Properties": { + "Architectures": [ + "arm64", + ], + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", + }, + "S3Key": "fb54708aff141c6bb8f32a52c2c3ae5928620794390e5ea974fcb07cc588ffef.zip", + }, + "Description": "backend/orchestration/read-uninstallable-report.lambda.ts", + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionServiceRole528C403B", + "Arn", + ], + }, + "Runtime": "nodejs22.x", + }, + "Type": "AWS::Lambda::Function", + }, + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionLogRetentionBDF7ED83": { + "Properties": { + "LogGroupName": { + "Fn::Join": [ + "", + [ + "/aws/lambda/", + { + "Ref": "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionF9851BD2", + }, + ], + ], + }, + "RetentionInDays": 90, + "ServiceToken": { + "Fn::GetAtt": [ + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aFD4BFC8A", + "Arn", + ], + }, + }, + "Type": "Custom::LogRetention", + }, + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionServiceRole528C403B": { + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com", + }, + }, + ], + "Version": "2012-10-17", + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition", + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", + ], + ], + }, + ], + }, + "Type": "AWS::IAM::Role", + }, + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionServiceRoleDefaultPolicyCAAF8F73": { + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "s3:GetObject*", + "s3:GetBucket*", + "s3:List*", + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "ConstructHubPackageDataDC5EF35E", + "Arn", + ], + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "ConstructHubPackageDataDC5EF35E", + "Arn", + ], + }, + "/*", + ], + ], + }, + ], + }, + ], + "Version": "2012-10-17", + }, + "PolicyName": "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionServiceRoleDefaultPolicyCAAF8F73", + "Roles": [ + { + "Ref": "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionServiceRole528C403B", + }, + ], + }, + "Type": "AWS::IAM::Policy", + }, "ConstructHubOrchestrationRetryUninstallablePackagesRole380D2573": { "Properties": { "AssumeRolePolicyDocument": { @@ -21193,31 +21429,13 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", "Properties": { "PolicyDocument": { "Statement": [ - { - "Action": "s3:GetObject", - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - { - "Fn::GetAtt": [ - "ConstructHubPackageDataDC5EF35E", - "Arn", - ], - }, - "/uninstallable-objects/data.json", - ], - ], - }, - }, { "Action": "lambda:InvokeFunction", "Effect": "Allow", "Resource": [ { "Fn::GetAtt": [ - "ConstructHubInventoryCanary63D899BC", + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionF9851BD2", "Arn", ], }, @@ -21227,7 +21445,7 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", [ { "Fn::GetAtt": [ - "ConstructHubInventoryCanary63D899BC", + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionF9851BD2", "Arn", ], }, @@ -21241,7 +21459,7 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", "Action": "states:StartExecution", "Effect": "Allow", "Resource": { - "Ref": "ConstructHubOrchestrationRegenerateAllDocumentationPerPackage9CF0FFB7", + "Ref": "ConstructHubOrchestration39161A46", }, }, { @@ -21274,7 +21492,7 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", "Fn::Split": [ ":", { - "Ref": "ConstructHubOrchestrationRegenerateAllDocumentationPerPackage9CF0FFB7", + "Ref": "ConstructHubOrchestration39161A46", }, ], }, @@ -35119,34 +35337,34 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", "Fn::Join": [ "", [ - "{"StartAt":"Read Uninstallable Report","States":{"Read Uninstallable Report":{"Next":"Parse Report","Retry":[{"ErrorEquals":["S3.NoSuchKey"]}],"Catch":[{"ErrorEquals":["S3.NoSuchKey"],"Next":"No Report Found"}],"Type":"Task","ResultPath":"$.reportResponse","Resource":"arn:", + "{"StartAt":"Read Uninstallable Report","States":{"Read Uninstallable Report":{"Next":"Has Packages?","Retry":[{"ErrorEquals":["Lambda.ClientExecutionTimeoutException","Lambda.ServiceException","Lambda.AWSLambdaException","Lambda.SdkClientException"],"IntervalSeconds":2,"MaxAttempts":6,"BackoffRate":2},{"ErrorEquals":["Lambda.Unknown"],"IntervalSeconds":2,"MaxAttempts":3,"BackoffRate":2}],"Catch":[{"ErrorEquals":["States.TaskFailed"],"Next":"No Report Found"}],"Type":"Task","ResultPath":"$.reportResponse","Resource":"arn:", { "Ref": "AWS::Partition", }, - ":states:::aws-sdk:s3:getObject","Parameters":{"Bucket":"", + ":states:::lambda:invoke","Parameters":{"FunctionName":"", { - "Ref": "ConstructHubPackageDataDC5EF35E", + "Fn::GetAtt": [ + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionF9851BD2", + "Arn", + ], }, - "","Key":"uninstallable-objects/data.json"}},"Parse Report":{"Type":"Pass","ResultPath":"$.parsedReport","Parameters":{"packages.$":"States.StringToJson($.reportResponse.Body)"},"Next":"Has Packages?"},"Has Packages?":{"Type":"Choice","Choices":[{"Variable":"$.parsedReport.packages[0]","IsPresent":true,"Next":"Process Each Package"}],"Default":"No Packages to Retry"},"No Packages to Retry":{"Type":"Succeed"},"Process Each Package":{"Type":"Map","ResultPath":null,"Next":"Run Inventory","ItemsPath":"$.parsedReport.packages","Iterator":{"StartAt":"Transform Package Format","States":{"Transform Package Format":{"Type":"Pass","ResultPath":"$.transformed","Parameters":{"packageName.$":"States.ArrayGetItem(States.StringSplit($, \\"@\\"), 0)","packageVersion.$":"States.ArrayGetItem(States.StringSplit($, \\"@\\"), 1)"},"Next":"Retry Package"},"Retry Package":{"End":true,"Retry":[{"ErrorEquals":["StepFunctions.ExecutionLimitExceeded"]}],"Catch":[{"ErrorEquals":["States.TaskFailed"],"Next":"Package Retry Failed"}],"Type":"Task","Resource":"arn:", + "","Payload":{"bucket":"", { - "Ref": "AWS::Partition", + "Ref": "ConstructHubPackageDataDC5EF35E", }, - ":states:::states:startExecution.sync:2","Parameters":{"Input":{"Prefix.$":"States.Format('data/{}/v{}', $.transformed.packageName, $.transformed.packageVersion)"},"StateMachineArn":"", + "","key":"uninstallable-objects/data.json"}}},"Has Packages?":{"Type":"Choice","Choices":[{"Variable":"$.reportResponse.Payload.packages[0]","IsPresent":true,"Next":"Process Each Package"}],"Default":"No Packages to Retry"},"No Packages to Retry":{"Type":"Succeed"},"Process Each Package":{"Type":"Map","ResultPath":null,"End":true,"ItemsPath":"$.reportResponse.Payload.packages","ItemProcessor":{"ProcessorConfig":{"Mode":"INLINE"},"StartAt":"Retry Package","States":{"Retry Package":{"End":true,"Retry":[{"ErrorEquals":["StepFunctions.ExecutionLimitExceeded"],"IntervalSeconds":60,"MaxAttempts":3,"BackoffRate":2}],"Catch":[{"ErrorEquals":["States.ALL"],"ResultPath":"$.error","Next":"Package Retry Failed"}],"Type":"Task","Resource":"arn:", { - "Ref": "ConstructHubOrchestrationRegenerateAllDocumentationPerPackage9CF0FFB7", + "Ref": "AWS::Partition", }, - ""}},"Package Retry Failed":{"Type":"Succeed"}}}},"Run Inventory":{"End":true,"Retry":[{"ErrorEquals":["Lambda.ClientExecutionTimeoutException","Lambda.ServiceException","Lambda.AWSLambdaException","Lambda.SdkClientException"],"IntervalSeconds":2,"MaxAttempts":6,"BackoffRate":2},{"ErrorEquals":["Lambda.TooManyRequestsException"]}],"Type":"Task","ResultPath":null,"Resource":"arn:", + ":states:::states:startExecution.sync:2","Parameters":{"Input":{"bucket":"", { - "Ref": "AWS::Partition", + "Ref": "ConstructHubPackageDataDC5EF35E", }, - ":states:::lambda:invoke","Parameters":{"FunctionName":"", + "","assembly":{"key.$":"States.Format('data/{}/v{}/assembly.json', $.packageName, $.packageVersion)"},"metadata":{"key.$":"States.Format('data/{}/v{}/metadata.json', $.packageName, $.packageVersion)"},"package":{"key.$":"States.Format('data/{}/v{}/package.tgz', $.packageName, $.packageVersion)"}},"StateMachineArn":"", { - "Fn::GetAtt": [ - "ConstructHubInventoryCanary63D899BC", - "Arn", - ], + "Ref": "ConstructHubOrchestration39161A46", }, - "","Payload.$":"$"}},"No Report Found":{"Type":"Succeed"}},"TimeoutSeconds":21600}", + ""}},"Package Retry Failed":{"Type":"Pass","Parameters":{"package.$":"$.originalPackage","prefix.$":"States.Format('data/{}/v{}', $.packageName, $.packageVersion)","error.$":"$.error"},"End":true}}}},"No Report Found":{"Type":"Fail","Error":"NoReportFound","Cause":"Uninstallable packages report not found at uninstallable-objects/data.json"}},"TimeoutSeconds":21600}", ], ], }, @@ -35164,7 +35382,57 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", "Type": "AWS::StepFunctions::StateMachine", "UpdateReplacePolicy": "Delete", }, - "ConstructHubOrchestrationRetryUninstallablePackagesRole380D2573": { + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionF9851BD2": { + "DependsOn": [ + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionServiceRoleDefaultPolicyCAAF8F73", + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionServiceRole528C403B", + ], + "Properties": { + "Architectures": [ + "arm64", + ], + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", + }, + "S3Key": "fb54708aff141c6bb8f32a52c2c3ae5928620794390e5ea974fcb07cc588ffef.zip", + }, + "Description": "backend/orchestration/read-uninstallable-report.lambda.ts", + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionServiceRole528C403B", + "Arn", + ], + }, + "Runtime": "nodejs22.x", + }, + "Type": "AWS::Lambda::Function", + }, + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionLogRetentionBDF7ED83": { + "Properties": { + "LogGroupName": { + "Fn::Join": [ + "", + [ + "/aws/lambda/", + { + "Ref": "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionF9851BD2", + }, + ], + ], + }, + "RetentionInDays": 90, + "ServiceToken": { + "Fn::GetAtt": [ + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aFD4BFC8A", + "Arn", + ], + }, + }, + "Type": "Custom::LogRetention", + }, + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionServiceRole528C403B": { "Properties": { "AssumeRolePolicyDocument": { "Statement": [ @@ -35172,44 +35440,103 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": { - "Service": "states.amazonaws.com", + "Service": "lambda.amazonaws.com", }, }, ], "Version": "2012-10-17", }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition", + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", + ], + ], + }, + ], }, "Type": "AWS::IAM::Role", }, - "ConstructHubOrchestrationRetryUninstallablePackagesRoleDefaultPolicy7CB8A523": { + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionServiceRoleDefaultPolicyCAAF8F73": { "Properties": { "PolicyDocument": { "Statement": [ { - "Action": "s3:GetObject", + "Action": [ + "s3:GetObject*", + "s3:GetBucket*", + "s3:List*", + ], "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - { - "Fn::GetAtt": [ - "ConstructHubPackageDataDC5EF35E", - "Arn", - ], - }, - "/uninstallable-objects/data.json", + "Resource": [ + { + "Fn::GetAtt": [ + "ConstructHubPackageDataDC5EF35E", + "Arn", ], - ], + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "ConstructHubPackageDataDC5EF35E", + "Arn", + ], + }, + "/*", + ], + ], + }, + ], + }, + ], + "Version": "2012-10-17", + }, + "PolicyName": "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionServiceRoleDefaultPolicyCAAF8F73", + "Roles": [ + { + "Ref": "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionServiceRole528C403B", + }, + ], + }, + "Type": "AWS::IAM::Policy", + }, + "ConstructHubOrchestrationRetryUninstallablePackagesRole380D2573": { + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "states.amazonaws.com", }, }, + ], + "Version": "2012-10-17", + }, + }, + "Type": "AWS::IAM::Role", + }, + "ConstructHubOrchestrationRetryUninstallablePackagesRoleDefaultPolicy7CB8A523": { + "Properties": { + "PolicyDocument": { + "Statement": [ { "Action": "lambda:InvokeFunction", "Effect": "Allow", "Resource": [ { "Fn::GetAtt": [ - "ConstructHubInventoryCanary63D899BC", + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionF9851BD2", "Arn", ], }, @@ -35219,7 +35546,7 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", [ { "Fn::GetAtt": [ - "ConstructHubInventoryCanary63D899BC", + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionF9851BD2", "Arn", ], }, @@ -35233,7 +35560,7 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", "Action": "states:StartExecution", "Effect": "Allow", "Resource": { - "Ref": "ConstructHubOrchestrationRegenerateAllDocumentationPerPackage9CF0FFB7", + "Ref": "ConstructHubOrchestration39161A46", }, }, { @@ -35266,7 +35593,7 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", "Fn::Split": [ ":", { - "Ref": "ConstructHubOrchestrationRegenerateAllDocumentationPerPackage9CF0FFB7", + "Ref": "ConstructHubOrchestration39161A46", }, ], }, @@ -49195,34 +49522,34 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", "Fn::Join": [ "", [ - "{"StartAt":"Read Uninstallable Report","States":{"Read Uninstallable Report":{"Next":"Parse Report","Retry":[{"ErrorEquals":["S3.NoSuchKey"]}],"Catch":[{"ErrorEquals":["S3.NoSuchKey"],"Next":"No Report Found"}],"Type":"Task","ResultPath":"$.reportResponse","Resource":"arn:", + "{"StartAt":"Read Uninstallable Report","States":{"Read Uninstallable Report":{"Next":"Has Packages?","Retry":[{"ErrorEquals":["Lambda.ClientExecutionTimeoutException","Lambda.ServiceException","Lambda.AWSLambdaException","Lambda.SdkClientException"],"IntervalSeconds":2,"MaxAttempts":6,"BackoffRate":2},{"ErrorEquals":["Lambda.Unknown"],"IntervalSeconds":2,"MaxAttempts":3,"BackoffRate":2}],"Catch":[{"ErrorEquals":["States.TaskFailed"],"Next":"No Report Found"}],"Type":"Task","ResultPath":"$.reportResponse","Resource":"arn:", { "Ref": "AWS::Partition", }, - ":states:::aws-sdk:s3:getObject","Parameters":{"Bucket":"", + ":states:::lambda:invoke","Parameters":{"FunctionName":"", { - "Ref": "ConstructHubPackageDataDC5EF35E", + "Fn::GetAtt": [ + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionF9851BD2", + "Arn", + ], }, - "","Key":"uninstallable-objects/data.json"}},"Parse Report":{"Type":"Pass","ResultPath":"$.parsedReport","Parameters":{"packages.$":"States.StringToJson($.reportResponse.Body)"},"Next":"Has Packages?"},"Has Packages?":{"Type":"Choice","Choices":[{"Variable":"$.parsedReport.packages[0]","IsPresent":true,"Next":"Process Each Package"}],"Default":"No Packages to Retry"},"No Packages to Retry":{"Type":"Succeed"},"Process Each Package":{"Type":"Map","ResultPath":null,"Next":"Run Inventory","ItemsPath":"$.parsedReport.packages","Iterator":{"StartAt":"Transform Package Format","States":{"Transform Package Format":{"Type":"Pass","ResultPath":"$.transformed","Parameters":{"packageName.$":"States.ArrayGetItem(States.StringSplit($, \\"@\\"), 0)","packageVersion.$":"States.ArrayGetItem(States.StringSplit($, \\"@\\"), 1)"},"Next":"Retry Package"},"Retry Package":{"End":true,"Retry":[{"ErrorEquals":["StepFunctions.ExecutionLimitExceeded"]}],"Catch":[{"ErrorEquals":["States.TaskFailed"],"Next":"Package Retry Failed"}],"Type":"Task","Resource":"arn:", + "","Payload":{"bucket":"", { - "Ref": "AWS::Partition", + "Ref": "ConstructHubPackageDataDC5EF35E", }, - ":states:::states:startExecution.sync:2","Parameters":{"Input":{"Prefix.$":"States.Format('data/{}/v{}', $.transformed.packageName, $.transformed.packageVersion)"},"StateMachineArn":"", + "","key":"uninstallable-objects/data.json"}}},"Has Packages?":{"Type":"Choice","Choices":[{"Variable":"$.reportResponse.Payload.packages[0]","IsPresent":true,"Next":"Process Each Package"}],"Default":"No Packages to Retry"},"No Packages to Retry":{"Type":"Succeed"},"Process Each Package":{"Type":"Map","ResultPath":null,"End":true,"ItemsPath":"$.reportResponse.Payload.packages","ItemProcessor":{"ProcessorConfig":{"Mode":"INLINE"},"StartAt":"Retry Package","States":{"Retry Package":{"End":true,"Retry":[{"ErrorEquals":["StepFunctions.ExecutionLimitExceeded"],"IntervalSeconds":60,"MaxAttempts":3,"BackoffRate":2}],"Catch":[{"ErrorEquals":["States.ALL"],"ResultPath":"$.error","Next":"Package Retry Failed"}],"Type":"Task","Resource":"arn:", { - "Ref": "ConstructHubOrchestrationRegenerateAllDocumentationPerPackage9CF0FFB7", + "Ref": "AWS::Partition", }, - ""}},"Package Retry Failed":{"Type":"Succeed"}}}},"Run Inventory":{"End":true,"Retry":[{"ErrorEquals":["Lambda.ClientExecutionTimeoutException","Lambda.ServiceException","Lambda.AWSLambdaException","Lambda.SdkClientException"],"IntervalSeconds":2,"MaxAttempts":6,"BackoffRate":2},{"ErrorEquals":["Lambda.TooManyRequestsException"]}],"Type":"Task","ResultPath":null,"Resource":"arn:", + ":states:::states:startExecution.sync:2","Parameters":{"Input":{"bucket":"", { - "Ref": "AWS::Partition", + "Ref": "ConstructHubPackageDataDC5EF35E", }, - ":states:::lambda:invoke","Parameters":{"FunctionName":"", + "","assembly":{"key.$":"States.Format('data/{}/v{}/assembly.json', $.packageName, $.packageVersion)"},"metadata":{"key.$":"States.Format('data/{}/v{}/metadata.json', $.packageName, $.packageVersion)"},"package":{"key.$":"States.Format('data/{}/v{}/package.tgz', $.packageName, $.packageVersion)"}},"StateMachineArn":"", { - "Fn::GetAtt": [ - "ConstructHubInventoryCanary63D899BC", - "Arn", - ], + "Ref": "ConstructHubOrchestration39161A46", }, - "","Payload.$":"$"}},"No Report Found":{"Type":"Succeed"}},"TimeoutSeconds":21600}", + ""}},"Package Retry Failed":{"Type":"Pass","Parameters":{"package.$":"$.originalPackage","prefix.$":"States.Format('data/{}/v{}', $.packageName, $.packageVersion)","error.$":"$.error"},"End":true}}}},"No Report Found":{"Type":"Fail","Error":"NoReportFound","Cause":"Uninstallable packages report not found at uninstallable-objects/data.json"}},"TimeoutSeconds":21600}", ], ], }, @@ -49240,7 +49567,57 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", "Type": "AWS::StepFunctions::StateMachine", "UpdateReplacePolicy": "Delete", }, - "ConstructHubOrchestrationRetryUninstallablePackagesRole380D2573": { + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionF9851BD2": { + "DependsOn": [ + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionServiceRoleDefaultPolicyCAAF8F73", + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionServiceRole528C403B", + ], + "Properties": { + "Architectures": [ + "arm64", + ], + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", + }, + "S3Key": "fb54708aff141c6bb8f32a52c2c3ae5928620794390e5ea974fcb07cc588ffef.zip", + }, + "Description": "backend/orchestration/read-uninstallable-report.lambda.ts", + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionServiceRole528C403B", + "Arn", + ], + }, + "Runtime": "nodejs22.x", + }, + "Type": "AWS::Lambda::Function", + }, + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionLogRetentionBDF7ED83": { + "Properties": { + "LogGroupName": { + "Fn::Join": [ + "", + [ + "/aws/lambda/", + { + "Ref": "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionF9851BD2", + }, + ], + ], + }, + "RetentionInDays": 90, + "ServiceToken": { + "Fn::GetAtt": [ + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aFD4BFC8A", + "Arn", + ], + }, + }, + "Type": "Custom::LogRetention", + }, + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionServiceRole528C403B": { "Properties": { "AssumeRolePolicyDocument": { "Statement": [ @@ -49248,44 +49625,103 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": { - "Service": "states.amazonaws.com", + "Service": "lambda.amazonaws.com", }, }, ], "Version": "2012-10-17", }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition", + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", + ], + ], + }, + ], }, "Type": "AWS::IAM::Role", }, - "ConstructHubOrchestrationRetryUninstallablePackagesRoleDefaultPolicy7CB8A523": { + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionServiceRoleDefaultPolicyCAAF8F73": { "Properties": { "PolicyDocument": { "Statement": [ { - "Action": "s3:GetObject", + "Action": [ + "s3:GetObject*", + "s3:GetBucket*", + "s3:List*", + ], "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - { - "Fn::GetAtt": [ - "ConstructHubPackageDataDC5EF35E", - "Arn", - ], - }, - "/uninstallable-objects/data.json", + "Resource": [ + { + "Fn::GetAtt": [ + "ConstructHubPackageDataDC5EF35E", + "Arn", ], - ], + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "ConstructHubPackageDataDC5EF35E", + "Arn", + ], + }, + "/*", + ], + ], + }, + ], + }, + ], + "Version": "2012-10-17", + }, + "PolicyName": "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionServiceRoleDefaultPolicyCAAF8F73", + "Roles": [ + { + "Ref": "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionServiceRole528C403B", + }, + ], + }, + "Type": "AWS::IAM::Policy", + }, + "ConstructHubOrchestrationRetryUninstallablePackagesRole380D2573": { + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "states.amazonaws.com", }, }, + ], + "Version": "2012-10-17", + }, + }, + "Type": "AWS::IAM::Role", + }, + "ConstructHubOrchestrationRetryUninstallablePackagesRoleDefaultPolicy7CB8A523": { + "Properties": { + "PolicyDocument": { + "Statement": [ { "Action": "lambda:InvokeFunction", "Effect": "Allow", "Resource": [ { "Fn::GetAtt": [ - "ConstructHubInventoryCanary63D899BC", + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionF9851BD2", "Arn", ], }, @@ -49295,7 +49731,7 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", [ { "Fn::GetAtt": [ - "ConstructHubInventoryCanary63D899BC", + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionF9851BD2", "Arn", ], }, @@ -49309,7 +49745,7 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", "Action": "states:StartExecution", "Effect": "Allow", "Resource": { - "Ref": "ConstructHubOrchestrationRegenerateAllDocumentationPerPackage9CF0FFB7", + "Ref": "ConstructHubOrchestration39161A46", }, }, { @@ -49342,7 +49778,7 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", "Fn::Split": [ ":", { - "Ref": "ConstructHubOrchestrationRegenerateAllDocumentationPerPackage9CF0FFB7", + "Ref": "ConstructHubOrchestration39161A46", }, ], }, @@ -63184,34 +63620,34 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", "Fn::Join": [ "", [ - "{"StartAt":"Read Uninstallable Report","States":{"Read Uninstallable Report":{"Next":"Parse Report","Retry":[{"ErrorEquals":["S3.NoSuchKey"]}],"Catch":[{"ErrorEquals":["S3.NoSuchKey"],"Next":"No Report Found"}],"Type":"Task","ResultPath":"$.reportResponse","Resource":"arn:", + "{"StartAt":"Read Uninstallable Report","States":{"Read Uninstallable Report":{"Next":"Has Packages?","Retry":[{"ErrorEquals":["Lambda.ClientExecutionTimeoutException","Lambda.ServiceException","Lambda.AWSLambdaException","Lambda.SdkClientException"],"IntervalSeconds":2,"MaxAttempts":6,"BackoffRate":2},{"ErrorEquals":["Lambda.Unknown"],"IntervalSeconds":2,"MaxAttempts":3,"BackoffRate":2}],"Catch":[{"ErrorEquals":["States.TaskFailed"],"Next":"No Report Found"}],"Type":"Task","ResultPath":"$.reportResponse","Resource":"arn:", { "Ref": "AWS::Partition", }, - ":states:::aws-sdk:s3:getObject","Parameters":{"Bucket":"", + ":states:::lambda:invoke","Parameters":{"FunctionName":"", { - "Ref": "ConstructHubPackageDataDC5EF35E", + "Fn::GetAtt": [ + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionF9851BD2", + "Arn", + ], }, - "","Key":"uninstallable-objects/data.json"}},"Parse Report":{"Type":"Pass","ResultPath":"$.parsedReport","Parameters":{"packages.$":"States.StringToJson($.reportResponse.Body)"},"Next":"Has Packages?"},"Has Packages?":{"Type":"Choice","Choices":[{"Variable":"$.parsedReport.packages[0]","IsPresent":true,"Next":"Process Each Package"}],"Default":"No Packages to Retry"},"No Packages to Retry":{"Type":"Succeed"},"Process Each Package":{"Type":"Map","ResultPath":null,"Next":"Run Inventory","ItemsPath":"$.parsedReport.packages","Iterator":{"StartAt":"Transform Package Format","States":{"Transform Package Format":{"Type":"Pass","ResultPath":"$.transformed","Parameters":{"packageName.$":"States.ArrayGetItem(States.StringSplit($, \\"@\\"), 0)","packageVersion.$":"States.ArrayGetItem(States.StringSplit($, \\"@\\"), 1)"},"Next":"Retry Package"},"Retry Package":{"End":true,"Retry":[{"ErrorEquals":["StepFunctions.ExecutionLimitExceeded"]}],"Catch":[{"ErrorEquals":["States.TaskFailed"],"Next":"Package Retry Failed"}],"Type":"Task","Resource":"arn:", + "","Payload":{"bucket":"", { - "Ref": "AWS::Partition", + "Ref": "ConstructHubPackageDataDC5EF35E", }, - ":states:::states:startExecution.sync:2","Parameters":{"Input":{"Prefix.$":"States.Format('data/{}/v{}', $.transformed.packageName, $.transformed.packageVersion)"},"StateMachineArn":"", + "","key":"uninstallable-objects/data.json"}}},"Has Packages?":{"Type":"Choice","Choices":[{"Variable":"$.reportResponse.Payload.packages[0]","IsPresent":true,"Next":"Process Each Package"}],"Default":"No Packages to Retry"},"No Packages to Retry":{"Type":"Succeed"},"Process Each Package":{"Type":"Map","ResultPath":null,"End":true,"ItemsPath":"$.reportResponse.Payload.packages","ItemProcessor":{"ProcessorConfig":{"Mode":"INLINE"},"StartAt":"Retry Package","States":{"Retry Package":{"End":true,"Retry":[{"ErrorEquals":["StepFunctions.ExecutionLimitExceeded"],"IntervalSeconds":60,"MaxAttempts":3,"BackoffRate":2}],"Catch":[{"ErrorEquals":["States.ALL"],"ResultPath":"$.error","Next":"Package Retry Failed"}],"Type":"Task","Resource":"arn:", { - "Ref": "ConstructHubOrchestrationRegenerateAllDocumentationPerPackage9CF0FFB7", + "Ref": "AWS::Partition", }, - ""}},"Package Retry Failed":{"Type":"Succeed"}}}},"Run Inventory":{"End":true,"Retry":[{"ErrorEquals":["Lambda.ClientExecutionTimeoutException","Lambda.ServiceException","Lambda.AWSLambdaException","Lambda.SdkClientException"],"IntervalSeconds":2,"MaxAttempts":6,"BackoffRate":2},{"ErrorEquals":["Lambda.TooManyRequestsException"]}],"Type":"Task","ResultPath":null,"Resource":"arn:", + ":states:::states:startExecution.sync:2","Parameters":{"Input":{"bucket":"", { - "Ref": "AWS::Partition", + "Ref": "ConstructHubPackageDataDC5EF35E", }, - ":states:::lambda:invoke","Parameters":{"FunctionName":"", + "","assembly":{"key.$":"States.Format('data/{}/v{}/assembly.json', $.packageName, $.packageVersion)"},"metadata":{"key.$":"States.Format('data/{}/v{}/metadata.json', $.packageName, $.packageVersion)"},"package":{"key.$":"States.Format('data/{}/v{}/package.tgz', $.packageName, $.packageVersion)"}},"StateMachineArn":"", { - "Fn::GetAtt": [ - "ConstructHubInventoryCanary63D899BC", - "Arn", - ], + "Ref": "ConstructHubOrchestration39161A46", }, - "","Payload.$":"$"}},"No Report Found":{"Type":"Succeed"}},"TimeoutSeconds":21600}", + ""}},"Package Retry Failed":{"Type":"Pass","Parameters":{"package.$":"$.originalPackage","prefix.$":"States.Format('data/{}/v{}', $.packageName, $.packageVersion)","error.$":"$.error"},"End":true}}}},"No Report Found":{"Type":"Fail","Error":"NoReportFound","Cause":"Uninstallable packages report not found at uninstallable-objects/data.json"}},"TimeoutSeconds":21600}", ], ], }, @@ -63229,7 +63665,57 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", "Type": "AWS::StepFunctions::StateMachine", "UpdateReplacePolicy": "Delete", }, - "ConstructHubOrchestrationRetryUninstallablePackagesRole380D2573": { + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionF9851BD2": { + "DependsOn": [ + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionServiceRoleDefaultPolicyCAAF8F73", + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionServiceRole528C403B", + ], + "Properties": { + "Architectures": [ + "arm64", + ], + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", + }, + "S3Key": "fb54708aff141c6bb8f32a52c2c3ae5928620794390e5ea974fcb07cc588ffef.zip", + }, + "Description": "backend/orchestration/read-uninstallable-report.lambda.ts", + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionServiceRole528C403B", + "Arn", + ], + }, + "Runtime": "nodejs22.x", + }, + "Type": "AWS::Lambda::Function", + }, + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionLogRetentionBDF7ED83": { + "Properties": { + "LogGroupName": { + "Fn::Join": [ + "", + [ + "/aws/lambda/", + { + "Ref": "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionF9851BD2", + }, + ], + ], + }, + "RetentionInDays": 90, + "ServiceToken": { + "Fn::GetAtt": [ + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aFD4BFC8A", + "Arn", + ], + }, + }, + "Type": "Custom::LogRetention", + }, + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionServiceRole528C403B": { "Properties": { "AssumeRolePolicyDocument": { "Statement": [ @@ -63237,44 +63723,103 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": { - "Service": "states.amazonaws.com", + "Service": "lambda.amazonaws.com", }, }, ], "Version": "2012-10-17", }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition", + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", + ], + ], + }, + ], }, "Type": "AWS::IAM::Role", }, - "ConstructHubOrchestrationRetryUninstallablePackagesRoleDefaultPolicy7CB8A523": { + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionServiceRoleDefaultPolicyCAAF8F73": { "Properties": { "PolicyDocument": { "Statement": [ { - "Action": "s3:GetObject", + "Action": [ + "s3:GetObject*", + "s3:GetBucket*", + "s3:List*", + ], "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - { - "Fn::GetAtt": [ - "ConstructHubPackageDataDC5EF35E", - "Arn", - ], - }, - "/uninstallable-objects/data.json", + "Resource": [ + { + "Fn::GetAtt": [ + "ConstructHubPackageDataDC5EF35E", + "Arn", ], - ], + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "ConstructHubPackageDataDC5EF35E", + "Arn", + ], + }, + "/*", + ], + ], + }, + ], + }, + ], + "Version": "2012-10-17", + }, + "PolicyName": "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionServiceRoleDefaultPolicyCAAF8F73", + "Roles": [ + { + "Ref": "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionServiceRole528C403B", + }, + ], + }, + "Type": "AWS::IAM::Policy", + }, + "ConstructHubOrchestrationRetryUninstallablePackagesRole380D2573": { + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "states.amazonaws.com", }, }, + ], + "Version": "2012-10-17", + }, + }, + "Type": "AWS::IAM::Role", + }, + "ConstructHubOrchestrationRetryUninstallablePackagesRoleDefaultPolicy7CB8A523": { + "Properties": { + "PolicyDocument": { + "Statement": [ { "Action": "lambda:InvokeFunction", "Effect": "Allow", "Resource": [ { "Fn::GetAtt": [ - "ConstructHubInventoryCanary63D899BC", + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionF9851BD2", "Arn", ], }, @@ -63284,7 +63829,7 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", [ { "Fn::GetAtt": [ - "ConstructHubInventoryCanary63D899BC", + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionF9851BD2", "Arn", ], }, @@ -63298,7 +63843,7 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", "Action": "states:StartExecution", "Effect": "Allow", "Resource": { - "Ref": "ConstructHubOrchestrationRegenerateAllDocumentationPerPackage9CF0FFB7", + "Ref": "ConstructHubOrchestration39161A46", }, }, { @@ -63331,7 +63876,7 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", "Fn::Split": [ ":", { - "Ref": "ConstructHubOrchestrationRegenerateAllDocumentationPerPackage9CF0FFB7", + "Ref": "ConstructHubOrchestration39161A46", }, ], }, diff --git a/src/__tests__/devapp/__snapshots__/snapshot.test.ts.snap b/src/__tests__/devapp/__snapshots__/snapshot.test.ts.snap index 568771237..09cad5955 100644 --- a/src/__tests__/devapp/__snapshots__/snapshot.test.ts.snap +++ b/src/__tests__/devapp/__snapshots__/snapshot.test.ts.snap @@ -7061,34 +7061,34 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", "Fn::Join": [ "", [ - "{"StartAt":"Read Uninstallable Report","States":{"Read Uninstallable Report":{"Next":"Parse Report","Retry":[{"ErrorEquals":["S3.NoSuchKey"]}],"Catch":[{"ErrorEquals":["S3.NoSuchKey"],"Next":"No Report Found"}],"Type":"Task","ResultPath":"$.reportResponse","Resource":"arn:", + "{"StartAt":"Read Uninstallable Report","States":{"Read Uninstallable Report":{"Next":"Has Packages?","Retry":[{"ErrorEquals":["Lambda.ClientExecutionTimeoutException","Lambda.ServiceException","Lambda.AWSLambdaException","Lambda.SdkClientException"],"IntervalSeconds":2,"MaxAttempts":6,"BackoffRate":2},{"ErrorEquals":["Lambda.Unknown"],"IntervalSeconds":2,"MaxAttempts":3,"BackoffRate":2}],"Catch":[{"ErrorEquals":["States.TaskFailed"],"Next":"No Report Found"}],"Type":"Task","ResultPath":"$.reportResponse","Resource":"arn:", { "Ref": "AWS::Partition", }, - ":states:::aws-sdk:s3:getObject","Parameters":{"Bucket":"", + ":states:::lambda:invoke","Parameters":{"FunctionName":"", { - "Ref": "ConstructHubPackageDataDC5EF35E", + "Fn::GetAtt": [ + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionF9851BD2", + "Arn", + ], }, - "","Key":"uninstallable-objects/data.json"}},"Parse Report":{"Type":"Pass","ResultPath":"$.parsedReport","Parameters":{"packages.$":"States.StringToJson($.reportResponse.Body)"},"Next":"Has Packages?"},"Has Packages?":{"Type":"Choice","Choices":[{"Variable":"$.parsedReport.packages[0]","IsPresent":true,"Next":"Process Each Package"}],"Default":"No Packages to Retry"},"No Packages to Retry":{"Type":"Succeed"},"Process Each Package":{"Type":"Map","ResultPath":null,"Next":"Run Inventory","ItemsPath":"$.parsedReport.packages","Iterator":{"StartAt":"Transform Package Format","States":{"Transform Package Format":{"Type":"Pass","ResultPath":"$.transformed","Parameters":{"packageName.$":"States.ArrayGetItem(States.StringSplit($, \\"@\\"), 0)","packageVersion.$":"States.ArrayGetItem(States.StringSplit($, \\"@\\"), 1)"},"Next":"Retry Package"},"Retry Package":{"End":true,"Retry":[{"ErrorEquals":["StepFunctions.ExecutionLimitExceeded"]}],"Catch":[{"ErrorEquals":["States.TaskFailed"],"Next":"Package Retry Failed"}],"Type":"Task","Resource":"arn:", + "","Payload":{"bucket":"", { - "Ref": "AWS::Partition", + "Ref": "ConstructHubPackageDataDC5EF35E", }, - ":states:::states:startExecution.sync:2","Parameters":{"Input":{"Prefix.$":"States.Format('data/{}/v{}', $.transformed.packageName, $.transformed.packageVersion)"},"StateMachineArn":"", + "","key":"uninstallable-objects/data.json"}}},"Has Packages?":{"Type":"Choice","Choices":[{"Variable":"$.reportResponse.Payload.packages[0]","IsPresent":true,"Next":"Process Each Package"}],"Default":"No Packages to Retry"},"No Packages to Retry":{"Type":"Succeed"},"Process Each Package":{"Type":"Map","ResultPath":null,"End":true,"ItemsPath":"$.reportResponse.Payload.packages","ItemProcessor":{"ProcessorConfig":{"Mode":"INLINE"},"StartAt":"Retry Package","States":{"Retry Package":{"End":true,"Retry":[{"ErrorEquals":["StepFunctions.ExecutionLimitExceeded"],"IntervalSeconds":60,"MaxAttempts":3,"BackoffRate":2}],"Catch":[{"ErrorEquals":["States.ALL"],"ResultPath":"$.error","Next":"Package Retry Failed"}],"Type":"Task","Resource":"arn:", { - "Ref": "ConstructHubOrchestrationRegenerateAllDocumentationPerPackage9CF0FFB7", + "Ref": "AWS::Partition", }, - ""}},"Package Retry Failed":{"Type":"Succeed"}}}},"Run Inventory":{"End":true,"Retry":[{"ErrorEquals":["Lambda.ClientExecutionTimeoutException","Lambda.ServiceException","Lambda.AWSLambdaException","Lambda.SdkClientException"],"IntervalSeconds":2,"MaxAttempts":6,"BackoffRate":2},{"ErrorEquals":["Lambda.TooManyRequestsException"]}],"Type":"Task","ResultPath":null,"Resource":"arn:", + ":states:::states:startExecution.sync:2","Parameters":{"Input":{"bucket":"", { - "Ref": "AWS::Partition", + "Ref": "ConstructHubPackageDataDC5EF35E", }, - ":states:::lambda:invoke","Parameters":{"FunctionName":"", + "","assembly":{"key.$":"States.Format('data/{}/v{}/assembly.json', $.packageName, $.packageVersion)"},"metadata":{"key.$":"States.Format('data/{}/v{}/metadata.json', $.packageName, $.packageVersion)"},"package":{"key.$":"States.Format('data/{}/v{}/package.tgz', $.packageName, $.packageVersion)"}},"StateMachineArn":"", { - "Fn::GetAtt": [ - "ConstructHubInventoryCanary63D899BC", - "Arn", - ], + "Ref": "ConstructHubOrchestration39161A46", }, - "","Payload.$":"$"}},"No Report Found":{"Type":"Succeed"}},"TimeoutSeconds":21600}", + ""}},"Package Retry Failed":{"Type":"Pass","Parameters":{"package.$":"$.originalPackage","prefix.$":"States.Format('data/{}/v{}', $.packageName, $.packageVersion)","error.$":"$.error"},"End":true}}}},"No Report Found":{"Type":"Fail","Error":"NoReportFound","Cause":"Uninstallable packages report not found at uninstallable-objects/data.json"}},"TimeoutSeconds":21600}", ], ], }, @@ -7106,7 +7106,57 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", "Type": "AWS::StepFunctions::StateMachine", "UpdateReplacePolicy": "Delete", }, - "ConstructHubOrchestrationRetryUninstallablePackagesRole380D2573": { + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionF9851BD2": { + "DependsOn": [ + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionServiceRoleDefaultPolicyCAAF8F73", + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionServiceRole528C403B", + ], + "Properties": { + "Architectures": [ + "arm64", + ], + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", + }, + "S3Key": "fb54708aff141c6bb8f32a52c2c3ae5928620794390e5ea974fcb07cc588ffef.zip", + }, + "Description": "backend/orchestration/read-uninstallable-report.lambda.ts", + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionServiceRole528C403B", + "Arn", + ], + }, + "Runtime": "nodejs22.x", + }, + "Type": "AWS::Lambda::Function", + }, + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionLogRetentionBDF7ED83": { + "Properties": { + "LogGroupName": { + "Fn::Join": [ + "", + [ + "/aws/lambda/", + { + "Ref": "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionF9851BD2", + }, + ], + ], + }, + "RetentionInDays": 90, + "ServiceToken": { + "Fn::GetAtt": [ + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aFD4BFC8A", + "Arn", + ], + }, + }, + "Type": "Custom::LogRetention", + }, + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionServiceRole528C403B": { "Properties": { "AssumeRolePolicyDocument": { "Statement": [ @@ -7114,44 +7164,103 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": { - "Service": "states.amazonaws.com", + "Service": "lambda.amazonaws.com", }, }, ], "Version": "2012-10-17", }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition", + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", + ], + ], + }, + ], }, "Type": "AWS::IAM::Role", }, - "ConstructHubOrchestrationRetryUninstallablePackagesRoleDefaultPolicy7CB8A523": { + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionServiceRoleDefaultPolicyCAAF8F73": { "Properties": { "PolicyDocument": { "Statement": [ { - "Action": "s3:GetObject", + "Action": [ + "s3:GetObject*", + "s3:GetBucket*", + "s3:List*", + ], "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - { - "Fn::GetAtt": [ - "ConstructHubPackageDataDC5EF35E", - "Arn", - ], - }, - "/uninstallable-objects/data.json", + "Resource": [ + { + "Fn::GetAtt": [ + "ConstructHubPackageDataDC5EF35E", + "Arn", ], - ], + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "ConstructHubPackageDataDC5EF35E", + "Arn", + ], + }, + "/*", + ], + ], + }, + ], + }, + ], + "Version": "2012-10-17", + }, + "PolicyName": "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionServiceRoleDefaultPolicyCAAF8F73", + "Roles": [ + { + "Ref": "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionServiceRole528C403B", + }, + ], + }, + "Type": "AWS::IAM::Policy", + }, + "ConstructHubOrchestrationRetryUninstallablePackagesRole380D2573": { + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "states.amazonaws.com", }, }, + ], + "Version": "2012-10-17", + }, + }, + "Type": "AWS::IAM::Role", + }, + "ConstructHubOrchestrationRetryUninstallablePackagesRoleDefaultPolicy7CB8A523": { + "Properties": { + "PolicyDocument": { + "Statement": [ { "Action": "lambda:InvokeFunction", "Effect": "Allow", "Resource": [ { "Fn::GetAtt": [ - "ConstructHubInventoryCanary63D899BC", + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionF9851BD2", "Arn", ], }, @@ -7161,7 +7270,7 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", [ { "Fn::GetAtt": [ - "ConstructHubInventoryCanary63D899BC", + "ConstructHubOrchestrationRetryUninstallablePackagesReadReportFunctionF9851BD2", "Arn", ], }, @@ -7175,7 +7284,7 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", "Action": "states:StartExecution", "Effect": "Allow", "Resource": { - "Ref": "ConstructHubOrchestrationRegenerateAllDocumentationPerPackage9CF0FFB7", + "Ref": "ConstructHubOrchestration39161A46", }, }, { @@ -7208,7 +7317,7 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", "Fn::Split": [ ":", { - "Ref": "ConstructHubOrchestrationRegenerateAllDocumentationPerPackage9CF0FFB7", + "Ref": "ConstructHubOrchestration39161A46", }, ], }, From a5b9b6fe4325b8475ee9bcb0e5d16c1bb8581878 Mon Sep 17 00:00:00 2001 From: Momo Kornher Date: Thu, 20 Nov 2025 14:38:32 +0000 Subject: [PATCH 17/18] more fixes --- src/backend/orchestration/index.ts | 5 ----- src/construct-hub.ts | 15 +++++++-------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/backend/orchestration/index.ts b/src/backend/orchestration/index.ts index 5d2300c74..fcb86ac69 100644 --- a/src/backend/orchestration/index.ts +++ b/src/backend/orchestration/index.ts @@ -106,11 +106,6 @@ export interface OrchestrationProps { */ readonly bucket: IBucket; - /** - * The inventory canary function. - */ - readonly inventory: { function: IFunction }; - /** * The CodeArtifact registry to use for regular operations. */ diff --git a/src/construct-hub.ts b/src/construct-hub.ts index db38d1bc1..f63a01cb9 100644 --- a/src/construct-hub.ts +++ b/src/construct-hub.ts @@ -408,13 +408,6 @@ export class ConstructHub extends Construct implements iam.IGrantable { monitoring: this.monitoring, }); - const inventory = new Inventory(this, 'InventoryCanary', { - bucket: packageData, - logRetention: props.logRetention, - monitoring: this.monitoring, - overviewDashboard: overviewDashboard, - }); - const orchestration = new Orchestration(this, 'Orchestration', { bucket: packageData, codeArtifact, @@ -428,7 +421,6 @@ export class ConstructHub extends Construct implements iam.IGrantable { vpcSecurityGroups, feedBuilder, alarmSeverities: props.alarmSeverities, - inventory, }); this.regenerateAllDocumentationPerPackage = orchestration.regenerateAllDocumentationPerPackage; @@ -518,6 +510,13 @@ export class ConstructHub extends Construct implements iam.IGrantable { }) ); + const inventory = new Inventory(this, 'InventoryCanary', { + bucket: packageData, + logRetention: props.logRetention, + monitoring: this.monitoring, + overviewDashboard: overviewDashboard, + }); + new BackendDashboard(this, 'BackendDashboard', { packageData, dashboardName: props.backendDashboardName, From 840d51a3d98d251545dc0c5f75c30bce88686014 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 20 Nov 2025 14:44:24 +0000 Subject: [PATCH 18/18] chore: self mutation Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .../__snapshots__/construct-hub.test.ts.snap | 140 +++++++++--------- .../__snapshots__/snapshot.test.ts.snap | 32 ++-- 2 files changed, 86 insertions(+), 86 deletions(-) diff --git a/src/__tests__/__snapshots__/construct-hub.test.ts.snap b/src/__tests__/__snapshots__/construct-hub.test.ts.snap index 846cd0571..fb379e774 100644 --- a/src/__tests__/__snapshots__/construct-hub.test.ts.snap +++ b/src/__tests__/__snapshots__/construct-hub.test.ts.snap @@ -9698,35 +9698,31 @@ Request a service quota increase for lambda functions", { "Ref": "ConstructHubFeedBuilderReleaseNotesUpdateFeedBB0BA91D", }, - "",{"label":"updateFeedFunction","stat":"Maximum","visible":false,"id":"m3"}],[{"label":"CanaryResourceLambda quota usage %","expression":"m4 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", - { - "Ref": "ConstructHubInventoryCanary63D899BC", - }, - "",{"label":"CanaryResourceLambda","stat":"Maximum","visible":false,"id":"m4"}],[{"label":"CatalogBuilderLambda quota usage %","expression":"m5 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"updateFeedFunction","stat":"Maximum","visible":false,"id":"m3"}],[{"label":"CatalogBuilderLambda quota usage %","expression":"m4 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubOrchestrationCatalogBuilder7C964951", }, - "",{"label":"CatalogBuilderLambda","stat":"Maximum","visible":false,"id":"m5"}],[{"label":"NeedsCatalogUpdateLambda quota usage %","expression":"m6 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"CatalogBuilderLambda","stat":"Maximum","visible":false,"id":"m4"}],[{"label":"NeedsCatalogUpdateLambda quota usage %","expression":"m5 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubOrchestrationNeedsCatalogUpdate5D7370DC", }, - "",{"label":"NeedsCatalogUpdateLambda","stat":"Maximum","visible":false,"id":"m6"}],[{"label":"IngestionLambda quota usage %","expression":"m7 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"NeedsCatalogUpdateLambda","stat":"Maximum","visible":false,"id":"m5"}],[{"label":"IngestionLambda quota usage %","expression":"m6 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubIngestion407909CE", }, - "",{"label":"IngestionLambda","stat":"Maximum","visible":false,"id":"m7"}],[{"label":"NpmJsLambda quota usage %","expression":"m8 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"IngestionLambda","stat":"Maximum","visible":false,"id":"m6"}],[{"label":"NpmJsLambda quota usage %","expression":"m7 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubSourcesNpmJs15A77D2D", }, - "",{"label":"NpmJsLambda","stat":"Maximum","visible":false,"id":"m8"}],[{"label":"NpmJs-StageAndNotifyLambda quota usage %","expression":"m9 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"NpmJsLambda","stat":"Maximum","visible":false,"id":"m7"}],[{"label":"NpmJs-StageAndNotifyLambda quota usage %","expression":"m8 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubSourcesNpmJsStageAndNotify591C0CFA", }, - "",{"label":"NpmJs-StageAndNotifyLambda","stat":"Maximum","visible":false,"id":"m9"}]],"annotations":{"horizontal":[{"value":70,"yAxis":"right"}]},"yAxis":{"right":{"label":"Quota Percent","min":0,"max":100}}}},{"type":"metric","width":12,"height":8,"x":0,"y":8,"properties":{"view":"timeSeries","title":"Construct Hub Inventory","region":"", + "",{"label":"NpmJs-StageAndNotifyLambda","stat":"Maximum","visible":false,"id":"m8"}],[{"label":"CanaryResourceLambda quota usage %","expression":"m9 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { - "Ref": "AWS::Region", + "Ref": "ConstructHubInventoryCanary63D899BC", }, - "","metrics":[["ConstructHub/Inventory","PackageCount",{"period":900,"stat":"Maximum"}],["ConstructHub/Inventory","PackageMajorVersionCount",{"period":900,"stat":"Maximum"}]],"yAxis":{"left":{"label":"Package count"}}}},{"type":"custom","width":12,"height":8,"x":0,"y":16,"properties":{"endpoint":"", + "",{"label":"CanaryResourceLambda","stat":"Maximum","visible":false,"id":"m9"}]],"annotations":{"horizontal":[{"value":70,"yAxis":"right"}]},"yAxis":{"right":{"label":"Quota Percent","min":0,"max":100}}}},{"type":"custom","width":12,"height":8,"x":0,"y":8,"properties":{"endpoint":"", { "Fn::GetAtt": [ "SQSDLQStatsWidgetHandlerfc176846044f5e56baf2c71723501885366DDBD5", @@ -9782,7 +9778,7 @@ Request a service quota increase for lambda functions", "QueueName", ], }, - ""}}},"title":"SQS DLQ","updateOn":{"refresh":true,"resize":false,"timeRange":false}}},{"type":"metric","width":12,"height":8,"x":0,"y":24,"properties":{"view":"timeSeries","title":"CloudFront Metrics","region":"", + ""}}},"title":"SQS DLQ","updateOn":{"refresh":true,"resize":false,"timeRange":false}}},{"type":"metric","width":12,"height":8,"x":0,"y":16,"properties":{"view":"timeSeries","title":"CloudFront Metrics","region":"", { "Ref": "AWS::Region", }, @@ -9798,7 +9794,11 @@ Request a service quota increase for lambda functions", { "Ref": "ConstructHubWebAppDistribution1F181DC9", }, - "","Region","Global",{"region":"us-east-1","period":86400,"yAxis":"right"}]],"yAxis":{"left":{"label":"Requests count","min":0},"right":{"label":"Request Percent","min":0,"max":100}}}}]}", + "","Region","Global",{"region":"us-east-1","period":86400,"yAxis":"right"}]],"yAxis":{"left":{"label":"Requests count","min":0},"right":{"label":"Request Percent","min":0,"max":100}}}},{"type":"metric","width":12,"height":8,"x":0,"y":24,"properties":{"view":"timeSeries","title":"Construct Hub Inventory","region":"", + { + "Ref": "AWS::Region", + }, + "","metrics":[["ConstructHub/Inventory","PackageCount",{"period":900,"stat":"Maximum"}],["ConstructHub/Inventory","PackageMajorVersionCount",{"period":900,"stat":"Maximum"}]],"yAxis":{"left":{"label":"Package count"}}}}]}", ], ], }, @@ -24162,35 +24162,31 @@ Request a service quota increase for lambda functions", { "Ref": "ConstructHubFeedBuilderReleaseNotesUpdateFeedBB0BA91D", }, - "",{"label":"updateFeedFunction","stat":"Maximum","visible":false,"id":"m3"}],[{"label":"CanaryResourceLambda quota usage %","expression":"m4 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", - { - "Ref": "ConstructHubInventoryCanary63D899BC", - }, - "",{"label":"CanaryResourceLambda","stat":"Maximum","visible":false,"id":"m4"}],[{"label":"CatalogBuilderLambda quota usage %","expression":"m5 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"updateFeedFunction","stat":"Maximum","visible":false,"id":"m3"}],[{"label":"CatalogBuilderLambda quota usage %","expression":"m4 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubOrchestrationCatalogBuilder7C964951", }, - "",{"label":"CatalogBuilderLambda","stat":"Maximum","visible":false,"id":"m5"}],[{"label":"NeedsCatalogUpdateLambda quota usage %","expression":"m6 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"CatalogBuilderLambda","stat":"Maximum","visible":false,"id":"m4"}],[{"label":"NeedsCatalogUpdateLambda quota usage %","expression":"m5 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubOrchestrationNeedsCatalogUpdate5D7370DC", }, - "",{"label":"NeedsCatalogUpdateLambda","stat":"Maximum","visible":false,"id":"m6"}],[{"label":"IngestionLambda quota usage %","expression":"m7 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"NeedsCatalogUpdateLambda","stat":"Maximum","visible":false,"id":"m5"}],[{"label":"IngestionLambda quota usage %","expression":"m6 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubIngestion407909CE", }, - "",{"label":"IngestionLambda","stat":"Maximum","visible":false,"id":"m7"}],[{"label":"NpmJsLambda quota usage %","expression":"m8 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"IngestionLambda","stat":"Maximum","visible":false,"id":"m6"}],[{"label":"NpmJsLambda quota usage %","expression":"m7 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubSourcesNpmJs15A77D2D", }, - "",{"label":"NpmJsLambda","stat":"Maximum","visible":false,"id":"m8"}],[{"label":"NpmJs-StageAndNotifyLambda quota usage %","expression":"m9 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"NpmJsLambda","stat":"Maximum","visible":false,"id":"m7"}],[{"label":"NpmJs-StageAndNotifyLambda quota usage %","expression":"m8 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubSourcesNpmJsStageAndNotify591C0CFA", }, - "",{"label":"NpmJs-StageAndNotifyLambda","stat":"Maximum","visible":false,"id":"m9"}]],"annotations":{"horizontal":[{"value":70,"yAxis":"right"}]},"yAxis":{"right":{"label":"Quota Percent","min":0,"max":100}}}},{"type":"metric","width":12,"height":8,"x":0,"y":8,"properties":{"view":"timeSeries","title":"Construct Hub Inventory","region":"", + "",{"label":"NpmJs-StageAndNotifyLambda","stat":"Maximum","visible":false,"id":"m8"}],[{"label":"CanaryResourceLambda quota usage %","expression":"m9 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { - "Ref": "AWS::Region", + "Ref": "ConstructHubInventoryCanary63D899BC", }, - "","metrics":[["ConstructHub/Inventory","PackageCount",{"period":900,"stat":"Maximum"}],["ConstructHub/Inventory","PackageMajorVersionCount",{"period":900,"stat":"Maximum"}]],"yAxis":{"left":{"label":"Package count"}}}},{"type":"custom","width":12,"height":8,"x":0,"y":16,"properties":{"endpoint":"", + "",{"label":"CanaryResourceLambda","stat":"Maximum","visible":false,"id":"m9"}]],"annotations":{"horizontal":[{"value":70,"yAxis":"right"}]},"yAxis":{"right":{"label":"Quota Percent","min":0,"max":100}}}},{"type":"custom","width":12,"height":8,"x":0,"y":8,"properties":{"endpoint":"", { "Fn::GetAtt": [ "SQSDLQStatsWidgetHandlerfc176846044f5e56baf2c71723501885366DDBD5", @@ -24246,7 +24242,7 @@ Request a service quota increase for lambda functions", "QueueName", ], }, - ""}}},"title":"SQS DLQ","updateOn":{"refresh":true,"resize":false,"timeRange":false}}},{"type":"metric","width":12,"height":8,"x":0,"y":24,"properties":{"view":"timeSeries","title":"CloudFront Metrics","region":"", + ""}}},"title":"SQS DLQ","updateOn":{"refresh":true,"resize":false,"timeRange":false}}},{"type":"metric","width":12,"height":8,"x":0,"y":16,"properties":{"view":"timeSeries","title":"CloudFront Metrics","region":"", { "Ref": "AWS::Region", }, @@ -24262,7 +24258,11 @@ Request a service quota increase for lambda functions", { "Ref": "ConstructHubWebAppDistribution1F181DC9", }, - "","Region","Global",{"region":"us-east-1","period":86400,"yAxis":"right"}]],"yAxis":{"left":{"label":"Requests count","min":0},"right":{"label":"Request Percent","min":0,"max":100}}}}]}", + "","Region","Global",{"region":"us-east-1","period":86400,"yAxis":"right"}]],"yAxis":{"left":{"label":"Requests count","min":0},"right":{"label":"Request Percent","min":0,"max":100}}}},{"type":"metric","width":12,"height":8,"x":0,"y":24,"properties":{"view":"timeSeries","title":"Construct Hub Inventory","region":"", + { + "Ref": "AWS::Region", + }, + "","metrics":[["ConstructHub/Inventory","PackageCount",{"period":900,"stat":"Maximum"}],["ConstructHub/Inventory","PackageMajorVersionCount",{"period":900,"stat":"Maximum"}]],"yAxis":{"left":{"label":"Package count"}}}}]}", ], ], }, @@ -38190,35 +38190,31 @@ Request a service quota increase for lambda functions", { "Ref": "ConstructHubFeedBuilderReleaseNotesUpdateFeedBB0BA91D", }, - "",{"label":"updateFeedFunction","stat":"Maximum","visible":false,"id":"m3"}],[{"label":"CanaryResourceLambda quota usage %","expression":"m4 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", - { - "Ref": "ConstructHubInventoryCanary63D899BC", - }, - "",{"label":"CanaryResourceLambda","stat":"Maximum","visible":false,"id":"m4"}],[{"label":"CatalogBuilderLambda quota usage %","expression":"m5 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"updateFeedFunction","stat":"Maximum","visible":false,"id":"m3"}],[{"label":"CatalogBuilderLambda quota usage %","expression":"m4 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubOrchestrationCatalogBuilder7C964951", }, - "",{"label":"CatalogBuilderLambda","stat":"Maximum","visible":false,"id":"m5"}],[{"label":"NeedsCatalogUpdateLambda quota usage %","expression":"m6 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"CatalogBuilderLambda","stat":"Maximum","visible":false,"id":"m4"}],[{"label":"NeedsCatalogUpdateLambda quota usage %","expression":"m5 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubOrchestrationNeedsCatalogUpdate5D7370DC", }, - "",{"label":"NeedsCatalogUpdateLambda","stat":"Maximum","visible":false,"id":"m6"}],[{"label":"IngestionLambda quota usage %","expression":"m7 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"NeedsCatalogUpdateLambda","stat":"Maximum","visible":false,"id":"m5"}],[{"label":"IngestionLambda quota usage %","expression":"m6 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubIngestion407909CE", }, - "",{"label":"IngestionLambda","stat":"Maximum","visible":false,"id":"m7"}],[{"label":"NpmJsLambda quota usage %","expression":"m8 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"IngestionLambda","stat":"Maximum","visible":false,"id":"m6"}],[{"label":"NpmJsLambda quota usage %","expression":"m7 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubSourcesNpmJs15A77D2D", }, - "",{"label":"NpmJsLambda","stat":"Maximum","visible":false,"id":"m8"}],[{"label":"NpmJs-StageAndNotifyLambda quota usage %","expression":"m9 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"NpmJsLambda","stat":"Maximum","visible":false,"id":"m7"}],[{"label":"NpmJs-StageAndNotifyLambda quota usage %","expression":"m8 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubSourcesNpmJsStageAndNotify591C0CFA", }, - "",{"label":"NpmJs-StageAndNotifyLambda","stat":"Maximum","visible":false,"id":"m9"}]],"annotations":{"horizontal":[{"value":70,"yAxis":"right"}]},"yAxis":{"right":{"label":"Quota Percent","min":0,"max":100}}}},{"type":"metric","width":12,"height":8,"x":0,"y":8,"properties":{"view":"timeSeries","title":"Construct Hub Inventory","region":"", + "",{"label":"NpmJs-StageAndNotifyLambda","stat":"Maximum","visible":false,"id":"m8"}],[{"label":"CanaryResourceLambda quota usage %","expression":"m9 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { - "Ref": "AWS::Region", + "Ref": "ConstructHubInventoryCanary63D899BC", }, - "","metrics":[["ConstructHub/Inventory","PackageCount",{"period":900,"stat":"Maximum"}],["ConstructHub/Inventory","PackageMajorVersionCount",{"period":900,"stat":"Maximum"}]],"yAxis":{"left":{"label":"Package count"}}}},{"type":"custom","width":12,"height":8,"x":0,"y":16,"properties":{"endpoint":"", + "",{"label":"CanaryResourceLambda","stat":"Maximum","visible":false,"id":"m9"}]],"annotations":{"horizontal":[{"value":70,"yAxis":"right"}]},"yAxis":{"right":{"label":"Quota Percent","min":0,"max":100}}}},{"type":"custom","width":12,"height":8,"x":0,"y":8,"properties":{"endpoint":"", { "Fn::GetAtt": [ "SQSDLQStatsWidgetHandlerfc176846044f5e56baf2c71723501885366DDBD5", @@ -38274,7 +38270,7 @@ Request a service quota increase for lambda functions", "QueueName", ], }, - ""}}},"title":"SQS DLQ","updateOn":{"refresh":true,"resize":false,"timeRange":false}}},{"type":"metric","width":12,"height":8,"x":0,"y":24,"properties":{"view":"timeSeries","title":"CloudFront Metrics","region":"", + ""}}},"title":"SQS DLQ","updateOn":{"refresh":true,"resize":false,"timeRange":false}}},{"type":"metric","width":12,"height":8,"x":0,"y":16,"properties":{"view":"timeSeries","title":"CloudFront Metrics","region":"", { "Ref": "AWS::Region", }, @@ -38290,7 +38286,11 @@ Request a service quota increase for lambda functions", { "Ref": "ConstructHubWebAppDistribution1F181DC9", }, - "","Region","Global",{"region":"us-east-1","period":86400,"yAxis":"right"}]],"yAxis":{"left":{"label":"Requests count","min":0},"right":{"label":"Request Percent","min":0,"max":100}}}}]}", + "","Region","Global",{"region":"us-east-1","period":86400,"yAxis":"right"}]],"yAxis":{"left":{"label":"Requests count","min":0},"right":{"label":"Request Percent","min":0,"max":100}}}},{"type":"metric","width":12,"height":8,"x":0,"y":24,"properties":{"view":"timeSeries","title":"Construct Hub Inventory","region":"", + { + "Ref": "AWS::Region", + }, + "","metrics":[["ConstructHub/Inventory","PackageCount",{"period":900,"stat":"Maximum"}],["ConstructHub/Inventory","PackageMajorVersionCount",{"period":900,"stat":"Maximum"}]],"yAxis":{"left":{"label":"Package count"}}}}]}", ], ], }, @@ -52375,35 +52375,31 @@ Request a service quota increase for lambda functions", { "Ref": "ConstructHubFeedBuilderReleaseNotesUpdateFeedBB0BA91D", }, - "",{"label":"updateFeedFunction","stat":"Maximum","visible":false,"id":"m3"}],[{"label":"CanaryResourceLambda quota usage %","expression":"m4 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", - { - "Ref": "ConstructHubInventoryCanary63D899BC", - }, - "",{"label":"CanaryResourceLambda","stat":"Maximum","visible":false,"id":"m4"}],[{"label":"CatalogBuilderLambda quota usage %","expression":"m5 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"updateFeedFunction","stat":"Maximum","visible":false,"id":"m3"}],[{"label":"CatalogBuilderLambda quota usage %","expression":"m4 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubOrchestrationCatalogBuilder7C964951", }, - "",{"label":"CatalogBuilderLambda","stat":"Maximum","visible":false,"id":"m5"}],[{"label":"NeedsCatalogUpdateLambda quota usage %","expression":"m6 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"CatalogBuilderLambda","stat":"Maximum","visible":false,"id":"m4"}],[{"label":"NeedsCatalogUpdateLambda quota usage %","expression":"m5 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubOrchestrationNeedsCatalogUpdate5D7370DC", }, - "",{"label":"NeedsCatalogUpdateLambda","stat":"Maximum","visible":false,"id":"m6"}],[{"label":"IngestionLambda quota usage %","expression":"m7 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"NeedsCatalogUpdateLambda","stat":"Maximum","visible":false,"id":"m5"}],[{"label":"IngestionLambda quota usage %","expression":"m6 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubIngestion407909CE", }, - "",{"label":"IngestionLambda","stat":"Maximum","visible":false,"id":"m7"}],[{"label":"NpmJsLambda quota usage %","expression":"m8 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"IngestionLambda","stat":"Maximum","visible":false,"id":"m6"}],[{"label":"NpmJsLambda quota usage %","expression":"m7 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubSourcesNpmJs15A77D2D", }, - "",{"label":"NpmJsLambda","stat":"Maximum","visible":false,"id":"m8"}],[{"label":"NpmJs-StageAndNotifyLambda quota usage %","expression":"m9 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"NpmJsLambda","stat":"Maximum","visible":false,"id":"m7"}],[{"label":"NpmJs-StageAndNotifyLambda quota usage %","expression":"m8 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubSourcesNpmJsStageAndNotify591C0CFA", }, - "",{"label":"NpmJs-StageAndNotifyLambda","stat":"Maximum","visible":false,"id":"m9"}]],"annotations":{"horizontal":[{"value":70,"yAxis":"right"}]},"yAxis":{"right":{"label":"Quota Percent","min":0,"max":100}}}},{"type":"metric","width":12,"height":8,"x":0,"y":8,"properties":{"view":"timeSeries","title":"Construct Hub Inventory","region":"", + "",{"label":"NpmJs-StageAndNotifyLambda","stat":"Maximum","visible":false,"id":"m8"}],[{"label":"CanaryResourceLambda quota usage %","expression":"m9 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { - "Ref": "AWS::Region", + "Ref": "ConstructHubInventoryCanary63D899BC", }, - "","metrics":[["ConstructHub/Inventory","PackageCount",{"period":900,"stat":"Maximum"}],["ConstructHub/Inventory","PackageMajorVersionCount",{"period":900,"stat":"Maximum"}]],"yAxis":{"left":{"label":"Package count"}}}},{"type":"custom","width":12,"height":8,"x":0,"y":16,"properties":{"endpoint":"", + "",{"label":"CanaryResourceLambda","stat":"Maximum","visible":false,"id":"m9"}]],"annotations":{"horizontal":[{"value":70,"yAxis":"right"}]},"yAxis":{"right":{"label":"Quota Percent","min":0,"max":100}}}},{"type":"custom","width":12,"height":8,"x":0,"y":8,"properties":{"endpoint":"", { "Fn::GetAtt": [ "SQSDLQStatsWidgetHandlerfc176846044f5e56baf2c71723501885366DDBD5", @@ -52459,7 +52455,7 @@ Request a service quota increase for lambda functions", "QueueName", ], }, - ""}}},"title":"SQS DLQ","updateOn":{"refresh":true,"resize":false,"timeRange":false}}},{"type":"metric","width":12,"height":8,"x":0,"y":24,"properties":{"view":"timeSeries","title":"CloudFront Metrics","region":"", + ""}}},"title":"SQS DLQ","updateOn":{"refresh":true,"resize":false,"timeRange":false}}},{"type":"metric","width":12,"height":8,"x":0,"y":16,"properties":{"view":"timeSeries","title":"CloudFront Metrics","region":"", { "Ref": "AWS::Region", }, @@ -52475,7 +52471,11 @@ Request a service quota increase for lambda functions", { "Ref": "ConstructHubWebAppDistribution1F181DC9", }, - "","Region","Global",{"region":"us-east-1","period":86400,"yAxis":"right"}]],"yAxis":{"left":{"label":"Requests count","min":0},"right":{"label":"Request Percent","min":0,"max":100}}}}]}", + "","Region","Global",{"region":"us-east-1","period":86400,"yAxis":"right"}]],"yAxis":{"left":{"label":"Requests count","min":0},"right":{"label":"Request Percent","min":0,"max":100}}}},{"type":"metric","width":12,"height":8,"x":0,"y":24,"properties":{"view":"timeSeries","title":"Construct Hub Inventory","region":"", + { + "Ref": "AWS::Region", + }, + "","metrics":[["ConstructHub/Inventory","PackageCount",{"period":900,"stat":"Maximum"}],["ConstructHub/Inventory","PackageMajorVersionCount",{"period":900,"stat":"Maximum"}]],"yAxis":{"left":{"label":"Package count"}}}}]}", ], ], }, @@ -66479,35 +66479,31 @@ Request a service quota increase for lambda functions", { "Ref": "ConstructHubFeedBuilderReleaseNotesUpdateFeedBB0BA91D", }, - "",{"label":"updateFeedFunction","stat":"Maximum","visible":false,"id":"m3"}],[{"label":"CanaryResourceLambda quota usage %","expression":"m4 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", - { - "Ref": "ConstructHubInventoryCanary63D899BC", - }, - "",{"label":"CanaryResourceLambda","stat":"Maximum","visible":false,"id":"m4"}],[{"label":"CatalogBuilderLambda quota usage %","expression":"m5 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"updateFeedFunction","stat":"Maximum","visible":false,"id":"m3"}],[{"label":"CatalogBuilderLambda quota usage %","expression":"m4 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubOrchestrationCatalogBuilder7C964951", }, - "",{"label":"CatalogBuilderLambda","stat":"Maximum","visible":false,"id":"m5"}],[{"label":"NeedsCatalogUpdateLambda quota usage %","expression":"m6 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"CatalogBuilderLambda","stat":"Maximum","visible":false,"id":"m4"}],[{"label":"NeedsCatalogUpdateLambda quota usage %","expression":"m5 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubOrchestrationNeedsCatalogUpdate5D7370DC", }, - "",{"label":"NeedsCatalogUpdateLambda","stat":"Maximum","visible":false,"id":"m6"}],[{"label":"IngestionLambda quota usage %","expression":"m7 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"NeedsCatalogUpdateLambda","stat":"Maximum","visible":false,"id":"m5"}],[{"label":"IngestionLambda quota usage %","expression":"m6 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubIngestion407909CE", }, - "",{"label":"IngestionLambda","stat":"Maximum","visible":false,"id":"m7"}],[{"label":"NpmJsLambda quota usage %","expression":"m8 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"IngestionLambda","stat":"Maximum","visible":false,"id":"m6"}],[{"label":"NpmJsLambda quota usage %","expression":"m7 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubSourcesNpmJs15A77D2D", }, - "",{"label":"NpmJsLambda","stat":"Maximum","visible":false,"id":"m8"}],[{"label":"NpmJs-StageAndNotifyLambda quota usage %","expression":"m9 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"NpmJsLambda","stat":"Maximum","visible":false,"id":"m7"}],[{"label":"NpmJs-StageAndNotifyLambda quota usage %","expression":"m8 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubSourcesNpmJsStageAndNotify591C0CFA", }, - "",{"label":"NpmJs-StageAndNotifyLambda","stat":"Maximum","visible":false,"id":"m9"}]],"annotations":{"horizontal":[{"value":70,"yAxis":"right"}]},"yAxis":{"right":{"label":"Quota Percent","min":0,"max":100}}}},{"type":"metric","width":12,"height":8,"x":0,"y":8,"properties":{"view":"timeSeries","title":"Construct Hub Inventory","region":"", + "",{"label":"NpmJs-StageAndNotifyLambda","stat":"Maximum","visible":false,"id":"m8"}],[{"label":"CanaryResourceLambda quota usage %","expression":"m9 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { - "Ref": "AWS::Region", + "Ref": "ConstructHubInventoryCanary63D899BC", }, - "","metrics":[["ConstructHub/Inventory","PackageCount",{"period":900,"stat":"Maximum"}],["ConstructHub/Inventory","PackageMajorVersionCount",{"period":900,"stat":"Maximum"}]],"yAxis":{"left":{"label":"Package count"}}}},{"type":"custom","width":12,"height":8,"x":0,"y":16,"properties":{"endpoint":"", + "",{"label":"CanaryResourceLambda","stat":"Maximum","visible":false,"id":"m9"}]],"annotations":{"horizontal":[{"value":70,"yAxis":"right"}]},"yAxis":{"right":{"label":"Quota Percent","min":0,"max":100}}}},{"type":"custom","width":12,"height":8,"x":0,"y":8,"properties":{"endpoint":"", { "Fn::GetAtt": [ "SQSDLQStatsWidgetHandlerfc176846044f5e56baf2c71723501885366DDBD5", @@ -66563,7 +66559,7 @@ Request a service quota increase for lambda functions", "QueueName", ], }, - ""}}},"title":"SQS DLQ","updateOn":{"refresh":true,"resize":false,"timeRange":false}}},{"type":"metric","width":12,"height":8,"x":0,"y":24,"properties":{"view":"timeSeries","title":"CloudFront Metrics","region":"", + ""}}},"title":"SQS DLQ","updateOn":{"refresh":true,"resize":false,"timeRange":false}}},{"type":"metric","width":12,"height":8,"x":0,"y":16,"properties":{"view":"timeSeries","title":"CloudFront Metrics","region":"", { "Ref": "AWS::Region", }, @@ -66579,7 +66575,11 @@ Request a service quota increase for lambda functions", { "Ref": "ConstructHubWebAppDistribution1F181DC9", }, - "","Region","Global",{"region":"us-east-1","period":86400,"yAxis":"right"}]],"yAxis":{"left":{"label":"Requests count","min":0},"right":{"label":"Request Percent","min":0,"max":100}}}}]}", + "","Region","Global",{"region":"us-east-1","period":86400,"yAxis":"right"}]],"yAxis":{"left":{"label":"Requests count","min":0},"right":{"label":"Request Percent","min":0,"max":100}}}},{"type":"metric","width":12,"height":8,"x":0,"y":24,"properties":{"view":"timeSeries","title":"Construct Hub Inventory","region":"", + { + "Ref": "AWS::Region", + }, + "","metrics":[["ConstructHub/Inventory","PackageCount",{"period":900,"stat":"Maximum"}],["ConstructHub/Inventory","PackageMajorVersionCount",{"period":900,"stat":"Maximum"}]],"yAxis":{"left":{"label":"Package count"}}}}]}", ], ], }, diff --git a/src/__tests__/devapp/__snapshots__/snapshot.test.ts.snap b/src/__tests__/devapp/__snapshots__/snapshot.test.ts.snap index 09cad5955..0b6ec12e8 100644 --- a/src/__tests__/devapp/__snapshots__/snapshot.test.ts.snap +++ b/src/__tests__/devapp/__snapshots__/snapshot.test.ts.snap @@ -10020,43 +10020,39 @@ Request a service quota increase for lambda functions", { "Ref": "ConstructHubFeedBuilderReleaseNotesUpdateFeedBB0BA91D", }, - "",{"label":"updateFeedFunction","stat":"Maximum","visible":false,"id":"m3"}],[{"label":"CanaryResourceLambda quota usage %","expression":"m4 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", - { - "Ref": "ConstructHubInventoryCanary63D899BC", - }, - "",{"label":"CanaryResourceLambda","stat":"Maximum","visible":false,"id":"m4"}],[{"label":"CatalogBuilderLambda quota usage %","expression":"m5 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"updateFeedFunction","stat":"Maximum","visible":false,"id":"m3"}],[{"label":"CatalogBuilderLambda quota usage %","expression":"m4 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubOrchestrationCatalogBuilder7C964951", }, - "",{"label":"CatalogBuilderLambda","stat":"Maximum","visible":false,"id":"m5"}],[{"label":"NeedsCatalogUpdateLambda quota usage %","expression":"m6 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"CatalogBuilderLambda","stat":"Maximum","visible":false,"id":"m4"}],[{"label":"NeedsCatalogUpdateLambda quota usage %","expression":"m5 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubOrchestrationNeedsCatalogUpdate5D7370DC", }, - "",{"label":"NeedsCatalogUpdateLambda","stat":"Maximum","visible":false,"id":"m6"}],[{"label":"releaseNotesTrigger quota usage %","expression":"m7 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"NeedsCatalogUpdateLambda","stat":"Maximum","visible":false,"id":"m5"}],[{"label":"releaseNotesTrigger quota usage %","expression":"m6 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubReleaseNotesReleaseNotesTriggerDD939C4F", }, - "",{"label":"releaseNotesTrigger","stat":"Maximum","visible":false,"id":"m7"}],[{"label":"releaseNoteGenerateForPackage quota usage %","expression":"m8 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"releaseNotesTrigger","stat":"Maximum","visible":false,"id":"m6"}],[{"label":"releaseNoteGenerateForPackage quota usage %","expression":"m7 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubReleaseNotesGithubChangelogFetcher1616748C", }, - "",{"label":"releaseNoteGenerateForPackage","stat":"Maximum","visible":false,"id":"m8"}],[{"label":"IngestionLambda quota usage %","expression":"m9 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"releaseNoteGenerateForPackage","stat":"Maximum","visible":false,"id":"m7"}],[{"label":"IngestionLambda quota usage %","expression":"m8 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubIngestion407909CE", }, - "",{"label":"IngestionLambda","stat":"Maximum","visible":false,"id":"m9"}],[{"label":"NpmJsLambda quota usage %","expression":"m10 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"IngestionLambda","stat":"Maximum","visible":false,"id":"m8"}],[{"label":"NpmJsLambda quota usage %","expression":"m9 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubSourcesNpmJs15A77D2D", }, - "",{"label":"NpmJsLambda","stat":"Maximum","visible":false,"id":"m10"}],[{"label":"NpmJs-StageAndNotifyLambda quota usage %","expression":"m11 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", + "",{"label":"NpmJsLambda","stat":"Maximum","visible":false,"id":"m9"}],[{"label":"NpmJs-StageAndNotifyLambda quota usage %","expression":"m10 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { "Ref": "ConstructHubSourcesNpmJsStageAndNotify591C0CFA", }, - "",{"label":"NpmJs-StageAndNotifyLambda","stat":"Maximum","visible":false,"id":"m11"}]],"annotations":{"horizontal":[{"value":70,"yAxis":"right"}]},"yAxis":{"right":{"label":"Quota Percent","min":0,"max":100}}}},{"type":"metric","width":12,"height":8,"x":0,"y":8,"properties":{"view":"timeSeries","title":"Construct Hub Inventory","region":"", + "",{"label":"NpmJs-StageAndNotifyLambda","stat":"Maximum","visible":false,"id":"m10"}],[{"label":"CanaryResourceLambda quota usage %","expression":"m11 / mLambdaQuota * 100","yAxis":"right"}],["AWS/Lambda","Invocations","FunctionName","", { - "Ref": "AWS::Region", + "Ref": "ConstructHubInventoryCanary63D899BC", }, - "","metrics":[["ConstructHub/Inventory","PackageCount",{"period":900,"stat":"Maximum"}],["ConstructHub/Inventory","PackageMajorVersionCount",{"period":900,"stat":"Maximum"}]],"yAxis":{"left":{"label":"Package count"}}}},{"type":"custom","width":12,"height":8,"x":0,"y":16,"properties":{"endpoint":"", + "",{"label":"CanaryResourceLambda","stat":"Maximum","visible":false,"id":"m11"}]],"annotations":{"horizontal":[{"value":70,"yAxis":"right"}]},"yAxis":{"right":{"label":"Quota Percent","min":0,"max":100}}}},{"type":"custom","width":12,"height":8,"x":0,"y":8,"properties":{"endpoint":"", { "Fn::GetAtt": [ "SQSDLQStatsWidgetHandlerfc176846044f5e56baf2c71723501885366DDBD5", @@ -10126,7 +10122,7 @@ Request a service quota increase for lambda functions", "QueueName", ], }, - ""}}},"title":"SQS DLQ","updateOn":{"refresh":true,"resize":false,"timeRange":false}}},{"type":"metric","width":12,"height":8,"x":0,"y":24,"properties":{"view":"timeSeries","title":"CloudFront Metrics","region":"", + ""}}},"title":"SQS DLQ","updateOn":{"refresh":true,"resize":false,"timeRange":false}}},{"type":"metric","width":12,"height":8,"x":0,"y":16,"properties":{"view":"timeSeries","title":"CloudFront Metrics","region":"", { "Ref": "AWS::Region", }, @@ -10142,7 +10138,11 @@ Request a service quota increase for lambda functions", { "Ref": "ConstructHubWebAppDistribution1F181DC9", }, - "","Region","Global",{"region":"us-east-1","period":86400,"yAxis":"right"}]],"yAxis":{"left":{"label":"Requests count","min":0},"right":{"label":"Request Percent","min":0,"max":100}}}}]}", + "","Region","Global",{"region":"us-east-1","period":86400,"yAxis":"right"}]],"yAxis":{"left":{"label":"Requests count","min":0},"right":{"label":"Request Percent","min":0,"max":100}}}},{"type":"metric","width":12,"height":8,"x":0,"y":24,"properties":{"view":"timeSeries","title":"Construct Hub Inventory","region":"", + { + "Ref": "AWS::Region", + }, + "","metrics":[["ConstructHub/Inventory","PackageCount",{"period":900,"stat":"Maximum"}],["ConstructHub/Inventory","PackageMajorVersionCount",{"period":900,"stat":"Maximum"}]],"yAxis":{"left":{"label":"Package count"}}}}]}", ], ], },