BucketPolicyProps
- class aws_cdk.aws_s3.BucketPolicyProps(*, bucket, document=None, removal_policy=None)
Bases:
object
- Parameters:
bucket (
IBucket
) – The Amazon S3 bucket that the policy applies to.document (
Optional
[PolicyDocument
]) – Policy document to apply to the bucket. Default: - A new empty PolicyDocument will be created.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 as cdk from aws_cdk import aws_iam as iam from aws_cdk import aws_s3 as s3 # bucket: s3.Bucket # policy_document: iam.PolicyDocument bucket_policy_props = s3.BucketPolicyProps( bucket=bucket, # the properties below are optional document=policy_document, removal_policy=cdk.RemovalPolicy.DESTROY )
Attributes
- bucket
The Amazon S3 bucket that the policy applies to.
- document
Policy document to apply to the bucket.
- Default:
A new empty PolicyDocument will be created.
- removal_policy
Policy to apply when the policy is removed from this stack.
- Default:
RemovalPolicy.DESTROY.