stac_browser_bucket = s3.Bucket(
browser_stack,
"stac-browser-bucket",
bucket_name=f"{APP_NAME}-{STAGE_NAME}",
removal_policy=RemovalPolicy.DESTROY,
auto_delete_objects=True,
website_index_document="index.html",
public_read_access=True,
block_public_access=s3.BlockPublicAccess(
block_public_acls=False,
block_public_policy=False,
ignore_public_acls=False,
restrict_public_buckets=False,
),
object_ownership=s3.ObjectOwnership.OBJECT_WRITER,
)
Recently it became non-trivial to create a publicly accessible S3 bucket with CDK code. Adding this as a boolean option to the stac browser options would be useful for users opting for static s3 website hosting -- it spares them these lines of code in their client :