aws_ddk_core.resources.S3Factory¶
- class aws_ddk_core.resources.S3Factory¶
Class factory to create and configure Simple Storage Service DDK resources, including Buckets.
- __init__()¶
Methods
- static bucket(scope: constructs.Construct, id: str, environment_id: str, bucket_name: Optional[str] = None, versioned: Optional[bool] = None, access_control: Optional[aws_cdk.aws_s3.BucketAccessControl] = None, block_public_access: Optional[aws_cdk.aws_s3.BlockPublicAccess] = None, removal_policy: Optional[aws_cdk.RemovalPolicy] = None, encryption: Optional[aws_cdk.aws_s3.BucketEncryption] = None, enforce_ssl: Optional[bool] = None, event_bridge_enabled: Optional[bool] = None, **bucket_props: Any) aws_cdk.aws_s3.IBucket ¶
Create and configure S3 bucket.
This construct allows to configure parameters of the bucket using ddk.json configuration file depending on the environment_id in which the function is used. Supported parameters are: versioned,`auto_delete_objects`, enforce_ssl, access_control, and removal_policy.
- Parameters
scope (Construct) – Scope within which this construct is defined
id (str) – Identifier of the bucket
environment_id (str) – Identifier of the environment
bucket_name (Optional[str]) – The name of the bucket
versioned (Optional[bool]) – Whether this bucket should have versioning turned on or not. True by default.
access_control (Optional[BucketAccessControl]) – Specifies a canned ACL that grants predefined permissions to the bucket aws_cdk.aws_s3.BucketAccessControl.BUCKET_OWNER_FULL_CONTROL by default.
block_public_access (Optional[BlockPublicAccess]) – The block public access configuration of this bucket. aws_cdk.aws_s3.BlockPublicAccess.BLOCK_ALL by default.
removal_policy (Optional[RemovalPolicy]) – Policy to apply when the bucket is removed from this stack. aws_cdk.RemovalPolicy.RETAIN by default.
encryption (Optional[BucketEncryption]) – The kind of server-side encryption to apply to this bucket. aws_cdk.aws_s3.BucketEncryption.S3_MANAGED by default.
enforce_ssl (Optional[bool]) – Enforces SSL for requests. True by default.
event_bridge_enabled (Optional[bool]) – Whether this bucket should send notifications to Amazon EventBridge or not. False by default.
bucket_props (Any) – Additional bucket properties. For complete list of properties refer to CDK Documentation - S3 Bucket: https://docs.aws.amazon.com/cdk/api/v2/python/aws_cdk.aws_s3/Bucket.html
- Returns
bucket – S3 bucket
- Return type
aws_cdk.aws_s3.Bucket