1. terminal (TTY) is not attached so we are unable to get a confirmation from the user
Scenario: The above error is displayed when CDK deploy is executed using Cygwin on Windows. Currently, there is no suitable solution, but the workaround is run by executing the same command through the CMD command line of Windows.
2. Uploaded file must be a non-empty zip
Root cause: The lambda must be returned in JSON format. My initial format is plain text (headers: {” content-type “: “text/plain”}).
error
exports.handler = async function(event) {
console.log("request:", JSON.stringify(event, undefined, 2));
return {
statusCode: 200,
headers: { "Content-Type": "text/plain" },
body: `Hello, CDK! You've hit ${event.path}\n`
};
};
Copy the code
correct
exports.handler = async function(event) {
console.log("request:", JSON.stringify(event, undefined, 2));
return {
statusCode: 200,
headers: { "Content-Type": "text/json" },
body: `Hello, CDK! You've hit ${event.path}\n`
};
};
Copy the code