Public static site fails to deploy due to missing public access block configuration #919
Labels
bug
This issue is a bug.
language/python
Related to Python examples
needs-triage
This issue or PR still needs to be triaged.
Describe the bug
If you try to deploy a public S3 bucket with the CDK or cloudformation in general, AWS will give you this useless error:
The only way around it is to explicitly specify the bucket's block public access configuration to allow it.
The python public static site example does not set this configuration.
This is very time consuming to figure out, since the AWS docs helpfully don't mention this secret behavior in any relevant place.
Expected Behavior
The site should deploy.
Current Behavior
The deployment fails with access denied for s3:PutBucketPolicy, regardless of the permissions of the user or role.
The error message isn't helpful at all in diagnosing the issue.
Reproduction Steps
Try to deploy the public static site example.
You may need to work around the other static site issues that are still open here.
Possible Solution
Add the
block_public_access
keyword argument to the creation of the public site bucket. e.g.Additional Information/Context
No response
CDK CLI Version
2.96.0 (build e6322aa)
Framework Version
No response
Node.js Version
v18.17.1
OS
Linux 6.4.4-arch1-1
Language
Python
Language Version
3.11.3
The text was updated successfully, but these errors were encountered: