in source/solution-helper.py [0:0]
def send(event, context, responseStatus, responseData, physicalResourceId=None, noEcho=False):
try:
responseUrl = event.get('ResponseURL')
responseBody = {
"Status":responseStatus,
"Reason": "See the details in CloudWatch Log Stream: " + context.log_stream_name,
"PhysicalResourceId": physicalResourceId or context.log_stream_name,
"StackId": event.get('StackId'),
"RequestId":event.get('RequestId'),
"LogicalResourceId": event.get('LogicalResourceId'),
"NoEcho": noEcho,
"Data": responseData
}
data = bytes(json.dumps(responseBody), 'utf-8')
headers = {
'content-type' : '',
'content-length' : str(len(data))
}
req = urllib.request.Request(url=responseUrl, data=data, method='PUT', headers=headers)
with urllib.request.urlopen(req) as f:
print(f"CFN Status: {f.status}")
except Exception as e:
raise(e)