You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
while the lambda I am running, getting below error:
Test Event Name
(unsaved) test event
Response
{
"errorMessage": "name 'event' is not defined",
"errorType": "NameError",
"requestId": "",
"stackTrace": [
" File "/var/lang/lib/python3.11/importlib/init.py", line 126, in import_module\n return _bootstrap._gcd_import(name[level:], package, level)\n",
" File "", line 1204, in _gcd_import\n",
" File "", line 1176, in _find_and_load\n",
" File "", line 1147, in _find_and_load_unlocked\n",
" File "", line 690, in _load_unlocked\n",
" File "", line 940, in exec_module\n",
" File "", line 241, in _call_with_frames_removed\n",
" File "/var/task/custodian_policy.py", line 7, in \n event_name = event['detail']['eventName']\n"
]
}
Function Logs
[ERROR] NameError: name 'event' is not defined
Traceback (most recent call last):
File "/var/lang/lib/python3.11/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1204, in _gcd_import
File "", line 1176, in _find_and_load
File "", line 1147, in _find_and_load_unlocked
File "", line 690, in _load_unlocked
File "", line 940, in exec_module
File "", line 241, in _call_with_frames_removed
File "/var/task/custodian_policy.py", line 7, in
event_name = event['detail']['eventName']INIT_REPORT Init Duration: 561.46 ms Phase: init Status: error Error Type: Runtime.ExitError
[ERROR] NameError: name 'event' is not defined
Traceback (most recent call last):
File "/var/lang/lib/python3.11/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1204, in _gcd_import
File "", line 1176, in _find_and_load
File "", line 1147, in _find_and_load_unlocked
File "", line 690, in _load_unlocked
File "", line 940, in exec_module
File "", line 241, in _call_with_frames_removed
File "/var/task/custodian_policy.py", line 7, in
event_name = event['detail']['eventName']INIT_REPORT Init Duration: 769.42 ms Phase: invoke Status: error Error Type: Runtime.ExitError
START RequestId: 32488f0b-ec83-4552-a45e-c238f7060c4b Version: $LATEST
Unknown application error occurred
Runtime.Unknown
END RequestId: 32488f0b-ec83-4552-a45e-c238f7060c4b
REPORT RequestId: 32488f0b-ec83-4552-a45e-c238f7060c4b Duration: 784.36 ms Billed Duration: 785 ms Memory Size: 1024 MB Max Memory Used: 34 MB
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am using below policy to trigger a lambda on behalf of cloud trail event:
`policies:
resource: ebs
mode:
type: cloudtrail
role: CustodianLamdaRole
events:
- source: 'ec2.amazonaws.com'
event: 'AttachVolume'
ids: 'requestParameters.volumeId'
filters:
actions:
op: delete
days: 30`
while the lambda I am running, getting below error:
Test Event Name
(unsaved) test event
Response
{
"errorMessage": "name 'event' is not defined",
"errorType": "NameError",
"requestId": "",
"stackTrace": [
" File "/var/lang/lib/python3.11/importlib/init.py", line 126, in import_module\n return _bootstrap._gcd_import(name[level:], package, level)\n",
" File "", line 1204, in _gcd_import\n",
" File "", line 1176, in _find_and_load\n",
" File "", line 1147, in _find_and_load_unlocked\n",
" File "", line 690, in _load_unlocked\n",
" File "", line 940, in exec_module\n",
" File "", line 241, in _call_with_frames_removed\n",
" File "/var/task/custodian_policy.py", line 7, in \n event_name = event['detail']['eventName']\n"
]
}
Function Logs
[ERROR] NameError: name 'event' is not defined
Traceback (most recent call last):
File "/var/lang/lib/python3.11/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1204, in _gcd_import
File "", line 1176, in _find_and_load
File "", line 1147, in _find_and_load_unlocked
File "", line 690, in _load_unlocked
File "", line 940, in exec_module
File "", line 241, in _call_with_frames_removed
File "/var/task/custodian_policy.py", line 7, in
event_name = event['detail']['eventName']INIT_REPORT Init Duration: 561.46 ms Phase: init Status: error Error Type: Runtime.ExitError
[ERROR] NameError: name 'event' is not defined
Traceback (most recent call last):
File "/var/lang/lib/python3.11/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1204, in _gcd_import
File "", line 1176, in _find_and_load
File "", line 1147, in _find_and_load_unlocked
File "", line 690, in _load_unlocked
File "", line 940, in exec_module
File "", line 241, in _call_with_frames_removed
File "/var/task/custodian_policy.py", line 7, in
event_name = event['detail']['eventName']INIT_REPORT Init Duration: 769.42 ms Phase: invoke Status: error Error Type: Runtime.ExitError
START RequestId: 32488f0b-ec83-4552-a45e-c238f7060c4b Version: $LATEST
Unknown application error occurred
Runtime.Unknown
END RequestId: 32488f0b-ec83-4552-a45e-c238f7060c4b
REPORT RequestId: 32488f0b-ec83-4552-a45e-c238f7060c4b Duration: 784.36 ms Billed Duration: 785 ms Memory Size: 1024 MB Max Memory Used: 34 MB
Request ID
32488f0b-ec83-4552-a45e-c238f7060c4b
Any help on this please?
Beta Was this translation helpful? Give feedback.
All reactions