BucketPolicyProps

class aws_cdk.aws_s3.BucketPolicyProps(*, bucket, removal_policy=None)

Bases: object

Parameters:
  • bucket (IBucket) – The Amazon S3 bucket that the policy applies to.

  • removal_policy (Optional[RemovalPolicy]) – Policy to apply when the policy is removed from this stack. Default: - RemovalPolicy.DESTROY.

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_s3 as s3
import aws_cdk.core as cdk

# bucket: s3.Bucket

bucket_policy_props = s3.BucketPolicyProps(
    bucket=bucket,

    # the properties below are optional
    removal_policy=cdk.RemovalPolicy.DESTROY
)

Attributes

bucket

The Amazon S3 bucket that the policy applies to.

removal_policy

Policy to apply when the policy is removed from this stack.

Default:
  • RemovalPolicy.DESTROY.