S3 Constructs¶
S3 buckets, bucket policies, and lifecycle rules.
s3
¶
Classes¶
EnvBaseBucket
¶
EnvBaseBucket(
scope: Construct,
id: str,
env_base: EnvBase,
bucket_name: str | None,
removal_policy: RemovalPolicy = RETAIN,
account_id: str = ACCOUNT_ID,
region: str = REGION,
lifecycle_rules: Sequence[LifecycleRule] | None = None,
inventories: Sequence[Inventory] | None = None,
auto_delete_objects: bool = False,
bucket_key_enabled: bool = False,
block_public_access: BlockPublicAccess
| None = BLOCK_ALL,
public_read_access: bool = False,
**kwargs
)
Bases: Bucket, EnvBaseConstructMixins
Source code in src/aibs_informatics_cdk_lib/constructs_/s3/bucket.py
Functions¶
grant_permissions
¶
grant_permissions(
role: IRole | None,
*permissions: Literal["rw", "r", "w", "d"],
objects_key_pattern: str | None = None
)
Grant Bucket access (r,w,d) to a role, optionally specifying a key pattern
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
role
|
IRole | None
|
role to grant access to |
required |
objects_key_pattern
|
Optional[str]
|
Optional pattern to constrain access to. The pattern is applied to object keys within the bucket. You can use '*' and '?' wildcards. For more information, see the following link: https://docs.aws.amazon.com/AmazonS3/latest/userguide/security_iam_service-with-iam.html#security_iam_service-with-iam-id-based-policies-resources # noqa: E501 |
None
|
Source code in src/aibs_informatics_cdk_lib/constructs_/s3/bucket.py
Functions¶
grant_bucket_access
¶
grant_bucket_access(
bucket: Bucket | Sequence[Bucket],
role: IRole | None,
*permissions: Literal["rw", "r", "w", "d"],
objects_key_pattern: str | None = None
)
Grant Bucket access (r,w,d) to a role, optionally specifying a key pattern
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
bucket
|
Bucket | Sequence[Bucket]
|
bucket or buckets to grant access to |
required |
role
|
IRole | None
|
role to grant access to |
required |
objects_key_pattern
|
Optional[str]
|
Optional pattern to constrain access to. The pattern is applied to object keys within the bucket. You can use '' and '?' wildcards. For more information, see the following link: https://docs.aws.amazon.com/AmazonS3/latest/userguide/security_iam_service-with-iam.html#security_iam_service-with-iam-id-based-policies-resources Defaults to None (which in turn represents ''). |
None
|
Source code in src/aibs_informatics_cdk_lib/constructs_/s3/bucket.py
Modules¶
bucket
¶
Classes¶
EnvBaseBucket
¶
EnvBaseBucket(
scope: Construct,
id: str,
env_base: EnvBase,
bucket_name: str | None,
removal_policy: RemovalPolicy = RETAIN,
account_id: str = ACCOUNT_ID,
region: str = REGION,
lifecycle_rules: Sequence[LifecycleRule] | None = None,
inventories: Sequence[Inventory] | None = None,
auto_delete_objects: bool = False,
bucket_key_enabled: bool = False,
block_public_access: BlockPublicAccess
| None = BLOCK_ALL,
public_read_access: bool = False,
**kwargs
)
Bases: Bucket, EnvBaseConstructMixins
Source code in src/aibs_informatics_cdk_lib/constructs_/s3/bucket.py
grant_permissions
¶grant_permissions(
role: IRole | None,
*permissions: Literal["rw", "r", "w", "d"],
objects_key_pattern: str | None = None
)
Grant Bucket access (r,w,d) to a role, optionally specifying a key pattern
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
role
|
IRole | None
|
role to grant access to |
required |
objects_key_pattern
|
Optional[str]
|
Optional pattern to constrain access to. The pattern is applied to object keys within the bucket. You can use '*' and '?' wildcards. For more information, see the following link: https://docs.aws.amazon.com/AmazonS3/latest/userguide/security_iam_service-with-iam.html#security_iam_service-with-iam-id-based-policies-resources # noqa: E501 |
None
|
Source code in src/aibs_informatics_cdk_lib/constructs_/s3/bucket.py
Functions¶
grant_bucket_access
¶
grant_bucket_access(
bucket: Bucket | Sequence[Bucket],
role: IRole | None,
*permissions: Literal["rw", "r", "w", "d"],
objects_key_pattern: str | None = None
)
Grant Bucket access (r,w,d) to a role, optionally specifying a key pattern
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
bucket
|
Bucket | Sequence[Bucket]
|
bucket or buckets to grant access to |
required |
role
|
IRole | None
|
role to grant access to |
required |
objects_key_pattern
|
Optional[str]
|
Optional pattern to constrain access to. The pattern is applied to object keys within the bucket. You can use '' and '?' wildcards. For more information, see the following link: https://docs.aws.amazon.com/AmazonS3/latest/userguide/security_iam_service-with-iam.html#security_iam_service-with-iam-id-based-policies-resources Defaults to None (which in turn represents ''). |
None
|