I have an S3 bucket with versioning enabled. Whenever i make a deleteObject call using the aws sdk for javascript it will mark the object with a delete marker . As specified in the documentation , for deleting s3 object permanently, the "VersionId" should be specified.
From S3 documentation for making the delete call:
var params = {
Bucket: 'STRING_VALUE', /* required */
Key: 'STRING_VALUE', /* required */
BypassGovernanceRetention: true || false,
MFA: 'STRING_VALUE',
RequestPayer: requester,
VersionId: 'STRING_VALUE'
};
s3.deleteObject(params, function(err, data) {
i.f (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
I want to (permanently)delete the latest version of the object. I know that, in order to do so:
The above approach requires 2 API calls (first for fetching the versions and second for deleting the object version) I have gone through several solutions and they had the same approach as specified above.
I'm trying to reduce the API calls to one.
Nope. You'll need to make the two calls.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.