@allma/core-sdk
Version:
Core SDK with shared utilities (logging, auth, S3 utils) for building on the Allma serverless AI orchestration platform.
27 lines • 1 kB
JavaScript
export async function sendCloudFormationResponse(event, status, data) {
const responseBody = JSON.stringify({
Status: status,
Reason: `See the details in CloudWatch Log Stream: ${process.env.AWS_LAMBDA_LOG_STREAM_NAME}`,
PhysicalResourceId: event.PhysicalResourceId || `custom-resource-${Date.now()}`,
StackId: event.StackId,
RequestId: event.RequestId,
LogicalResourceId: event.LogicalResourceId,
Data: data,
});
const responseOptions = {
method: 'PUT',
body: responseBody,
headers: {
'content-type': '',
'content-length': responseBody.length.toString(),
},
};
try {
const response = await fetch(event.ResponseURL, responseOptions);
console.log('CloudFormation response status:', response.status);
}
catch (error) {
console.error('Failed to send CloudFormation response:', error);
}
}
//# sourceMappingURL=cloudformation-utils.js.map