def cfn_response(response_status, response_data, reason, physical_resource_id, event, context):
# Put together the response to be sent to the S3 pre-signed URL
if reason:
reason = reason
else:
reason = 'See the details in CloudWatch Log Stream: ' + context.log_stream_name
responseBody = {'Status': response_status,
'Reason': 'See the details in CloudWatch Log Stream: ' + context.log_stream_name,
'PhysicalResourceId': physical_resource_id,
'StackId': event['StackId'],
'RequestId': event['RequestId'],
'LogicalResourceId': event['LogicalResourceId'],
'Data': response_data
}
print('Response Body:', responseBody)
response = requests.put(event['ResponseURL'], data=json.dumps(responseBody))
if response.status_code != 200:
print(response.text)
raise Exception('Response error received.')
return
评论列表
文章目录