Hello everyone,
I am trying to create alerts from AWS Lambda using python SDK. When I execute the script from my PC or AWS EC2, it works fine and takes ~10 seconds (business logic + fetching data from others resources) to create all the alerts in Opsgenie. Now, when I try to execute it from AWS Lambda, the `create_alert` API times out. Below is the code that works in EC2 scripts but not in AWS Lambda.
try:
body = CreateAlertPayload(
message=message,
alias=message,
responders=[{
'name': 'My Team',
'type': 'team'
}],
tags=tags,
priority=priority
)
create_response = alert_api.create_alert(create_alert_payload=body)
print(f'offline device: {device}, request: {create_response.request_id}')
except ApiException as err:
print(f"Exception when calling AlertApi->create_alert: {err}\n")
Is there something that I missed?