40 lines
1.5 KiB
TypeScript
40 lines
1.5 KiB
TypeScript
import type { IConstruct } from 'constructs';
|
|
import { Mixin } from '../../../core/lib/mixins';
|
|
import { BlockPublicAccess } from '../bucket';
|
|
import { CfnBucket } from '../s3.generated';
|
|
/**
|
|
* S3-specific Mixin to automatically delete all objects from a bucket
|
|
* when the bucket is removed from the stack or when the stack is deleted.
|
|
*
|
|
* Requires the `removalPolicy` to be set to `RemovalPolicy.DESTROY`.
|
|
*
|
|
* Apply this mixin to a bucket will add `s3:PutBucketPolicy` to the
|
|
* bucket policy. This is because during bucket deletion, the custom resource provider
|
|
* needs to update the bucket policy by adding a deny policy for `s3:PutObject` to
|
|
* prevent race conditions with external bucket writers.
|
|
*/
|
|
export declare class BucketAutoDeleteObjects extends Mixin {
|
|
private static AUTO_DELETE_OBJECTS_RESOURCE_TYPE;
|
|
private static AUTO_DELETE_OBJECTS_TAG;
|
|
supports(construct: IConstruct): construct is CfnBucket;
|
|
applyTo(construct: IConstruct): void;
|
|
}
|
|
/**
|
|
* S3-specific mixin for enabling versioning.
|
|
*/
|
|
export declare class BucketVersioning extends Mixin {
|
|
private readonly enabled;
|
|
constructor(enabled?: boolean);
|
|
supports(construct: IConstruct): construct is CfnBucket;
|
|
applyTo(construct: IConstruct): void;
|
|
}
|
|
/**
|
|
* S3-specific mixin for blocking public-access.
|
|
*/
|
|
export declare class BucketBlockPublicAccess extends Mixin {
|
|
private readonly configOptions;
|
|
constructor(publicAccessConfig?: BlockPublicAccess);
|
|
supports(construct: IConstruct): construct is CfnBucket;
|
|
applyTo(construct: IConstruct): void;
|
|
}
|