Skip to content

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

Description

@pasiorovuo

This seems to be a regression, earlier discussed in here: #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 79b1f00#diff-003665623877ad886ae62d0768d144a09c5f4bcc54ca40cb3bd3c194f4337e51, and scans fail again.

Activity

  1. hiSandog commented on Jul 2, 2026

    @hiSandog

    This regression would be easier to trace if the failing serviceName value were logged before constructing the AWS SDK client. AWS[serviceName] is not a constructor usually means the collector derived a service key that is absent from the SDK export map, or the import shape changed. A minimal debug log with provider, region, collector name, and computed serviceName would point to whether this is a new AWS service, a typo/casing issue, or a dependency upgrade mismatch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions