diff --git a/platform/src/components/aws/bucket.ts b/platform/src/components/aws/bucket.ts index d0f101f66..3abd616e1 100644 --- a/platform/src/components/aws/bucket.ts +++ b/platform/src/components/aws/bucket.ts @@ -336,6 +336,30 @@ interface BucketRef { * }); * await getSignedUrl(new S3Client({}), command); * ``` + * + * #### Add object lifecycle + * + * If you want for example to delete files after 1 hour, you can write something like this: + * + * ``` + * const bucket = new sst.aws.Bucket("MyBucket"); + * // Delete files after 1 hour (using Pulumi directly) + * const lifecycleRule = new aws.s3.BucketLifecycleConfigurationV2( + * "lifecycleRule", + * { + * bucket: bucket.name, + * rules: [ + * { + * id: "delete-after-1-hour", + * status: "Enabled", + * expiration: { + * days: 1 / 24, // 1 hour in days + * }, + * }, + * ], + * }, + * ); + * ``` */ export class Bucket extends Component implements Link.Linkable { private constructorName: string;