Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
const AWS = require('aws-sdk');
const s3 = new AWS.S3({'region':'ap-southeast-1'});
AWS.config.update({region: 'ap-southeast-1'});
exports.handler = async (event) => {
const deletes = await s3.deleteObject(
{
Bucket:'test-bucketxxx', // 存在しないバケット
Key:'test/sample.json'
}).promise().catch(err=>{
throw new Error(err) // catch句に入る
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment