aquasecurity / aquasecurity/cloudsploit

[AWS] Scan fails with "Error [TypeError]: AWS[serviceName] is not a constructor"

Open
#2,176 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
3.8k
Forks
751
Avg merge
11d 9h
Merged PRs (30d)
3

Description

This seems to be a regression, earlier discussed in here: https://github.com/aquasecurity/cloudsploit/issues/2085.

The error is:

```
/var/scan/node_modules/aws-sdk/lib/request.js:31
throw err;
^

Error [TypeError]: AWS[serviceName] is not a constructor
at /var/scan/cloudsploit/collectors/aws/collector.js:139:119
at /var/scan/node_modules/async/dist/async.js:3113:16
at replenish (/var/scan/node_modules/async/dist/async.js:1014:17)
at /var/scan/node_modules/async/dist/async.js:1019:9
at Object.eachLimit$1 (/var/scan/node_modules/async/dist/async.js:3199:24)
at /var/scan/cloudsploit/collectors/aws/collector.js:109:23
at replenish (/var/scan/node_modules/async/dist/async.js:1014:17)
at /var/scan/node_modules/async/dist/async.js:1019:9
at Object.eachOfLimit (/var/scan/node_modules/async/dist/async.js:1044:24)
at /var/scan/cloudsploit/collectors/aws/collector.js:88:19 {
code: 'TypeError',
time: 2025-12-01T12:28:30.339Z
}
```

It seems as if the changes related to CodeStar plugins made in https://github.com/aquasecurity/cloudsploit/pull/2130/commits were rolled back in https://github.com/aquasecurity/cloudsploit/commit/79b1f00d3d538bb84773d2069522840bd5c5b209#diff-003665623877ad886ae62d0768d144a09c5f4bcc54ca40cb3bd3c194f4337e51, and scans fail again.

Contributor guide

Open the contributing guide

Research direction

Start at collectors/aws/collector.js around lines 88, 109, and 139, then compare the CodeStar changes in PR 2130 with the rollback commit and issue 2085. Reproduce the AWS scan failure and confirm that scans complete without the AWS[serviceName] constructor error.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, javascript
Domain
cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.