async function sendResponse()

in source/custom-resources/check-stackset-status.js [105:124]


async function sendResponse(event, logStreamName, response) {
    const responseBody = JSON.stringify({
        Status: response.status,
        Reason: `See the details in CloudWatch Log Stream: ${logStreamName}`,
        PhysicalResourceId: event.LogicalResourceId,
        StackId: event.StackId,
        RequestId: event.RequestId,
        LogicalResourceId: event.LogicalResourceId,
        Data: response.data,
    });

    const config = {
        headers: {
            'Content-Type': '',
            'Content-Length': responseBody.length
        }
    };

    await axios.put(event.ResponseURL, responseBody, config);
}