s3:PutPublicAccessBlock Access Denied
ngocsanguit opened this issue · 4 comments
Thank you team for the great Matano!
When I deploy it I got this error
The stack named CDKToolkit failed creation, it may need to be manually deleted from the AWS console: ROLLBACK_COMPLETE: API:
› s3:PutPublicAccessBlock Access Denied
So will the Matano setup create a public s3 bucket/objects? How can we change it only to create in non-public s3?
Thanks Sang!
So this error is occurring in the CDK bootstrap process, the bucket is not public, it is actually the opposite; its being set as explicitly not public.
The error is occurring due to your organizations policy blocking any usage of the s3:PutPublicAccessBlock
action (see the following issue: aws/aws-cdk#5028 (comment)).
There is a CDK optioon: --public-access-block-configuration false
for the CDK bootstrap command to not explicitly set the public access block configuration.
We also use the block public access inside our own code for internal buckets, e.g.
matano/infra/src/DPCommonStack.ts
Line 32 in 7373558
Amazon S3 announced that all new S3 buckets will have Block Public Access enabled by default, at which point we can safely remove these explicit configurations. However, the change will be rolled out in April 2023 (not yet) (see https://docs.aws.amazon.com/AmazonS3/latest/userguide/create-bucket-faq.html).
Can you possibly change your organization policy to allow usage of the s3:PutPublicAccessBlock
action?
Thank you for the prompt response Samrose. Because PutPublicAccessBlock will allow making an S3 bucket public so it's blocked by our policy. Is there any way that I can remove this explicit setting from the code and run without using PutPublicAccessBlock
?
I understand, we can add a config option in matano.config.yml
for this and then make a code change in infrastructure to only add the public access block configuration explicitly if the matano configuration tells us to. I can make this change, should be simple.
I've created a change #125, once its merged and released, you should be able to unblock yourself by just setting aws.set_block_public_access
as false
in matano.config.yml
e.g.
# matano.config.yml
aws:
account: "123456789012"
region: "us-east-1"
set_block_public_access: false