Closed peteroneilljr closed 2 years ago
ahh then it might be broken then. This is what I'm seeing in CloudWatch
Exception caught sequence item 0: expected str instance, dict found
Traceback (most recent call last):
File "/var/task/cloudformation_cli_python_lib/hook.py", line 273, in __call__
raise error
File "/var/task/cloudformation_cli_python_lib/hook.py", line 262, in __call__
caller_sess, request, invocation_point, callback, type_configuration
File "/var/task/cloudformation_cli_python_lib/hook.py", line 100, in _invoke_handler
return handler(session, request, callback_context, type_configuration)
File "/var/task/styra_opa_hook/handlers.py", line 123, in pre_handler
return opa_query(request, session, type_configuration, action)
File "/var/task/styra_opa_hook/handlers.py", line 93, in opa_query
message = " | ".join(body["violations"])
TypeError: sequence item 0: expected str instance, dict found
Alright :) Looks like we do log the error then, even if somewhat obtuse. Since the error message is the same as reported here, let's close this one in favor of that.
Right now when the hook fails all we see is:
The following hook(s) failed: [Styra::opa::Hook]
is it possible to populate the error messages generated in DAS back to CloudWatch and CloudFormation?