packages/docs/docs/lambda/deletesite.mdx
Removes a Remotion project from your S3 bucket.
Each project is located in the sites/ subdirectory of your S3 bucket. Calling this function is equivalent of deleting all files inside a subfolder of your sites/ subdirectory.
Gets all sites and deletes them.
import {AwsRegion, deleteSite, getSites} from '@remotion/lambda';
const region: AwsRegion = 'eu-central-1';
const {sites} = await getSites({
region,
});
for (const site of sites) {
await deleteSite({
bucketName: site.bucketName,
siteName: site.id,
region,
});
console.log(`Site ${site.id} deleted.`);
}
An object with the following properties:
regionstring
The AWS region where the project resides in.
bucketNamestring
The name of the S3 bucket in which your site resides in.
siteNamestring
The unique ID of the project you want to delete.
forcePathStyle?<AvailableFrom v="4.0.202" />Passes forcePathStyle to the AWS S3 client. If you don't know what this is, you probably don't need it.
A promise resolving to an object with the following property:
totalSizeInBytesnumber
The amount of space that was freed by deleting the project.