Skip to content

[BUG][OTHER] Cannot find module 'aws-sdk' on custom config rule lambdas #1206

Open
@SEAFork1

Description

@SEAFork1

Bug reports which fail to provide the required information will be closed without action.

Required Basic Info

  • Accelerator Version: 1.5.8-d
  • Install Type: Upgrade
  • Upgrade from version: 1.5.7-b
  • Which State did the Main State Machine Fail in: N/A

Describe the bug
The Instance Profile custom config rule bundled with ASEA fails to evaluate, on closer inspection the backend Lambda function has the following error:

{
"errorType": "Runtime.ImportModuleError",
"errorMessage": "Error: Cannot find module 'aws-sdk'\nRequire stack:\n- /var/task/index.js\n- /var/runtime/index.mjs",
"trace": [
"Runtime.ImportModuleError: Error: Cannot find module 'aws-sdk'",
"Require stack:",
"- /var/task/index.js",
"- /var/runtime/index.mjs",
" at _loadUserApp (file:///var/runtime/index.mjs:1087:17)",
" at async UserFunction.js.module.exports.load (file:///var/runtime/index.mjs:1119:21)",
" at async start (file:///var/runtime/index.mjs:1282:23)",
" at async file:///var/runtime/index.mjs:1288:1"
]
}

The result of this is the instance profile config rule fails to evaluate and does not attach an instance profile to an EC2 instance.

Steps To Reproduce

  1. Create an EC2 instance without an instance profile attached

Expected behavior
The config rule should evaluate the EC2 instance as non-compliant and then kick off auto-remediation,

Metadata

Metadata

Assignees

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