-
Notifications
You must be signed in to change notification settings - Fork 477
Open
Description
The create_and_deploy_front_end job is failing in CircleCI:
Waiting for changeset to be created..
Waiting for stack create/update to complete
Failed to create/update the stack. Run the following command
to fetch the list of events leading up to the failure
aws cloudformation describe-stack-events --stack-name stack-create-bucket-4107f96
Exited with code exit status 255
When I run the describe-stack-events command, I see the following error:
CREATE_FAILED Bucket cannot have ACLs set with ObjectOwnership's BucketOwnerEnforced setting (Service: Amazon S3; Status Code: 400; Error Code: InvalidBucketAclWithObjectOwnership; Request ID: PH3A3FN20TS9H7CA; S3 Extended Request ID: 3tsO51e7/ugunMvoeh/acWVGKAb+5hbumfFd+CPqfHSsYlT/bDHbSGOnePEySYVGWm1/hexc88o=; Proxy: null)
This appears to be due to a recent change to default settings on newly created buckets. Following some hints from that Stack Overflow I was able resolve the problem by removing the PublicRead ACL and replacing with public access config and ownership controls:
diff --git a/bucket.yml b/bucket.yml
index c179569..7b43bb0 100644
--- a/bucket.yml
+++ b/bucket.yml
@@ -9,7 +9,14 @@ Resources:
Type: AWS::S3::Bucket
Properties:
BucketName: !Sub "${MyBucketName}"
- AccessControl: PublicRead
+ PublicAccessBlockConfiguration:
+ BlockPublicAcls: false
+ BlockPublicPolicy: false
+ IgnorePublicAcls: false
+ RestrictPublicBuckets: false
+ OwnershipControls:
+ Rules:
+ - ObjectOwnership: ObjectWriter
WebsiteConfiguration:
IndexDocument: index.html
ErrorDocument: error.htmlReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels