class BucketPolicy (construct)
Applies an Amazon S3 bucket policy to an Amazon S3 bucket.
new BucketPolicy(scope: Construct, id: string, props: BucketPolicyProps)
|bucket||The Amazon S3 bucket that the policy applies to.|
|removal||Policy to apply when the policy is removed from this stack.|
The Amazon S3 bucket that the policy applies to.
(optional, default: RemovalPolicy.DESTROY.)
Policy to apply when the policy is removed from this stack.
|document||A policy document containing permissions to add to the specified bucket.|
|env||The environment this resource belongs to.|
|node||The construct tree node associated with this construct.|
|stack||The stack in which this resource is defined.|
A policy document containing permissions to add to the specified bucket.
For more information, see Access Policy Language Overview in the Amazon Simple Storage Service Developer Guide.
The environment this resource belongs to.
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
The construct tree node associated with this construct.
The stack in which this resource is defined.
|apply||Sets the removal policy for the BucketPolicy.|
|to||Returns a string representation of this construct.|
public applyRemovalPolicy(removalPolicy: RemovalPolicy): void
Removal— the RemovalPolicy to set.
Sets the removal policy for the BucketPolicy.
public toString(): string
Returns a string representation of this construct.