ERROR: Missing ENDPOINTARRAY Environment Variable for the Lambda Function
santeeps opened this issue · comments
I'm getting this error when i tried to run a test run for "Health-Event-Chat-Post" lambda function.
CF template :- https://s3.amazonaws.com/aws-health-tools-assets/cloudformation-templates/shd-notifier.yml
ENDPOINTARRAY configuration is mentioned below. I tried diff options too.
sns: ["arn:aws:sns:XXXXX:AWS-Notifications"]
Error Message below.
{
"errorMessage": "ERROR: Missing ENDPOINTARRAY Environment Variable for the Lambda Function!",
"errorType": "Exception",
"stackTrace": [
" File "/var/task/index.py", line 144, in lambda_handler\n raise Exception(eMessage)\n"
]
}
Above error disappeared when i changed the ENDPOINTARRAY to below format.
"arn:aws:sns:XXXXX:AWS-Notifications"
So now i can see the event id error. Is this OK? is this becz no events in SHD?
{
"errorMessage": "ERROR: Invalid input, Event ARN Invalid!",
"errorType": "Exception",
"stackTrace": [
" File "/var/task/index.py", line 153, in lambda_handler\n raise Exception(eMessage)\n"
]
}
The Health-Event-Chat-Post
Lambda function that is part of the SHD-Notifier expects a Health ARN corresponding to a Service Health Dashboard item to be included in the event when it is invoked. If you are wanting to test the Health-Event-Chat-Post
Lambda function, you would need to construct the test event to include a eventArn
item in the json document being passed to the function. Below is an example that can be used, which uses the most recent Service Health Dashboard item (a post for Internet Connectivity Issues in the AP-SOUTH-1 Region on December 24):
{
"eventArn": "arn:aws:health:ap-south-1::event/INTERNETCONNECTIVITY/AWS_INTERNETCONNECTIVITY_OPERATIONAL_ISSUE/AWS_INTERNETCONNECTIVITY_OPERATIONAL_ISSUE_RIPRW_1640371277"
}
You may also need to adjust the EndpointArray parameter on the stack from "arn:aws:sns:XXXXX:AWS-Notifications"
to ["arn:aws:sns:XXXXX:AWS-Notifications"]
as the configuration should be a array even if it is a single element (as per the README.md).