diff --git a/.gitattributes b/.gitattributes index f921559cf..ba417bf5f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -55,6 +55,7 @@ /src/package-sources/codeartifact/code-artifact-forwarder.ts linguist-generated /src/package-sources/npmjs/canary/npmjs-package-canary.ts linguist-generated /src/package-sources/npmjs/npm-js-follower.ts linguist-generated +/src/package-sources/npmjs/re-stage-package-version.ts linguist-generated /src/package-sources/npmjs/stage-and-notify.ts linguist-generated /src/spdx-license.ts linguist-generated /tsconfig.dev.json linguist-generated diff --git a/.gitignore b/.gitignore index 2e2cfbe1e..cb09cd0ea 100644 --- a/.gitignore +++ b/.gitignore @@ -68,6 +68,7 @@ lib/__tests__/devapp/cdk.out .env !/lib/__tests__/devapp/cdk.json !/src/package-sources/npmjs/stage-and-notify.ts +!/src/package-sources/npmjs/re-stage-package-version.ts !/src/package-sources/npmjs/npm-js-follower.ts !/src/package-sources/npmjs/canary/npmjs-package-canary.ts !/src/package-sources/codeartifact/code-artifact-forwarder.ts diff --git a/.prettierignore b/.prettierignore index 678a3ae0d..406aa050a 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,5 +1,6 @@ # ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". src/package-sources/npmjs/stage-and-notify.ts +src/package-sources/npmjs/re-stage-package-version.ts src/package-sources/npmjs/npm-js-follower.ts src/package-sources/npmjs/canary/npmjs-package-canary.ts src/package-sources/codeartifact/code-artifact-forwarder.ts diff --git a/.projen/deps.json b/.projen/deps.json index 1e0350834..2986ef95e 100644 --- a/.projen/deps.json +++ b/.projen/deps.json @@ -85,7 +85,7 @@ }, { "name": "@types/node", - "version": "^16", + "version": "^18", "type": "build" }, { diff --git a/.projen/files.json b/.projen/files.json index c3152308a..2fa477e8b 100644 --- a/.projen/files.json +++ b/.projen/files.json @@ -49,6 +49,7 @@ "src/package-sources/codeartifact/code-artifact-forwarder.ts", "src/package-sources/npmjs/canary/npmjs-package-canary.ts", "src/package-sources/npmjs/npm-js-follower.ts", + "src/package-sources/npmjs/re-stage-package-version.ts", "src/package-sources/npmjs/stage-and-notify.ts", "src/spdx-license.ts", "tsconfig.dev.json" diff --git a/.projen/tasks.json b/.projen/tasks.json index 0651cdd98..c36d49f53 100644 --- a/.projen/tasks.json +++ b/.projen/tasks.json @@ -50,6 +50,9 @@ { "spawn": "bundle:stage-and-notify" }, + { + "spawn": "bundle:re-stage-package-version" + }, { "spawn": "bundle:npm-js-follower" }, @@ -324,7 +327,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/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.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=\"node14\" --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.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=\"node14\" --platform=\"node\" --outbase=\"src\" --outdir=\"lib\" --entry-names=\"[dir]/[name].bundle/index\" --external:aws-sdk --sourcemap --watch --tsconfig=tsconfig.dev.json" } ] }, @@ -508,6 +511,24 @@ } ] }, + "bundle:re-stage-package-version": { + "name": "bundle:re-stage-package-version", + "description": "Create an AWS Lambda bundle from src/package-sources/npmjs/re-stage-package-version.lambda.ts", + "steps": [ + { + "exec": "esbuild --bundle src/package-sources/npmjs/re-stage-package-version.lambda.ts --target=\"node18\" --platform=\"node\" --outfile=\"lib/package-sources/npmjs/re-stage-package-version.lambda.bundle/index.js\" --external:aws-sdk --sourcemap --tsconfig=tsconfig.dev.json" + } + ] + }, + "bundle:re-stage-package-version:watch": { + "name": "bundle:re-stage-package-version:watch", + "description": "Continuously update an AWS Lambda bundle from src/package-sources/npmjs/re-stage-package-version.lambda.ts", + "steps": [ + { + "exec": "esbuild --bundle src/package-sources/npmjs/re-stage-package-version.lambda.ts --target=\"node18\" --platform=\"node\" --outfile=\"lib/package-sources/npmjs/re-stage-package-version.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", @@ -703,6 +724,9 @@ { "spawn": "bundle:stage-and-notify" }, + { + "spawn": "bundle:re-stage-package-version" + }, { "spawn": "bundle:npm-js-follower" }, diff --git a/.projenrc.ts b/.projenrc.ts index eac51f114..2d56c17ca 100644 --- a/.projenrc.ts +++ b/.projenrc.ts @@ -239,6 +239,7 @@ addVpcAllowListManagement(project); addDevApp(project); project.addDevDeps('glob'); +project.addDevDeps('@types/node@^18'); discoverLambdas(project); discoverEcsTasks(project); diff --git a/docs/operator-runbook.md b/docs/operator-runbook.md index 89406fe5f..b42c2fde2 100644 --- a/docs/operator-runbook.md +++ b/docs/operator-runbook.md @@ -241,11 +241,11 @@ The dead-letter queue can be accessed by clicking the *DLQ* button under the information about the failure that caused the message to be placed here. They include the following elements: -Key | Description ------------------------------|-------------------------------------------------- -`$TaskExecution` | References to the StateMachine execution -`DocGen[].error` | Error message returned by a DocGen task -`catalogBuilderOutput.error` | Error message returned by the catalog builder +| Key | Description | +| ---------------------------- | --------------------------------------------- | +| `$TaskExecution` | References to the StateMachine execution | +| `DocGen[].error` | Error message returned by a DocGen task | +| `catalogBuilderOutput.error` | Error message returned by the catalog builder | For each language supported by the Construct Hub, there should be an entry under the `DocGen` array. If the `error` field has a value or an empty object (`{}`) it @@ -629,6 +629,31 @@ effects of executing these workflows. -------------------------------------------------------------------------------- +## :repeat_one: Re-processing individual items + +Two workflows are available for reprocessing of individual items: + +1. The "re-stage package version" lambda can be used to re stage a package version + that was not ingested by the NpmJs follower. This will trigger the usual staging + and processing flow. If the package version is deny-listed, this will NOT circumvent + the block. Invoke the lambda function with the following payload: + ```json + { + "name": "", + "version": "" + } + ``` +2. The "ReprocessDocumentationPerPackage" State machine re-runs an already indexed package + through the documentation-generation process. This is useful when a new + language is added to ConstructHub, or the documentation generator has changed. + ```json + { + "Prefix": "data//v" + } + ``` + +-------------------------------------------------------------------------------- + ### `ConstructHub/Sources/NpmJs/Canary/SLA-Breached` #### Description @@ -655,7 +680,8 @@ account ran out of Lambda concurrent executions for a while. The Lambda function can be found in the Lambda console: its description contains `Sources/NpmJs/PackageCanary`. If the function runs as intended, [dive into the Lambda logs][#lambda-log-dive] to understand why it might be -unable to evaluate the metric. +unable to evaluate the metric. It should clearly output which versions of the +tracked package are expected, but missing. Otherwise, look for traces of the package version in the logs of each step in the pipeline: @@ -671,6 +697,9 @@ For additional recommendations for diving into CloudWatch Logs, refer to the #### Resolution +If a tracked package version was not ingested or processed, try to re-stag or re-process +the specific version. + The alarm will automatically go back to green once all outstanding versions of the configured canary package are available in the ConstructHub instance, and the latest revision thereof is within SLA. diff --git a/package.json b/package.json index 25eb10443..623bfd644 100644 --- a/package.json +++ b/package.json @@ -51,6 +51,8 @@ "bundle:prune-test:watch": "npx projen bundle:prune-test:watch", "bundle:re-ingest": "npx projen bundle:re-ingest", "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: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", @@ -124,7 +126,7 @@ "@types/jest": "^29", "@types/markdown-it": "^12.2.3", "@types/markdown-it-emoji": "^2.0.5", - "@types/node": "^16", + "@types/node": "^18", "@types/semver": "^7.5.8", "@types/streamx": "^2.9.5", "@types/tar-stream": "^2.2.3", diff --git a/src/__tests__/__snapshots__/construct-hub.test.ts.snap b/src/__tests__/__snapshots__/construct-hub.test.ts.snap index 40539c004..279353fd1 100644 --- a/src/__tests__/__snapshots__/construct-hub.test.ts.snap +++ b/src/__tests__/__snapshots__/construct-hub.test.ts.snap @@ -1505,7 +1505,7 @@ def submit_response(event: dict, context, response_status: str, error_message: s "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "5412352af75bacfd1a6df952bf6052961b164815fed4c309e0401b7025822230.zip", + "S3Key": "ba5982f9bbe5d5375bc05d10155db28ddbd9c80999d6dfa9f70cd580f53b5ffd.zip", }, "Description": "backend/deny-list/prune-handler.lambda.ts", "Environment": { @@ -1701,7 +1701,7 @@ def submit_response(event: dict, context, response_status: str, error_message: s "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "70e01437a075290d2c7db928a3e445722e272f63f4df883343e0daab5de4c17d.zip", + "S3Key": "341871b363349ed63982b3848282cf19140c73241dc2a94a7ff36ad7036b087e.zip", }, "Description": "backend/deny-list/prune-queue-handler.lambda.ts", "Environment": { @@ -1982,7 +1982,7 @@ Direct link to the function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "f1078b6204d9952f3aedcbd86444ec56f43a07cd80ac963b11034cd96ee81fa6.zip", + "S3Key": "74e8e3fb7bde4636be0aa3cd7bc27f6ad2ddb07470a70b0c7ea9d08b186e570d.zip", }, "Description": "Release note RSS feed updater", "Environment": { @@ -2210,7 +2210,7 @@ Direct link to the function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "0e65a7adc90d545702a1854bbf0ca2f6d9b8581509873429d6452b9d6114c882.zip", + "S3Key": "585a97f83349a78b685159ae808f3d5e404f26701f37b6cafab6b9bd2a54240a.zip", }, "Description": "[ConstructHub/Ingestion] Ingests new package versions into the Construct Hub", "Environment": { @@ -2636,7 +2636,7 @@ Direct link to the function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "a71d2ac6720ed79437a4f7d19e076755b904f7140c3824b3d5863046dd0b6106.zip", + "S3Key": "44d43a2a54d0b29fca264d1b979c3f29e1b2ad99a7dbed07dc40c653723fa96e.zip", }, "Description": "[ConstructHub/Ingestion/ReIngest] The function used to reprocess packages through ingestion", "Environment": { @@ -3302,7 +3302,7 @@ Direct link to the function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "6549e849894f519dd39c81c17a9217205a6b41d8608372746bbcb99d8b5df2c8.zip", + "S3Key": "c6e6167072b6b07955c8c85e2dd6f10dfb99ff0a4202cc508bb43bbf89f7a166.zip", }, "Description": "[ConstructHub/Inventory] A canary that periodically inspects the list of indexed packages", "Environment": { @@ -4799,7 +4799,7 @@ Direct link to function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "7f8efaf5de06bb86e9d2b289cc9719b3ccf06d54fb7c0fea67cf1335fa9b68c8.zip", + "S3Key": "cef891327a29ea5f4bb46bf91875d669d96e0d59b01100dab609eca02e98570e.zip", }, "Description": { "Fn::Join": [ @@ -5113,7 +5113,7 @@ RUNBOOK: https://github.com/cdklabs/construct-hub/blob/main/docs/operator-runboo "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "d75b353bced76b7d0a7ed6728f558a59d9f80bfc6265321f0ad260bf7c216e35.zip", + "S3Key": "33029ab18c52cb68e835ba4984322b51c8c57d41eb3c50c17b7c47fe657249ff.zip", }, "Description": { "Fn::Join": [ @@ -5867,7 +5867,7 @@ Warning: State Machines executions that sent messages to the DLQ will not show a "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "2dd85cd418081d0c50d9926ed1857d6a54f9aedae892165ab4e73d0cea4f60a5.zip", + "S3Key": "7623529867c8640d5112afbb20597aaa05447eb9ae0f10dc134683779942fe77.zip", }, "Description": "[ConstructHub/Orchestration/NeedsCatalogUpdate] Determines whether a package version requires a catalog update", "Environment": { @@ -6022,7 +6022,7 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "0a16de8eba6db13a0b20eaec5bda0dd41ab4c73711d362527232640585ee1b82.zip", + "S3Key": "8877b25a772c66ea32e31e969dce6c213d7ce3f137f8ed860424fc7c3eed7f21.zip", }, "Description": "[ConstructHub/Redrive] Manually redrives all messages from the backend dead letter queue", "Environment": { @@ -6814,7 +6814,7 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", ], "Essential": true, "Image": { - "Fn::Sub": "\${AWS::AccountId}.dkr.ecr.\${AWS::Region}.\${AWS::URLSuffix}/cdk-hnb659fds-container-assets-\${AWS::AccountId}-\${AWS::Region}:5da88de2c99118ec3d58c0ff4df81c7c2e2ac672238eaa6a76470cbecffa30de", + "Fn::Sub": "\${AWS::AccountId}.dkr.ecr.\${AWS::Region}.\${AWS::URLSuffix}/cdk-hnb659fds-container-assets-\${AWS::AccountId}-\${AWS::Region}:be705d3496c7752ab9b10db6ad0bb8861fe3f7d4acfdf4033b0b6696469168f4", }, "LogConfiguration": { "LogDriver": "awslogs", @@ -9406,7 +9406,7 @@ Direct link to Lambda function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "e6bc1cd5142537c9cb233a60ef4c0ac3e21c4f65f8f45f5a055e6b9b29b714d1.zip", + "S3Key": "9e1c8a89a78db19243fdfc9b3c530652c4ef111de42d404cc0cd72cbb9ce8ca9.zip", }, "Description": "[Test/ConstructHub/Sources/NpmJs] Periodically query npmjs.com index for new packages", "Environment": { @@ -9460,7 +9460,7 @@ Direct link to Lambda function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "ae1929615586549c280444e33e62ed40ad5da048806baf96fe43e65192a4ccb9.zip", + "S3Key": "020d678b9118cf26b53d5aae4678948bf7024a3280f1f53d42c5a273b91b74be.zip", }, "Description": "[Test/ConstructHub/Sources/NpmJs/PackageCanary] Monitors construct-hub-probe versions availability", "Environment": { @@ -10165,7 +10165,7 @@ Direct link to Lambda function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "704ddeb0c4c66eb9fd1c1899f4f55a36ca9930c65c05d77f2bbd8e5ed30c3252.zip", + "S3Key": "9aa5fae5f04efae906d8429036c63d65d1d143718e68e24325e87a4e54a45b2f.zip", }, "DeadLetterConfig": { "TargetArn": { @@ -10464,6 +10464,116 @@ Direct link to Lambda function: /lambda/home#/functions/", }, "Type": "AWS::S3::BucketPolicy", }, + "ConstructHubSourcesReStagePackageVersion5E1211D1": { + "DependsOn": [ + "ConstructHubSourcesReStagePackageVersionServiceRoleDefaultPolicyB4F9CE40", + "ConstructHubSourcesReStagePackageVersionServiceRoleCDF009BA", + ], + "Properties": { + "Architectures": [ + "arm64", + ], + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", + }, + "S3Key": "b6d749bd27b34f4b6dd422229950dc4faa9a68fc0fa661a5f51caa13719980d1.zip", + }, + "Description": "Manually re-stage a package version", + "Environment": { + "Variables": { + "FUNCTION_NAME": { + "Ref": "ConstructHubSourcesNpmJsStageAndNotify591C0CFA", + }, + "REGISTRY_URL": "https://registry.npmjs.org", + }, + }, + "Handler": "index.handler", + "MemorySize": 1024, + "Role": { + "Fn::GetAtt": [ + "ConstructHubSourcesReStagePackageVersionServiceRoleCDF009BA", + "Arn", + ], + }, + "Runtime": "nodejs16.x", + "Timeout": 10, + }, + "Type": "AWS::Lambda::Function", + }, + "ConstructHubSourcesReStagePackageVersionServiceRoleCDF009BA": { + "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", + }, + "ConstructHubSourcesReStagePackageVersionServiceRoleDefaultPolicyB4F9CE40": { + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "ConstructHubSourcesNpmJsStageAndNotify591C0CFA", + "Arn", + ], + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "ConstructHubSourcesNpmJsStageAndNotify591C0CFA", + "Arn", + ], + }, + ":*", + ], + ], + }, + ], + }, + ], + "Version": "2012-10-17", + }, + "PolicyName": "ConstructHubSourcesReStagePackageVersionServiceRoleDefaultPolicyB4F9CE40", + "Roles": [ + { + "Ref": "ConstructHubSourcesReStagePackageVersionServiceRoleCDF009BA", + }, + ], + }, + "Type": "AWS::IAM::Policy", + }, "ConstructHubSourcesStagerDLQ80BD2600": { "DeletionPolicy": "Delete", "Properties": { @@ -10576,7 +10686,7 @@ Direct link to Lambda function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "12fe4ed23cf4578a6124606619732fdb95c057f6534914d6b5e5acd5d8f5746c.zip", + "S3Key": "17db8db1b6f0439725b30ff350a32982333308633df6021e5a61c3a1e9d05a94.zip", }, "Description": { "Fn::Join": [ @@ -10783,7 +10893,7 @@ Direct link to Lambda function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "ca6dec3b11e40d596e94afc489bca73434ca292e9f46fe7222856e9fd1efce12.zip", + "S3Key": "3622539c21b9c1547c6c5e7391cb255265975850839e5b95919ad0a34491f650.zip", }, "Description": { "Fn::Join": [ @@ -12044,7 +12154,7 @@ function handler(event) { "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "fcb8a24440ef11d8871140ba517fb07b8754c310e6718286bcd95b42f1b23cc7.zip", + "S3Key": "83a6153078d48ae6022f6f083692f3b9227a563ab7bfb40baf9f01c3c49d512b.zip", }, "Description": "[ConstructHub/MissingDocumentationWidget] Is a custom CloudWatch widget handler", "Environment": { @@ -14341,7 +14451,7 @@ def submit_response(event: dict, context, response_status: str, error_message: s "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "5412352af75bacfd1a6df952bf6052961b164815fed4c309e0401b7025822230.zip", + "S3Key": "ba5982f9bbe5d5375bc05d10155db28ddbd9c80999d6dfa9f70cd580f53b5ffd.zip", }, "Description": "backend/deny-list/prune-handler.lambda.ts", "Environment": { @@ -14537,7 +14647,7 @@ def submit_response(event: dict, context, response_status: str, error_message: s "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "70e01437a075290d2c7db928a3e445722e272f63f4df883343e0daab5de4c17d.zip", + "S3Key": "341871b363349ed63982b3848282cf19140c73241dc2a94a7ff36ad7036b087e.zip", }, "Description": "backend/deny-list/prune-queue-handler.lambda.ts", "Environment": { @@ -14818,7 +14928,7 @@ Direct link to the function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "f1078b6204d9952f3aedcbd86444ec56f43a07cd80ac963b11034cd96ee81fa6.zip", + "S3Key": "74e8e3fb7bde4636be0aa3cd7bc27f6ad2ddb07470a70b0c7ea9d08b186e570d.zip", }, "Description": "Release note RSS feed updater", "Environment": { @@ -15046,7 +15156,7 @@ Direct link to the function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "0e65a7adc90d545702a1854bbf0ca2f6d9b8581509873429d6452b9d6114c882.zip", + "S3Key": "585a97f83349a78b685159ae808f3d5e404f26701f37b6cafab6b9bd2a54240a.zip", }, "Description": "[ConstructHub/Ingestion] Ingests new package versions into the Construct Hub", "Environment": { @@ -15490,7 +15600,7 @@ Direct link to the function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "a71d2ac6720ed79437a4f7d19e076755b904f7140c3824b3d5863046dd0b6106.zip", + "S3Key": "44d43a2a54d0b29fca264d1b979c3f29e1b2ad99a7dbed07dc40c653723fa96e.zip", }, "Description": "[ConstructHub/Ingestion/ReIngest] The function used to reprocess packages through ingestion", "Environment": { @@ -16236,7 +16346,7 @@ Direct link to the function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "6549e849894f519dd39c81c17a9217205a6b41d8608372746bbcb99d8b5df2c8.zip", + "S3Key": "c6e6167072b6b07955c8c85e2dd6f10dfb99ff0a4202cc508bb43bbf89f7a166.zip", }, "Description": "[ConstructHub/Inventory] A canary that periodically inspects the list of indexed packages", "Environment": { @@ -17733,7 +17843,7 @@ Direct link to function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "7f8efaf5de06bb86e9d2b289cc9719b3ccf06d54fb7c0fea67cf1335fa9b68c8.zip", + "S3Key": "cef891327a29ea5f4bb46bf91875d669d96e0d59b01100dab609eca02e98570e.zip", }, "Description": { "Fn::Join": [ @@ -18047,7 +18157,7 @@ RUNBOOK: https://github.com/cdklabs/construct-hub/blob/main/docs/operator-runboo "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "d75b353bced76b7d0a7ed6728f558a59d9f80bfc6265321f0ad260bf7c216e35.zip", + "S3Key": "33029ab18c52cb68e835ba4984322b51c8c57d41eb3c50c17b7c47fe657249ff.zip", }, "Description": { "Fn::Join": [ @@ -18801,7 +18911,7 @@ Warning: State Machines executions that sent messages to the DLQ will not show a "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "2dd85cd418081d0c50d9926ed1857d6a54f9aedae892165ab4e73d0cea4f60a5.zip", + "S3Key": "7623529867c8640d5112afbb20597aaa05447eb9ae0f10dc134683779942fe77.zip", }, "Description": "[ConstructHub/Orchestration/NeedsCatalogUpdate] Determines whether a package version requires a catalog update", "Environment": { @@ -18956,7 +19066,7 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "0a16de8eba6db13a0b20eaec5bda0dd41ab4c73711d362527232640585ee1b82.zip", + "S3Key": "8877b25a772c66ea32e31e969dce6c213d7ce3f137f8ed860424fc7c3eed7f21.zip", }, "Description": "[ConstructHub/Redrive] Manually redrives all messages from the backend dead letter queue", "Environment": { @@ -19775,7 +19885,7 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", ], "Essential": true, "Image": { - "Fn::Sub": "\${AWS::AccountId}.dkr.ecr.\${AWS::Region}.\${AWS::URLSuffix}/cdk-hnb659fds-container-assets-\${AWS::AccountId}-\${AWS::Region}:5da88de2c99118ec3d58c0ff4df81c7c2e2ac672238eaa6a76470cbecffa30de", + "Fn::Sub": "\${AWS::AccountId}.dkr.ecr.\${AWS::Region}.\${AWS::URLSuffix}/cdk-hnb659fds-container-assets-\${AWS::AccountId}-\${AWS::Region}:be705d3496c7752ab9b10db6ad0bb8861fe3f7d4acfdf4033b0b6696469168f4", }, "LogConfiguration": { "LogDriver": "awslogs", @@ -22413,7 +22523,7 @@ Direct link to Lambda function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "e6bc1cd5142537c9cb233a60ef4c0ac3e21c4f65f8f45f5a055e6b9b29b714d1.zip", + "S3Key": "9e1c8a89a78db19243fdfc9b3c530652c4ef111de42d404cc0cd72cbb9ce8ca9.zip", }, "Description": "[Test/ConstructHub/Sources/NpmJs] Periodically query npmjs.com index for new packages", "Environment": { @@ -22467,7 +22577,7 @@ Direct link to Lambda function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "ae1929615586549c280444e33e62ed40ad5da048806baf96fe43e65192a4ccb9.zip", + "S3Key": "020d678b9118cf26b53d5aae4678948bf7024a3280f1f53d42c5a273b91b74be.zip", }, "Description": "[Test/ConstructHub/Sources/NpmJs/PackageCanary] Monitors construct-hub-probe versions availability", "Environment": { @@ -23172,7 +23282,7 @@ Direct link to Lambda function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "704ddeb0c4c66eb9fd1c1899f4f55a36ca9930c65c05d77f2bbd8e5ed30c3252.zip", + "S3Key": "9aa5fae5f04efae906d8429036c63d65d1d143718e68e24325e87a4e54a45b2f.zip", }, "DeadLetterConfig": { "TargetArn": { @@ -23471,6 +23581,116 @@ Direct link to Lambda function: /lambda/home#/functions/", }, "Type": "AWS::S3::BucketPolicy", }, + "ConstructHubSourcesReStagePackageVersion5E1211D1": { + "DependsOn": [ + "ConstructHubSourcesReStagePackageVersionServiceRoleDefaultPolicyB4F9CE40", + "ConstructHubSourcesReStagePackageVersionServiceRoleCDF009BA", + ], + "Properties": { + "Architectures": [ + "arm64", + ], + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", + }, + "S3Key": "b6d749bd27b34f4b6dd422229950dc4faa9a68fc0fa661a5f51caa13719980d1.zip", + }, + "Description": "Manually re-stage a package version", + "Environment": { + "Variables": { + "FUNCTION_NAME": { + "Ref": "ConstructHubSourcesNpmJsStageAndNotify591C0CFA", + }, + "REGISTRY_URL": "https://registry.npmjs.org", + }, + }, + "Handler": "index.handler", + "MemorySize": 1024, + "Role": { + "Fn::GetAtt": [ + "ConstructHubSourcesReStagePackageVersionServiceRoleCDF009BA", + "Arn", + ], + }, + "Runtime": "nodejs16.x", + "Timeout": 10, + }, + "Type": "AWS::Lambda::Function", + }, + "ConstructHubSourcesReStagePackageVersionServiceRoleCDF009BA": { + "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", + }, + "ConstructHubSourcesReStagePackageVersionServiceRoleDefaultPolicyB4F9CE40": { + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "ConstructHubSourcesNpmJsStageAndNotify591C0CFA", + "Arn", + ], + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "ConstructHubSourcesNpmJsStageAndNotify591C0CFA", + "Arn", + ], + }, + ":*", + ], + ], + }, + ], + }, + ], + "Version": "2012-10-17", + }, + "PolicyName": "ConstructHubSourcesReStagePackageVersionServiceRoleDefaultPolicyB4F9CE40", + "Roles": [ + { + "Ref": "ConstructHubSourcesReStagePackageVersionServiceRoleCDF009BA", + }, + ], + }, + "Type": "AWS::IAM::Policy", + }, "ConstructHubSourcesStagerDLQ80BD2600": { "DeletionPolicy": "Delete", "Properties": { @@ -23583,7 +23803,7 @@ Direct link to Lambda function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "12fe4ed23cf4578a6124606619732fdb95c057f6534914d6b5e5acd5d8f5746c.zip", + "S3Key": "17db8db1b6f0439725b30ff350a32982333308633df6021e5a61c3a1e9d05a94.zip", }, "Description": { "Fn::Join": [ @@ -23790,7 +24010,7 @@ Direct link to Lambda function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "ca6dec3b11e40d596e94afc489bca73434ca292e9f46fe7222856e9fd1efce12.zip", + "S3Key": "3622539c21b9c1547c6c5e7391cb255265975850839e5b95919ad0a34491f650.zip", }, "Description": { "Fn::Join": [ @@ -25051,7 +25271,7 @@ function handler(event) { "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "fcb8a24440ef11d8871140ba517fb07b8754c310e6718286bcd95b42f1b23cc7.zip", + "S3Key": "83a6153078d48ae6022f6f083692f3b9227a563ab7bfb40baf9f01c3c49d512b.zip", }, "Description": "[ConstructHub/MissingDocumentationWidget] Is a custom CloudWatch widget handler", "Environment": { @@ -27091,7 +27311,7 @@ def submit_response(event: dict, context, response_status: str, error_message: s "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "5412352af75bacfd1a6df952bf6052961b164815fed4c309e0401b7025822230.zip", + "S3Key": "ba5982f9bbe5d5375bc05d10155db28ddbd9c80999d6dfa9f70cd580f53b5ffd.zip", }, "Description": "backend/deny-list/prune-handler.lambda.ts", "Environment": { @@ -27287,7 +27507,7 @@ def submit_response(event: dict, context, response_status: str, error_message: s "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "70e01437a075290d2c7db928a3e445722e272f63f4df883343e0daab5de4c17d.zip", + "S3Key": "341871b363349ed63982b3848282cf19140c73241dc2a94a7ff36ad7036b087e.zip", }, "Description": "backend/deny-list/prune-queue-handler.lambda.ts", "Environment": { @@ -27568,7 +27788,7 @@ Direct link to the function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "f1078b6204d9952f3aedcbd86444ec56f43a07cd80ac963b11034cd96ee81fa6.zip", + "S3Key": "74e8e3fb7bde4636be0aa3cd7bc27f6ad2ddb07470a70b0c7ea9d08b186e570d.zip", }, "Description": "Release note RSS feed updater", "Environment": { @@ -27796,7 +28016,7 @@ Direct link to the function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "0e65a7adc90d545702a1854bbf0ca2f6d9b8581509873429d6452b9d6114c882.zip", + "S3Key": "585a97f83349a78b685159ae808f3d5e404f26701f37b6cafab6b9bd2a54240a.zip", }, "Description": "[ConstructHub/Ingestion] Ingests new package versions into the Construct Hub", "Environment": { @@ -28222,7 +28442,7 @@ Direct link to the function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "a71d2ac6720ed79437a4f7d19e076755b904f7140c3824b3d5863046dd0b6106.zip", + "S3Key": "44d43a2a54d0b29fca264d1b979c3f29e1b2ad99a7dbed07dc40c653723fa96e.zip", }, "Description": "[ConstructHub/Ingestion/ReIngest] The function used to reprocess packages through ingestion", "Environment": { @@ -28888,7 +29108,7 @@ Direct link to the function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "6549e849894f519dd39c81c17a9217205a6b41d8608372746bbcb99d8b5df2c8.zip", + "S3Key": "c6e6167072b6b07955c8c85e2dd6f10dfb99ff0a4202cc508bb43bbf89f7a166.zip", }, "Description": "[ConstructHub/Inventory] A canary that periodically inspects the list of indexed packages", "Environment": { @@ -30385,7 +30605,7 @@ Direct link to function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "7f8efaf5de06bb86e9d2b289cc9719b3ccf06d54fb7c0fea67cf1335fa9b68c8.zip", + "S3Key": "cef891327a29ea5f4bb46bf91875d669d96e0d59b01100dab609eca02e98570e.zip", }, "Description": { "Fn::Join": [ @@ -30699,7 +30919,7 @@ RUNBOOK: https://github.com/cdklabs/construct-hub/blob/main/docs/operator-runboo "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "d75b353bced76b7d0a7ed6728f558a59d9f80bfc6265321f0ad260bf7c216e35.zip", + "S3Key": "33029ab18c52cb68e835ba4984322b51c8c57d41eb3c50c17b7c47fe657249ff.zip", }, "Description": { "Fn::Join": [ @@ -31453,7 +31673,7 @@ Warning: State Machines executions that sent messages to the DLQ will not show a "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "2dd85cd418081d0c50d9926ed1857d6a54f9aedae892165ab4e73d0cea4f60a5.zip", + "S3Key": "7623529867c8640d5112afbb20597aaa05447eb9ae0f10dc134683779942fe77.zip", }, "Description": "[ConstructHub/Orchestration/NeedsCatalogUpdate] Determines whether a package version requires a catalog update", "Environment": { @@ -31608,7 +31828,7 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "0a16de8eba6db13a0b20eaec5bda0dd41ab4c73711d362527232640585ee1b82.zip", + "S3Key": "8877b25a772c66ea32e31e969dce6c213d7ce3f137f8ed860424fc7c3eed7f21.zip", }, "Description": "[ConstructHub/Redrive] Manually redrives all messages from the backend dead letter queue", "Environment": { @@ -32400,7 +32620,7 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", ], "Essential": true, "Image": { - "Fn::Sub": "\${AWS::AccountId}.dkr.ecr.\${AWS::Region}.\${AWS::URLSuffix}/cdk-hnb659fds-container-assets-\${AWS::AccountId}-\${AWS::Region}:5da88de2c99118ec3d58c0ff4df81c7c2e2ac672238eaa6a76470cbecffa30de", + "Fn::Sub": "\${AWS::AccountId}.dkr.ecr.\${AWS::Region}.\${AWS::URLSuffix}/cdk-hnb659fds-container-assets-\${AWS::AccountId}-\${AWS::Region}:be705d3496c7752ab9b10db6ad0bb8861fe3f7d4acfdf4033b0b6696469168f4", }, "LogConfiguration": { "LogDriver": "awslogs", @@ -34992,7 +35212,7 @@ Direct link to Lambda function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "e6bc1cd5142537c9cb233a60ef4c0ac3e21c4f65f8f45f5a055e6b9b29b714d1.zip", + "S3Key": "9e1c8a89a78db19243fdfc9b3c530652c4ef111de42d404cc0cd72cbb9ce8ca9.zip", }, "Description": "[Test/ConstructHub/Sources/NpmJs] Periodically query npmjs.com index for new packages", "Environment": { @@ -35046,7 +35266,7 @@ Direct link to Lambda function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "ae1929615586549c280444e33e62ed40ad5da048806baf96fe43e65192a4ccb9.zip", + "S3Key": "020d678b9118cf26b53d5aae4678948bf7024a3280f1f53d42c5a273b91b74be.zip", }, "Description": "[Test/ConstructHub/Sources/NpmJs/PackageCanary] Monitors construct-hub-probe versions availability", "Environment": { @@ -35751,7 +35971,7 @@ Direct link to Lambda function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "704ddeb0c4c66eb9fd1c1899f4f55a36ca9930c65c05d77f2bbd8e5ed30c3252.zip", + "S3Key": "9aa5fae5f04efae906d8429036c63d65d1d143718e68e24325e87a4e54a45b2f.zip", }, "DeadLetterConfig": { "TargetArn": { @@ -36050,6 +36270,116 @@ Direct link to Lambda function: /lambda/home#/functions/", }, "Type": "AWS::S3::BucketPolicy", }, + "ConstructHubSourcesReStagePackageVersion5E1211D1": { + "DependsOn": [ + "ConstructHubSourcesReStagePackageVersionServiceRoleDefaultPolicyB4F9CE40", + "ConstructHubSourcesReStagePackageVersionServiceRoleCDF009BA", + ], + "Properties": { + "Architectures": [ + "arm64", + ], + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", + }, + "S3Key": "b6d749bd27b34f4b6dd422229950dc4faa9a68fc0fa661a5f51caa13719980d1.zip", + }, + "Description": "Manually re-stage a package version", + "Environment": { + "Variables": { + "FUNCTION_NAME": { + "Ref": "ConstructHubSourcesNpmJsStageAndNotify591C0CFA", + }, + "REGISTRY_URL": "https://registry.npmjs.org", + }, + }, + "Handler": "index.handler", + "MemorySize": 1024, + "Role": { + "Fn::GetAtt": [ + "ConstructHubSourcesReStagePackageVersionServiceRoleCDF009BA", + "Arn", + ], + }, + "Runtime": "nodejs16.x", + "Timeout": 10, + }, + "Type": "AWS::Lambda::Function", + }, + "ConstructHubSourcesReStagePackageVersionServiceRoleCDF009BA": { + "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", + }, + "ConstructHubSourcesReStagePackageVersionServiceRoleDefaultPolicyB4F9CE40": { + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "ConstructHubSourcesNpmJsStageAndNotify591C0CFA", + "Arn", + ], + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "ConstructHubSourcesNpmJsStageAndNotify591C0CFA", + "Arn", + ], + }, + ":*", + ], + ], + }, + ], + }, + ], + "Version": "2012-10-17", + }, + "PolicyName": "ConstructHubSourcesReStagePackageVersionServiceRoleDefaultPolicyB4F9CE40", + "Roles": [ + { + "Ref": "ConstructHubSourcesReStagePackageVersionServiceRoleCDF009BA", + }, + ], + }, + "Type": "AWS::IAM::Policy", + }, "ConstructHubSourcesStagerDLQ80BD2600": { "DeletionPolicy": "Delete", "Properties": { @@ -36162,7 +36492,7 @@ Direct link to Lambda function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "12fe4ed23cf4578a6124606619732fdb95c057f6534914d6b5e5acd5d8f5746c.zip", + "S3Key": "17db8db1b6f0439725b30ff350a32982333308633df6021e5a61c3a1e9d05a94.zip", }, "Description": { "Fn::Join": [ @@ -36369,7 +36699,7 @@ Direct link to Lambda function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "ca6dec3b11e40d596e94afc489bca73434ca292e9f46fe7222856e9fd1efce12.zip", + "S3Key": "3622539c21b9c1547c6c5e7391cb255265975850839e5b95919ad0a34491f650.zip", }, "Description": { "Fn::Join": [ @@ -37630,7 +37960,7 @@ function handler(event) { "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "fcb8a24440ef11d8871140ba517fb07b8754c310e6718286bcd95b42f1b23cc7.zip", + "S3Key": "83a6153078d48ae6022f6f083692f3b9227a563ab7bfb40baf9f01c3c49d512b.zip", }, "Description": "[ConstructHub/MissingDocumentationWidget] Is a custom CloudWatch widget handler", "Environment": { @@ -39810,7 +40140,7 @@ def submit_response(event: dict, context, response_status: str, error_message: s "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "5412352af75bacfd1a6df952bf6052961b164815fed4c309e0401b7025822230.zip", + "S3Key": "ba5982f9bbe5d5375bc05d10155db28ddbd9c80999d6dfa9f70cd580f53b5ffd.zip", }, "Description": "backend/deny-list/prune-handler.lambda.ts", "Environment": { @@ -40006,7 +40336,7 @@ def submit_response(event: dict, context, response_status: str, error_message: s "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "70e01437a075290d2c7db928a3e445722e272f63f4df883343e0daab5de4c17d.zip", + "S3Key": "341871b363349ed63982b3848282cf19140c73241dc2a94a7ff36ad7036b087e.zip", }, "Description": "backend/deny-list/prune-queue-handler.lambda.ts", "Environment": { @@ -40287,7 +40617,7 @@ Direct link to the function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "f1078b6204d9952f3aedcbd86444ec56f43a07cd80ac963b11034cd96ee81fa6.zip", + "S3Key": "74e8e3fb7bde4636be0aa3cd7bc27f6ad2ddb07470a70b0c7ea9d08b186e570d.zip", }, "Description": "Release note RSS feed updater", "Environment": { @@ -40502,7 +40832,7 @@ Direct link to the function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "0e65a7adc90d545702a1854bbf0ca2f6d9b8581509873429d6452b9d6114c882.zip", + "S3Key": "585a97f83349a78b685159ae808f3d5e404f26701f37b6cafab6b9bd2a54240a.zip", }, "Description": "[ConstructHub/Ingestion] Ingests new package versions into the Construct Hub", "Environment": { @@ -40928,7 +41258,7 @@ Direct link to the function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "a71d2ac6720ed79437a4f7d19e076755b904f7140c3824b3d5863046dd0b6106.zip", + "S3Key": "44d43a2a54d0b29fca264d1b979c3f29e1b2ad99a7dbed07dc40c653723fa96e.zip", }, "Description": "[ConstructHub/Ingestion/ReIngest] The function used to reprocess packages through ingestion", "Environment": { @@ -41594,7 +41924,7 @@ Direct link to the function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "6549e849894f519dd39c81c17a9217205a6b41d8608372746bbcb99d8b5df2c8.zip", + "S3Key": "c6e6167072b6b07955c8c85e2dd6f10dfb99ff0a4202cc508bb43bbf89f7a166.zip", }, "Description": "[ConstructHub/Inventory] A canary that periodically inspects the list of indexed packages", "Environment": { @@ -43113,7 +43443,7 @@ Direct link to function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "7f8efaf5de06bb86e9d2b289cc9719b3ccf06d54fb7c0fea67cf1335fa9b68c8.zip", + "S3Key": "cef891327a29ea5f4bb46bf91875d669d96e0d59b01100dab609eca02e98570e.zip", }, "Description": { "Fn::Join": [ @@ -43427,7 +43757,7 @@ RUNBOOK: https://github.com/cdklabs/construct-hub/blob/main/docs/operator-runboo "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "d75b353bced76b7d0a7ed6728f558a59d9f80bfc6265321f0ad260bf7c216e35.zip", + "S3Key": "33029ab18c52cb68e835ba4984322b51c8c57d41eb3c50c17b7c47fe657249ff.zip", }, "Description": { "Fn::Join": [ @@ -44181,7 +44511,7 @@ Warning: State Machines executions that sent messages to the DLQ will not show a "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "2dd85cd418081d0c50d9926ed1857d6a54f9aedae892165ab4e73d0cea4f60a5.zip", + "S3Key": "7623529867c8640d5112afbb20597aaa05447eb9ae0f10dc134683779942fe77.zip", }, "Description": "[ConstructHub/Orchestration/NeedsCatalogUpdate] Determines whether a package version requires a catalog update", "Environment": { @@ -44336,7 +44666,7 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "0a16de8eba6db13a0b20eaec5bda0dd41ab4c73711d362527232640585ee1b82.zip", + "S3Key": "8877b25a772c66ea32e31e969dce6c213d7ce3f137f8ed860424fc7c3eed7f21.zip", }, "Description": "[ConstructHub/Redrive] Manually redrives all messages from the backend dead letter queue", "Environment": { @@ -45128,7 +45458,7 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", ], "Essential": true, "Image": { - "Fn::Sub": "\${AWS::AccountId}.dkr.ecr.\${AWS::Region}.\${AWS::URLSuffix}/cdk-hnb659fds-container-assets-\${AWS::AccountId}-\${AWS::Region}:5da88de2c99118ec3d58c0ff4df81c7c2e2ac672238eaa6a76470cbecffa30de", + "Fn::Sub": "\${AWS::AccountId}.dkr.ecr.\${AWS::Region}.\${AWS::URLSuffix}/cdk-hnb659fds-container-assets-\${AWS::AccountId}-\${AWS::Region}:be705d3496c7752ab9b10db6ad0bb8861fe3f7d4acfdf4033b0b6696469168f4", }, "LogConfiguration": { "LogDriver": "awslogs", @@ -47720,7 +48050,7 @@ Direct link to Lambda function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "e6bc1cd5142537c9cb233a60ef4c0ac3e21c4f65f8f45f5a055e6b9b29b714d1.zip", + "S3Key": "9e1c8a89a78db19243fdfc9b3c530652c4ef111de42d404cc0cd72cbb9ce8ca9.zip", }, "Description": "[Test/ConstructHub/Sources/NpmJs] Periodically query npmjs.com index for new packages", "Environment": { @@ -47774,7 +48104,7 @@ Direct link to Lambda function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "ae1929615586549c280444e33e62ed40ad5da048806baf96fe43e65192a4ccb9.zip", + "S3Key": "020d678b9118cf26b53d5aae4678948bf7024a3280f1f53d42c5a273b91b74be.zip", }, "Description": "[Test/ConstructHub/Sources/NpmJs/PackageCanary] Monitors construct-hub-probe versions availability", "Environment": { @@ -48466,7 +48796,7 @@ Direct link to Lambda function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "704ddeb0c4c66eb9fd1c1899f4f55a36ca9930c65c05d77f2bbd8e5ed30c3252.zip", + "S3Key": "9aa5fae5f04efae906d8429036c63d65d1d143718e68e24325e87a4e54a45b2f.zip", }, "DeadLetterConfig": { "TargetArn": { @@ -48765,6 +49095,116 @@ Direct link to Lambda function: /lambda/home#/functions/", }, "Type": "AWS::S3::BucketPolicy", }, + "ConstructHubSourcesReStagePackageVersion5E1211D1": { + "DependsOn": [ + "ConstructHubSourcesReStagePackageVersionServiceRoleDefaultPolicyB4F9CE40", + "ConstructHubSourcesReStagePackageVersionServiceRoleCDF009BA", + ], + "Properties": { + "Architectures": [ + "arm64", + ], + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", + }, + "S3Key": "b6d749bd27b34f4b6dd422229950dc4faa9a68fc0fa661a5f51caa13719980d1.zip", + }, + "Description": "Manually re-stage a package version", + "Environment": { + "Variables": { + "FUNCTION_NAME": { + "Ref": "ConstructHubSourcesNpmJsStageAndNotify591C0CFA", + }, + "REGISTRY_URL": "https://registry.npmjs.org", + }, + }, + "Handler": "index.handler", + "MemorySize": 1024, + "Role": { + "Fn::GetAtt": [ + "ConstructHubSourcesReStagePackageVersionServiceRoleCDF009BA", + "Arn", + ], + }, + "Runtime": "nodejs16.x", + "Timeout": 10, + }, + "Type": "AWS::Lambda::Function", + }, + "ConstructHubSourcesReStagePackageVersionServiceRoleCDF009BA": { + "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", + }, + "ConstructHubSourcesReStagePackageVersionServiceRoleDefaultPolicyB4F9CE40": { + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "ConstructHubSourcesNpmJsStageAndNotify591C0CFA", + "Arn", + ], + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "ConstructHubSourcesNpmJsStageAndNotify591C0CFA", + "Arn", + ], + }, + ":*", + ], + ], + }, + ], + }, + ], + "Version": "2012-10-17", + }, + "PolicyName": "ConstructHubSourcesReStagePackageVersionServiceRoleDefaultPolicyB4F9CE40", + "Roles": [ + { + "Ref": "ConstructHubSourcesReStagePackageVersionServiceRoleCDF009BA", + }, + ], + }, + "Type": "AWS::IAM::Policy", + }, "ConstructHubSourcesStagerDLQ80BD2600": { "DeletionPolicy": "Delete", "Properties": { @@ -48877,7 +49317,7 @@ Direct link to Lambda function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "12fe4ed23cf4578a6124606619732fdb95c057f6534914d6b5e5acd5d8f5746c.zip", + "S3Key": "17db8db1b6f0439725b30ff350a32982333308633df6021e5a61c3a1e9d05a94.zip", }, "Description": { "Fn::Join": [ @@ -49084,7 +49524,7 @@ Direct link to Lambda function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "ca6dec3b11e40d596e94afc489bca73434ca292e9f46fe7222856e9fd1efce12.zip", + "S3Key": "3622539c21b9c1547c6c5e7391cb255265975850839e5b95919ad0a34491f650.zip", }, "Description": { "Fn::Join": [ @@ -50595,7 +51035,7 @@ function handler(event) { "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "fcb8a24440ef11d8871140ba517fb07b8754c310e6718286bcd95b42f1b23cc7.zip", + "S3Key": "83a6153078d48ae6022f6f083692f3b9227a563ab7bfb40baf9f01c3c49d512b.zip", }, "Description": "[ConstructHub/MissingDocumentationWidget] Is a custom CloudWatch widget handler", "Environment": { @@ -52712,7 +53152,7 @@ def submit_response(event: dict, context, response_status: str, error_message: s "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "5412352af75bacfd1a6df952bf6052961b164815fed4c309e0401b7025822230.zip", + "S3Key": "ba5982f9bbe5d5375bc05d10155db28ddbd9c80999d6dfa9f70cd580f53b5ffd.zip", }, "Description": "backend/deny-list/prune-handler.lambda.ts", "Environment": { @@ -52908,7 +53348,7 @@ def submit_response(event: dict, context, response_status: str, error_message: s "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "70e01437a075290d2c7db928a3e445722e272f63f4df883343e0daab5de4c17d.zip", + "S3Key": "341871b363349ed63982b3848282cf19140c73241dc2a94a7ff36ad7036b087e.zip", }, "Description": "backend/deny-list/prune-queue-handler.lambda.ts", "Environment": { @@ -53189,7 +53629,7 @@ Direct link to the function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "f1078b6204d9952f3aedcbd86444ec56f43a07cd80ac963b11034cd96ee81fa6.zip", + "S3Key": "74e8e3fb7bde4636be0aa3cd7bc27f6ad2ddb07470a70b0c7ea9d08b186e570d.zip", }, "Description": "Release note RSS feed updater", "Environment": { @@ -53417,7 +53857,7 @@ Direct link to the function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "0e65a7adc90d545702a1854bbf0ca2f6d9b8581509873429d6452b9d6114c882.zip", + "S3Key": "585a97f83349a78b685159ae808f3d5e404f26701f37b6cafab6b9bd2a54240a.zip", }, "Description": "[ConstructHub/Ingestion] Ingests new package versions into the Construct Hub", "Environment": { @@ -53843,7 +54283,7 @@ Direct link to the function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "a71d2ac6720ed79437a4f7d19e076755b904f7140c3824b3d5863046dd0b6106.zip", + "S3Key": "44d43a2a54d0b29fca264d1b979c3f29e1b2ad99a7dbed07dc40c653723fa96e.zip", }, "Description": "[ConstructHub/Ingestion/ReIngest] The function used to reprocess packages through ingestion", "Environment": { @@ -54635,7 +55075,7 @@ Direct link to the function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "6549e849894f519dd39c81c17a9217205a6b41d8608372746bbcb99d8b5df2c8.zip", + "S3Key": "c6e6167072b6b07955c8c85e2dd6f10dfb99ff0a4202cc508bb43bbf89f7a166.zip", }, "Description": "[ConstructHub/Inventory] A canary that periodically inspects the list of indexed packages", "Environment": { @@ -56161,7 +56601,7 @@ Direct link to function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "7f8efaf5de06bb86e9d2b289cc9719b3ccf06d54fb7c0fea67cf1335fa9b68c8.zip", + "S3Key": "cef891327a29ea5f4bb46bf91875d669d96e0d59b01100dab609eca02e98570e.zip", }, "Description": { "Fn::Join": [ @@ -56475,7 +56915,7 @@ RUNBOOK: https://github.com/cdklabs/construct-hub/blob/main/docs/operator-runboo "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "d75b353bced76b7d0a7ed6728f558a59d9f80bfc6265321f0ad260bf7c216e35.zip", + "S3Key": "33029ab18c52cb68e835ba4984322b51c8c57d41eb3c50c17b7c47fe657249ff.zip", }, "Description": { "Fn::Join": [ @@ -56822,7 +57262,7 @@ Warning: State Machines executions that sent messages to the DLQ will not show a "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "2dd85cd418081d0c50d9926ed1857d6a54f9aedae892165ab4e73d0cea4f60a5.zip", + "S3Key": "7623529867c8640d5112afbb20597aaa05447eb9ae0f10dc134683779942fe77.zip", }, "Description": "[ConstructHub/Orchestration/NeedsCatalogUpdate] Determines whether a package version requires a catalog update", "Environment": { @@ -56977,7 +57417,7 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "0a16de8eba6db13a0b20eaec5bda0dd41ab4c73711d362527232640585ee1b82.zip", + "S3Key": "8877b25a772c66ea32e31e969dce6c213d7ce3f137f8ed860424fc7c3eed7f21.zip", }, "Description": "[ConstructHub/Redrive] Manually redrives all messages from the backend dead letter queue", "Environment": { @@ -57775,7 +58215,7 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", ], "Essential": true, "Image": { - "Fn::Sub": "\${AWS::AccountId}.dkr.ecr.\${AWS::Region}.\${AWS::URLSuffix}/cdk-hnb659fds-container-assets-\${AWS::AccountId}-\${AWS::Region}:5da88de2c99118ec3d58c0ff4df81c7c2e2ac672238eaa6a76470cbecffa30de", + "Fn::Sub": "\${AWS::AccountId}.dkr.ecr.\${AWS::Region}.\${AWS::URLSuffix}/cdk-hnb659fds-container-assets-\${AWS::AccountId}-\${AWS::Region}:be705d3496c7752ab9b10db6ad0bb8861fe3f7d4acfdf4033b0b6696469168f4", }, "LogConfiguration": { "LogDriver": "awslogs", @@ -60429,7 +60869,7 @@ Direct link to Lambda function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "e6bc1cd5142537c9cb233a60ef4c0ac3e21c4f65f8f45f5a055e6b9b29b714d1.zip", + "S3Key": "9e1c8a89a78db19243fdfc9b3c530652c4ef111de42d404cc0cd72cbb9ce8ca9.zip", }, "Description": "[Test/ConstructHub/Sources/NpmJs] Periodically query npmjs.com index for new packages", "Environment": { @@ -60483,7 +60923,7 @@ Direct link to Lambda function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "ae1929615586549c280444e33e62ed40ad5da048806baf96fe43e65192a4ccb9.zip", + "S3Key": "020d678b9118cf26b53d5aae4678948bf7024a3280f1f53d42c5a273b91b74be.zip", }, "Description": "[Test/ConstructHub/Sources/NpmJs/PackageCanary] Monitors construct-hub-probe versions availability", "Environment": { @@ -61188,7 +61628,7 @@ Direct link to Lambda function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "704ddeb0c4c66eb9fd1c1899f4f55a36ca9930c65c05d77f2bbd8e5ed30c3252.zip", + "S3Key": "9aa5fae5f04efae906d8429036c63d65d1d143718e68e24325e87a4e54a45b2f.zip", }, "DeadLetterConfig": { "TargetArn": { @@ -61487,6 +61927,116 @@ Direct link to Lambda function: /lambda/home#/functions/", }, "Type": "AWS::S3::BucketPolicy", }, + "ConstructHubSourcesReStagePackageVersion5E1211D1": { + "DependsOn": [ + "ConstructHubSourcesReStagePackageVersionServiceRoleDefaultPolicyB4F9CE40", + "ConstructHubSourcesReStagePackageVersionServiceRoleCDF009BA", + ], + "Properties": { + "Architectures": [ + "arm64", + ], + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", + }, + "S3Key": "b6d749bd27b34f4b6dd422229950dc4faa9a68fc0fa661a5f51caa13719980d1.zip", + }, + "Description": "Manually re-stage a package version", + "Environment": { + "Variables": { + "FUNCTION_NAME": { + "Ref": "ConstructHubSourcesNpmJsStageAndNotify591C0CFA", + }, + "REGISTRY_URL": "https://registry.npmjs.org", + }, + }, + "Handler": "index.handler", + "MemorySize": 1024, + "Role": { + "Fn::GetAtt": [ + "ConstructHubSourcesReStagePackageVersionServiceRoleCDF009BA", + "Arn", + ], + }, + "Runtime": "nodejs16.x", + "Timeout": 10, + }, + "Type": "AWS::Lambda::Function", + }, + "ConstructHubSourcesReStagePackageVersionServiceRoleCDF009BA": { + "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", + }, + "ConstructHubSourcesReStagePackageVersionServiceRoleDefaultPolicyB4F9CE40": { + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "ConstructHubSourcesNpmJsStageAndNotify591C0CFA", + "Arn", + ], + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "ConstructHubSourcesNpmJsStageAndNotify591C0CFA", + "Arn", + ], + }, + ":*", + ], + ], + }, + ], + }, + ], + "Version": "2012-10-17", + }, + "PolicyName": "ConstructHubSourcesReStagePackageVersionServiceRoleDefaultPolicyB4F9CE40", + "Roles": [ + { + "Ref": "ConstructHubSourcesReStagePackageVersionServiceRoleCDF009BA", + }, + ], + }, + "Type": "AWS::IAM::Policy", + }, "ConstructHubSourcesStagerDLQ80BD2600": { "DeletionPolicy": "Delete", "Properties": { @@ -61599,7 +62149,7 @@ Direct link to Lambda function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "12fe4ed23cf4578a6124606619732fdb95c057f6534914d6b5e5acd5d8f5746c.zip", + "S3Key": "17db8db1b6f0439725b30ff350a32982333308633df6021e5a61c3a1e9d05a94.zip", }, "Description": { "Fn::Join": [ @@ -64666,7 +65216,7 @@ Direct link to Lambda function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "ca6dec3b11e40d596e94afc489bca73434ca292e9f46fe7222856e9fd1efce12.zip", + "S3Key": "3622539c21b9c1547c6c5e7391cb255265975850839e5b95919ad0a34491f650.zip", }, "Description": { "Fn::Join": [ @@ -66484,7 +67034,7 @@ function handler(event) { "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "fcb8a24440ef11d8871140ba517fb07b8754c310e6718286bcd95b42f1b23cc7.zip", + "S3Key": "83a6153078d48ae6022f6f083692f3b9227a563ab7bfb40baf9f01c3c49d512b.zip", }, "Description": "[ConstructHub/MissingDocumentationWidget] Is a custom CloudWatch widget handler", "Environment": { diff --git a/src/__tests__/backend/deny-list/__snapshots__/deny-list.test.ts.snap b/src/__tests__/backend/deny-list/__snapshots__/deny-list.test.ts.snap index b351ee043..7af01660b 100644 --- a/src/__tests__/backend/deny-list/__snapshots__/deny-list.test.ts.snap +++ b/src/__tests__/backend/deny-list/__snapshots__/deny-list.test.ts.snap @@ -932,7 +932,7 @@ def submit_response(event: dict, context, response_status: str, error_message: s "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "5412352af75bacfd1a6df952bf6052961b164815fed4c309e0401b7025822230.zip", + "S3Key": "ba5982f9bbe5d5375bc05d10155db28ddbd9c80999d6dfa9f70cd580f53b5ffd.zip", }, "Description": "backend/deny-list/prune-handler.lambda.ts", "Environment": { @@ -1128,7 +1128,7 @@ def submit_response(event: dict, context, response_status: str, error_message: s "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "70e01437a075290d2c7db928a3e445722e272f63f4df883343e0daab5de4c17d.zip", + "S3Key": "341871b363349ed63982b3848282cf19140c73241dc2a94a7ff36ad7036b087e.zip", }, "Description": "backend/deny-list/prune-queue-handler.lambda.ts", "Environment": { diff --git a/src/__tests__/backend/shared/code-artifact.test.ts b/src/__tests__/backend/shared/code-artifact.test.ts index 909b0d124..88f279d73 100644 --- a/src/__tests__/backend/shared/code-artifact.test.ts +++ b/src/__tests__/backend/shared/code-artifact.test.ts @@ -115,6 +115,9 @@ class MockChildProcess (err) => this.emit('error', err) ); } + [Symbol.dispose](): void { + throw new Error('Method not implemented.'); + } public get connected(): never { throw new Error('Not Implemented'); diff --git a/src/__tests__/backend/transliterator/__snapshots__/index.test.ts.snap b/src/__tests__/backend/transliterator/__snapshots__/index.test.ts.snap index b9c67a833..12dc03e44 100644 --- a/src/__tests__/backend/transliterator/__snapshots__/index.test.ts.snap +++ b/src/__tests__/backend/transliterator/__snapshots__/index.test.ts.snap @@ -126,7 +126,7 @@ exports[`CodeArtifact repository 1`] = ` ], "Essential": true, "Image": { - "Fn::Sub": "\${AWS::AccountId}.dkr.ecr.\${AWS::Region}.\${AWS::URLSuffix}/cdk-hnb659fds-container-assets-\${AWS::AccountId}-\${AWS::Region}:5da88de2c99118ec3d58c0ff4df81c7c2e2ac672238eaa6a76470cbecffa30de", + "Fn::Sub": "\${AWS::AccountId}.dkr.ecr.\${AWS::Region}.\${AWS::URLSuffix}/cdk-hnb659fds-container-assets-\${AWS::AccountId}-\${AWS::Region}:be705d3496c7752ab9b10db6ad0bb8861fe3f7d4acfdf4033b0b6696469168f4", }, "LogConfiguration": { "LogDriver": "awslogs", @@ -2449,7 +2449,7 @@ exports[`VPC Endpoints 1`] = ` ], "Essential": true, "Image": { - "Fn::Sub": "\${AWS::AccountId}.dkr.ecr.\${AWS::Region}.\${AWS::URLSuffix}/cdk-hnb659fds-container-assets-\${AWS::AccountId}-\${AWS::Region}:5da88de2c99118ec3d58c0ff4df81c7c2e2ac672238eaa6a76470cbecffa30de", + "Fn::Sub": "\${AWS::AccountId}.dkr.ecr.\${AWS::Region}.\${AWS::URLSuffix}/cdk-hnb659fds-container-assets-\${AWS::AccountId}-\${AWS::Region}:be705d3496c7752ab9b10db6ad0bb8861fe3f7d4acfdf4033b0b6696469168f4", }, "LogConfiguration": { "LogDriver": "awslogs", @@ -4823,7 +4823,7 @@ exports[`VPC Endpoints and CodeArtifact repository 1`] = ` ], "Essential": true, "Image": { - "Fn::Sub": "\${AWS::AccountId}.dkr.ecr.\${AWS::Region}.\${AWS::URLSuffix}/cdk-hnb659fds-container-assets-\${AWS::AccountId}-\${AWS::Region}:5da88de2c99118ec3d58c0ff4df81c7c2e2ac672238eaa6a76470cbecffa30de", + "Fn::Sub": "\${AWS::AccountId}.dkr.ecr.\${AWS::Region}.\${AWS::URLSuffix}/cdk-hnb659fds-container-assets-\${AWS::AccountId}-\${AWS::Region}:be705d3496c7752ab9b10db6ad0bb8861fe3f7d4acfdf4033b0b6696469168f4", }, "LogConfiguration": { "LogDriver": "awslogs", @@ -7142,7 +7142,7 @@ exports[`basic use 1`] = ` ], "Essential": true, "Image": { - "Fn::Sub": "\${AWS::AccountId}.dkr.ecr.\${AWS::Region}.\${AWS::URLSuffix}/cdk-hnb659fds-container-assets-\${AWS::AccountId}-\${AWS::Region}:5da88de2c99118ec3d58c0ff4df81c7c2e2ac672238eaa6a76470cbecffa30de", + "Fn::Sub": "\${AWS::AccountId}.dkr.ecr.\${AWS::Region}.\${AWS::URLSuffix}/cdk-hnb659fds-container-assets-\${AWS::AccountId}-\${AWS::Region}:be705d3496c7752ab9b10db6ad0bb8861fe3f7d4acfdf4033b0b6696469168f4", }, "LogConfiguration": { "LogDriver": "awslogs", diff --git a/src/__tests__/devapp/__snapshots__/snapshot.test.ts.snap b/src/__tests__/devapp/__snapshots__/snapshot.test.ts.snap index 82319f686..207d8ceb3 100644 --- a/src/__tests__/devapp/__snapshots__/snapshot.test.ts.snap +++ b/src/__tests__/devapp/__snapshots__/snapshot.test.ts.snap @@ -1961,7 +1961,7 @@ def submit_response(event: dict, context, response_status: str, error_message: s "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "5412352af75bacfd1a6df952bf6052961b164815fed4c309e0401b7025822230.zip", + "S3Key": "ba5982f9bbe5d5375bc05d10155db28ddbd9c80999d6dfa9f70cd580f53b5ffd.zip", }, "Description": "backend/deny-list/prune-handler.lambda.ts", "Environment": { @@ -2157,7 +2157,7 @@ def submit_response(event: dict, context, response_status: str, error_message: s "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "70e01437a075290d2c7db928a3e445722e272f63f4df883343e0daab5de4c17d.zip", + "S3Key": "341871b363349ed63982b3848282cf19140c73241dc2a94a7ff36ad7036b087e.zip", }, "Description": "backend/deny-list/prune-queue-handler.lambda.ts", "Environment": { @@ -2435,7 +2435,7 @@ Direct link to the function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "f1078b6204d9952f3aedcbd86444ec56f43a07cd80ac963b11034cd96ee81fa6.zip", + "S3Key": "74e8e3fb7bde4636be0aa3cd7bc27f6ad2ddb07470a70b0c7ea9d08b186e570d.zip", }, "Description": "Release note RSS feed updater", "Environment": { @@ -2665,7 +2665,7 @@ Direct link to the function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "0e65a7adc90d545702a1854bbf0ca2f6d9b8581509873429d6452b9d6114c882.zip", + "S3Key": "585a97f83349a78b685159ae808f3d5e404f26701f37b6cafab6b9bd2a54240a.zip", }, "Description": "[ConstructHub/Ingestion] Ingests new package versions into the Construct Hub", "Environment": { @@ -3109,7 +3109,7 @@ Direct link to the function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "a71d2ac6720ed79437a4f7d19e076755b904f7140c3824b3d5863046dd0b6106.zip", + "S3Key": "44d43a2a54d0b29fca264d1b979c3f29e1b2ad99a7dbed07dc40c653723fa96e.zip", }, "Description": "[ConstructHub/Ingestion/ReIngest] The function used to reprocess packages through ingestion", "Environment": { @@ -3868,7 +3868,7 @@ Direct link to the function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "6549e849894f519dd39c81c17a9217205a6b41d8608372746bbcb99d8b5df2c8.zip", + "S3Key": "c6e6167072b6b07955c8c85e2dd6f10dfb99ff0a4202cc508bb43bbf89f7a166.zip", }, "Description": "[ConstructHub/Inventory] A canary that periodically inspects the list of indexed packages", "Environment": { @@ -5408,7 +5408,7 @@ Direct link to function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "7f8efaf5de06bb86e9d2b289cc9719b3ccf06d54fb7c0fea67cf1335fa9b68c8.zip", + "S3Key": "cef891327a29ea5f4bb46bf91875d669d96e0d59b01100dab609eca02e98570e.zip", }, "Description": { "Fn::Join": [ @@ -5719,7 +5719,7 @@ RUNBOOK: https://github.com/cdklabs/construct-hub/blob/main/docs/operator-runboo "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "d75b353bced76b7d0a7ed6728f558a59d9f80bfc6265321f0ad260bf7c216e35.zip", + "S3Key": "33029ab18c52cb68e835ba4984322b51c8c57d41eb3c50c17b7c47fe657249ff.zip", }, "Description": { "Fn::Join": [ @@ -6079,7 +6079,7 @@ Warning: State Machines executions that sent messages to the DLQ will not show a "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "2dd85cd418081d0c50d9926ed1857d6a54f9aedae892165ab4e73d0cea4f60a5.zip", + "S3Key": "7623529867c8640d5112afbb20597aaa05447eb9ae0f10dc134683779942fe77.zip", }, "Description": "[ConstructHub/Orchestration/NeedsCatalogUpdate] Determines whether a package version requires a catalog update", "Environment": { @@ -6231,7 +6231,7 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "0a16de8eba6db13a0b20eaec5bda0dd41ab4c73711d362527232640585ee1b82.zip", + "S3Key": "8877b25a772c66ea32e31e969dce6c213d7ce3f137f8ed860424fc7c3eed7f21.zip", }, "Description": "[ConstructHub/Redrive] Manually redrives all messages from the backend dead letter queue", "Environment": { @@ -7080,7 +7080,7 @@ Warning: messages that resulted in a failed exectuion will NOT be in the DLQ!", ], "Essential": true, "Image": { - "Fn::Sub": "\${AWS::AccountId}.dkr.ecr.\${AWS::Region}.\${AWS::URLSuffix}/cdk-hnb659fds-container-assets-\${AWS::AccountId}-\${AWS::Region}:5da88de2c99118ec3d58c0ff4df81c7c2e2ac672238eaa6a76470cbecffa30de", + "Fn::Sub": "\${AWS::AccountId}.dkr.ecr.\${AWS::Region}.\${AWS::URLSuffix}/cdk-hnb659fds-container-assets-\${AWS::AccountId}-\${AWS::Region}:be705d3496c7752ab9b10db6ad0bb8861fe3f7d4acfdf4033b0b6696469168f4", }, "LogConfiguration": { "LogDriver": "awslogs", @@ -9683,7 +9683,7 @@ Direct link to Lambda function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "60019e0af438fcd0acd848e80bd337cf42d769b8f5e7485547666076f85f9dea.zip", + "S3Key": "3c6a397ce7fede313a606f6bf08258e203b38d04c3803067384b1eab13db513b.zip", }, "Description": "ReleaseNotes generator", "Environment": { @@ -9834,7 +9834,7 @@ Direct link to Lambda function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "9a09eb269c5509633770c0dbe5320688476c7849ddaa7e22e9f4cc2412d9fc70.zip", + "S3Key": "2cdea0627bc2407838d71f7f95bec9e23a8fa6952b42b4038758d28a7107c353.zip", }, "Description": "ReleaseNotes get message from the worker queue", "Environment": { @@ -10105,7 +10105,7 @@ RunBook: https://github.com/cdklabs/construct-hub/blob/main/docs/operator-runboo "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "f561f9b78dbf15c6d8af30092a510e8af4098a340584682e844bcf61ff546f3d.zip", + "S3Key": "bb427e3ae6cfad8431d02e06cd34afbe39c1ea99e86190ea5a865ee584044f30.zip", }, "Description": "backend/release-notes/release-notes-trigger.lambda.ts", "Environment": { @@ -10688,7 +10688,7 @@ Direct link to the function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "e6bc1cd5142537c9cb233a60ef4c0ac3e21c4f65f8f45f5a055e6b9b29b714d1.zip", + "S3Key": "9e1c8a89a78db19243fdfc9b3c530652c4ef111de42d404cc0cd72cbb9ce8ca9.zip", }, "Description": "[dev/ConstructHub/Sources/NpmJs] Periodically query npmjs.com index for new packages", "Environment": { @@ -10742,7 +10742,7 @@ Direct link to the function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "ae1929615586549c280444e33e62ed40ad5da048806baf96fe43e65192a4ccb9.zip", + "S3Key": "020d678b9118cf26b53d5aae4678948bf7024a3280f1f53d42c5a273b91b74be.zip", }, "Description": "[dev/ConstructHub/Sources/NpmJs/PackageCanary] Monitors construct-hub-probe versions availability", "Environment": { @@ -11441,7 +11441,7 @@ Direct link to Lambda function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "704ddeb0c4c66eb9fd1c1899f4f55a36ca9930c65c05d77f2bbd8e5ed30c3252.zip", + "S3Key": "9aa5fae5f04efae906d8429036c63d65d1d143718e68e24325e87a4e54a45b2f.zip", }, "DeadLetterConfig": { "TargetArn": { @@ -11740,6 +11740,116 @@ Direct link to Lambda function: /lambda/home#/functions/", }, "Type": "AWS::S3::BucketPolicy", }, + "ConstructHubSourcesReStagePackageVersion5E1211D1": { + "DependsOn": [ + "ConstructHubSourcesReStagePackageVersionServiceRoleDefaultPolicyB4F9CE40", + "ConstructHubSourcesReStagePackageVersionServiceRoleCDF009BA", + ], + "Properties": { + "Architectures": [ + "arm64", + ], + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", + }, + "S3Key": "b6d749bd27b34f4b6dd422229950dc4faa9a68fc0fa661a5f51caa13719980d1.zip", + }, + "Description": "Manually re-stage a package version", + "Environment": { + "Variables": { + "FUNCTION_NAME": { + "Ref": "ConstructHubSourcesNpmJsStageAndNotify591C0CFA", + }, + "REGISTRY_URL": "https://registry.npmjs.org", + }, + }, + "Handler": "index.handler", + "MemorySize": 1024, + "Role": { + "Fn::GetAtt": [ + "ConstructHubSourcesReStagePackageVersionServiceRoleCDF009BA", + "Arn", + ], + }, + "Runtime": "nodejs16.x", + "Timeout": 10, + }, + "Type": "AWS::Lambda::Function", + }, + "ConstructHubSourcesReStagePackageVersionServiceRoleCDF009BA": { + "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", + }, + "ConstructHubSourcesReStagePackageVersionServiceRoleDefaultPolicyB4F9CE40": { + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "ConstructHubSourcesNpmJsStageAndNotify591C0CFA", + "Arn", + ], + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "ConstructHubSourcesNpmJsStageAndNotify591C0CFA", + "Arn", + ], + }, + ":*", + ], + ], + }, + ], + }, + ], + "Version": "2012-10-17", + }, + "PolicyName": "ConstructHubSourcesReStagePackageVersionServiceRoleDefaultPolicyB4F9CE40", + "Roles": [ + { + "Ref": "ConstructHubSourcesReStagePackageVersionServiceRoleCDF009BA", + }, + ], + }, + "Type": "AWS::IAM::Policy", + }, "ConstructHubSourcesStagerDLQ80BD2600": { "DeletionPolicy": "Delete", "Properties": { @@ -11852,7 +11962,7 @@ Direct link to Lambda function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "12fe4ed23cf4578a6124606619732fdb95c057f6534914d6b5e5acd5d8f5746c.zip", + "S3Key": "17db8db1b6f0439725b30ff350a32982333308633df6021e5a61c3a1e9d05a94.zip", }, "Description": { "Fn::Join": [ @@ -15050,7 +15160,7 @@ Direct link to Lambda function: /lambda/home#/functions/", "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "ca6dec3b11e40d596e94afc489bca73434ca292e9f46fe7222856e9fd1efce12.zip", + "S3Key": "3622539c21b9c1547c6c5e7391cb255265975850839e5b95919ad0a34491f650.zip", }, "Description": { "Fn::Join": [ @@ -16311,7 +16421,7 @@ function handler(event) { "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "fcb8a24440ef11d8871140ba517fb07b8754c310e6718286bcd95b42f1b23cc7.zip", + "S3Key": "83a6153078d48ae6022f6f083692f3b9227a563ab7bfb40baf9f01c3c49d512b.zip", }, "Description": "[ConstructHub/MissingDocumentationWidget] Is a custom CloudWatch widget handler", "Environment": { diff --git a/src/__tests__/package-sources/__snapshots__/code-artifact.test.ts.snap b/src/__tests__/package-sources/__snapshots__/code-artifact.test.ts.snap index d39f19679..967a30dbf 100644 --- a/src/__tests__/package-sources/__snapshots__/code-artifact.test.ts.snap +++ b/src/__tests__/package-sources/__snapshots__/code-artifact.test.ts.snap @@ -243,7 +243,7 @@ exports[`default configuration 1`] = ` "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "c4f21bcdb8e720b3f91de696ba1b21f96e03b5d4719b0b154b8b6d70f4ca056c.zip", + "S3Key": "390ded42eb7e6fdeefb771eec6ad092a1e11400d31938806e55c559f3c497e66.zip", }, "DeadLetterConfig": { "TargetArn": { @@ -727,7 +727,7 @@ exports[`user-provided staging bucket 1`] = ` "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "c4f21bcdb8e720b3f91de696ba1b21f96e03b5d4719b0b154b8b6d70f4ca056c.zip", + "S3Key": "390ded42eb7e6fdeefb771eec6ad092a1e11400d31938806e55c559f3c497e66.zip", }, "DeadLetterConfig": { "TargetArn": { diff --git a/src/__tests__/package-sources/npmjs/re-stage-package-version.lambda.test.ts b/src/__tests__/package-sources/npmjs/re-stage-package-version.lambda.test.ts new file mode 100644 index 000000000..b30264c3a --- /dev/null +++ b/src/__tests__/package-sources/npmjs/re-stage-package-version.lambda.test.ts @@ -0,0 +1,74 @@ +import { InvokeCommand, LambdaClient } from '@aws-sdk/client-lambda'; +import { mockClient } from 'aws-sdk-client-mock'; +import 'aws-sdk-client-mock-jest'; +import { handler } from '../../../package-sources/npmjs/re-stage-package-version.lambda'; + +const MOCK_FUNCTION_NAME = 'foo'; +const MOCK_REGISTRY_URL = 'https://registry.npmjs.org'; + +const mockLambda = mockClient(LambdaClient); +const mockFetch = jest.spyOn(global, 'fetch'); + +beforeEach(() => { + mockLambda.reset(); + process.env.FUNCTION_NAME = MOCK_FUNCTION_NAME; + process.env.REGISTRY_URL = MOCK_REGISTRY_URL; +}); + +afterEach(() => { + process.env.FUNCTION_NAME = undefined; + process.env.REGISTRY_URL = undefined; +}); + +test('happy path', async () => { + const event = { + name: 'construct-hub-probe', + version: '0.0.8000', + }; + + const mockLastModified = '2024-10-22T11:40:59.265Z'; + const mockShaSum = 'abc123'; + const mockTarball = + 'https://registry.npmjs.org/construct-hub-probe/-/construct-hub-probe-0.0.8000.tgz'; + const mockResponse = { + name: 'construct-hub-probe', + version: '0.0.8000', + dist: { + shasum: mockShaSum, + tarball: mockTarball, + }, + }; + + // registry response + mockFetch.mockImplementationOnce( + jest.fn(() => + Promise.resolve( + new Response(JSON.stringify(mockResponse), { + status: 200, + headers: { 'Last-Modified': mockLastModified }, + }) + ) + ) + ); + + await expect(handler(event)).resolves.toBe(undefined); + + expect(mockFetch).toHaveBeenCalledTimes(1); + expect(mockFetch).toHaveBeenCalledWith( + `${MOCK_REGISTRY_URL}/${event.name}/${event.version}` + ); + expect(mockLambda).toHaveReceivedCommandTimes(InvokeCommand, 1); + expect(mockLambda).toHaveReceivedCommandWith(InvokeCommand, { + FunctionName: MOCK_FUNCTION_NAME, + InvocationType: 'Event', + Payload: Buffer.from( + JSON.stringify({ + integrity: mockShaSum, + modified: mockLastModified, + name: event.name, + tarballUrl: mockTarball, + version: event.version, + }) + ), + }); +}); diff --git a/src/backend/catalog-builder/catalog-builder.lambda.ts b/src/backend/catalog-builder/catalog-builder.lambda.ts index c5a101400..5efb72e8c 100644 --- a/src/backend/catalog-builder/catalog-builder.lambda.ts +++ b/src/backend/catalog-builder/catalog-builder.lambda.ts @@ -312,7 +312,7 @@ async function appendPackage( console.log(`Registering ${packageName}@${version}`); - // Donwload the tarball to inspect the `package.json` data therein. + // Download the tarball to inspect the `package.json` data therein. const pkg = await S3_CLIENT.send( new GetObjectCommand({ Bucket: bucketName, Key: pkgKey }) ); diff --git a/src/backend/shared/aws.lambda-shared.ts b/src/backend/shared/aws.lambda-shared.ts index 8a66adf33..adad220c8 100644 --- a/src/backend/shared/aws.lambda-shared.ts +++ b/src/backend/shared/aws.lambda-shared.ts @@ -8,22 +8,25 @@ import { } from '@aws-sdk/client-s3'; import { SFNClient } from '@aws-sdk/client-sfn'; import { SQSClient } from '@aws-sdk/client-sqs'; +import { NodeJsClient } from '@smithy/types'; import * as AWSXRay from 'aws-xray-sdk-core'; // Do nothing if there is no XRay trace context AWSXRay.setContextMissingStrategy(() => {}); -export const S3_CLIENT: S3Client = AWSXRay.captureAWSv3Client(new S3Client({})); +export const S3_CLIENT: NodeJsClient = AWSXRay.captureAWSv3Client( + new S3Client({}) +); export const LAMBDA_CLIENT: LambdaClient = AWSXRay.captureAWSv3Client( new LambdaClient({}) ); -export const ECS_CLIENT: ECSClient = AWSXRay.captureAWSv3Client( +export const ECS_CLIENT: NodeJsClient = AWSXRay.captureAWSv3Client( new ECSClient({}) ); export const SQS_CLIENT: SQSClient = AWSXRay.captureAWSv3Client( new SQSClient() ); -export const SFN_CLIENT: SFNClient = AWSXRay.captureAWSv3Client( +export const SFN_CLIENT: NodeJsClient = AWSXRay.captureAWSv3Client( new SFNClient() ); diff --git a/src/backend/shared/compress-content.lambda-shared.ts b/src/backend/shared/compress-content.lambda-shared.ts index 0399da6f1..be2e417b5 100644 --- a/src/backend/shared/compress-content.lambda-shared.ts +++ b/src/backend/shared/compress-content.lambda-shared.ts @@ -1,6 +1,6 @@ import { text } from 'node:stream/consumers'; import { createGunzip, gzipSync } from 'zlib'; -import type { StreamingBlobPayloadOutputTypes } from '@smithy/types'; +import type { NodeJsRuntimeStreamingBlobPayloadOutputTypes } from '@smithy/types'; const MINIMUM_SIZE_TO_COMPRESS = 1_024; @@ -33,7 +33,7 @@ export function compressContent(buffer: Buffer): CompressContentResult { * @returns the stream data as a string, decompressed if necessary */ export async function decompressContent( - data: StreamingBlobPayloadOutputTypes, + data: NodeJsRuntimeStreamingBlobPayloadOutputTypes, encoding?: string ): Promise { if (encoding === 'gzip') { diff --git a/src/backend/transliterator/transliterator.ecstask.ts b/src/backend/transliterator/transliterator.ecstask.ts index 047dba4d2..27216369b 100644 --- a/src/backend/transliterator/transliterator.ecstask.ts +++ b/src/backend/transliterator/transliterator.ecstask.ts @@ -13,6 +13,7 @@ import { } from '@aws-sdk/client-s3'; import { Assembly } from '@jsii/spec'; import { StreamingBlobPayloadInputTypes } from '@smithy/types'; +import type { NodeJsClient } from '@smithy/types'; import { AdaptiveRetryStrategy } from '@smithy/util-retry'; import { Sema } from 'async-sema'; import { metricScope, Unit } from 'aws-embedded-metrics'; @@ -46,7 +47,7 @@ const S3_CLIENT = new S3Client({ retryStrategy: new AdaptiveRetryStrategy( async () => MAX_RETRIES_S3_REQUESTS /* maxAttempts */ ), -}); +}) as NodeJsClient; /** * This function receives an S3 event, and for each record, proceeds to download diff --git a/src/package-sources/npmjs.ts b/src/package-sources/npmjs.ts index 9f09fa1be..eb19bad95 100644 --- a/src/package-sources/npmjs.ts +++ b/src/package-sources/npmjs.ts @@ -37,6 +37,7 @@ import type { } from '../package-source'; import { RUNBOOK_URL } from '../runbook-url'; import { S3StorageFactory } from '../s3/storage'; +import { ReStagePackageVersion } from './npmjs/re-stage-package-version'; /** * The periodicity at which the NpmJs follower will run. This MUST be a valid @@ -176,6 +177,17 @@ export class NpmJs implements IPackageSource { licenseList.grantRead(follower); stager.grantInvoke(follower); + const restager = new ReStagePackageVersion(scope, 'ReStagePackageVersion', { + description: `Manually re-stage a package version`, + environment: { + FUNCTION_NAME: stager.functionName, + REGISTRY_URL: 'https://registry.npmjs.org', + }, + memorySize: 1024, + timeout: Duration.seconds(10), + }); + stager.grantInvoke(restager); + const rule = new Rule(scope, 'NpmJs/Schedule', { description: `${scope.node.path}/NpmJs/Schedule`, schedule: Schedule.rate(FOLLOWER_RUN_RATE), diff --git a/src/package-sources/npmjs/npm-js-follower.lambda.ts b/src/package-sources/npmjs/npm-js-follower.lambda.ts index 5ccd81ea5..27a09ff53 100644 --- a/src/package-sources/npmjs/npm-js-follower.lambda.ts +++ b/src/package-sources/npmjs/npm-js-follower.lambda.ts @@ -548,7 +548,7 @@ function getRelevantVersionInfos( * The scheme of a package version in the update. Includes the package.json keys, as well as some additional npm metadata * @see https://github.com/npm/registry/blob/master/docs/REGISTRY-API.md#version */ -interface VersionInfo { +export interface VersionInfo { readonly dependencies?: { readonly [name: string]: string }; readonly devDependencies?: { readonly [name: string]: string }; readonly peerDependencies?: { readonly [name: string]: string }; diff --git a/src/package-sources/npmjs/re-stage-package-version.lambda.ts b/src/package-sources/npmjs/re-stage-package-version.lambda.ts new file mode 100644 index 000000000..d2c943c41 --- /dev/null +++ b/src/package-sources/npmjs/re-stage-package-version.lambda.ts @@ -0,0 +1,47 @@ +import { InvokeCommand } from '@aws-sdk/client-lambda'; +import { VersionInfo } from './npm-js-follower.lambda'; +import { PackageVersion } from './stage-and-notify.lambda'; +import { LAMBDA_CLIENT } from '../../backend/shared/aws.lambda-shared'; +import { requireEnv } from '../../backend/shared/env.lambda-shared'; + +/** + * This function is invoked manually with a `IngestPackageVersion` object. + * It allows the manual reprocessing of a package version that failed to ingest. + * + * The payload is used to query information about the package version from npmjs. + * It will then call the staging function with the required details, which than takes care of all the usual processing. + */ +export async function handler(event: IngestPackageVersion): Promise { + console.log('Event', JSON.stringify(event, null, 2)); + const stagingFunction = requireEnv('FUNCTION_NAME'); + const registryUrl = requireEnv('REGISTRY_URL'); + + const res = await fetch(`${registryUrl}/${event.name}/${event.version}`); + + const modified = new Date(res.headers.get('Last-Modified') ?? Date.now()); + const infos: VersionInfo = (await res.json()) as any; + console.log('Package', JSON.stringify(infos, null, 2)); + + const invokeArgs: PackageVersion = { + integrity: infos.dist.shasum, + modified: modified.toISOString(), + name: infos.name, + tarballUrl: infos.dist.tarball, + version: infos.version, + }; + + // "Fire-and-forget" invocation here. + console.log(`Sending ${invokeArgs.tarballUrl} for staging`); + await LAMBDA_CLIENT.send( + new InvokeCommand({ + FunctionName: stagingFunction, + InvocationType: 'Event', + Payload: Buffer.from(JSON.stringify(invokeArgs)), + }) + ); +} + +interface IngestPackageVersion { + readonly name: string; + readonly version: string; +} diff --git a/src/package-sources/npmjs/re-stage-package-version.ts b/src/package-sources/npmjs/re-stage-package-version.ts new file mode 100644 index 000000000..00c3353da --- /dev/null +++ b/src/package-sources/npmjs/re-stage-package-version.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 ReStagePackageVersionProps extends lambda.FunctionOptions { +} + +export class ReStagePackageVersion extends lambda.Function { + constructor(scope: Construct, id: string, props?: ReStagePackageVersionProps) { + super(scope, id, { + description: 'package-sources/npmjs/re-stage-package-version.lambda.ts', + ...props, + architecture: lambda.Architecture.ARM_64, + runtime: lambda.Runtime.NODEJS_16_X, + handler: 'index.handler', + code: lambda.Code.fromAsset(path.join(__dirname, '/re-stage-package-version.lambda.bundle')), + }); + } +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 9142a4de7..357299ebc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3481,10 +3481,12 @@ dependencies: undici-types "~6.19.2" -"@types/node@^16": - version "16.18.114" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.18.114.tgz#794d93059fd94a85503484e111aa820b3ebb4d4b" - integrity sha512-7oAtnxrgkMNzyzT443UDWwzkmYew81F1ZSPm3/lsITJfW/WludaSOpegTvUG+UdapcbrtWOtY/E4LyTkhPGJ5Q== +"@types/node@^18": + version "18.19.58" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.19.58.tgz#260cda6182b24d788afe3a27a7be65c457e67319" + integrity sha512-2ryJttbOAWCYuZMdk4rmZZ6oqE+GSL5LxbaTVe4PCs0FUrHObZZAQL4ihMw9/cH1Pn8lSQ9TXVhsM4LrnfZ0aA== + dependencies: + undici-types "~5.26.4" "@types/normalize-package-data@^2.4.0": version "2.4.4" @@ -9586,6 +9588,11 @@ unbox-primitive@^1.0.2: has-symbols "^1.0.3" which-boxed-primitive "^1.0.2" +undici-types@~5.26.4: + version "5.26.5" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" + integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== + undici-types@~6.19.2: version "6.19.8" resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.19.8.tgz#35111c9d1437ab83a7cdc0abae2f26d88eda0a02"