You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried creating a simple CloudFormation stack with just a bucket and a policy, made sure the Block Public Access setting is turned off for my IAM account and the Root account, and the template failed with the same error! Inspecting the created bucket I see that despite all the account settings it still has a Block Public Access setting on by default!
I believe the resource template and the policy preparation code must be changed to specify this setting explicitly for the app bucket. Can you do this? I have several projects depending on fullstack-serverless, it will be very unfortunate if I will not be able to deploy them anymore.
Thanks in advance!
The text was updated successfully, but these errors were encountered:
For anyone interested in a quick workaround, I have implemented a custom plugin that you add to the end of your plugins list. It fixes the policy creation problem for now, but I believe it is still not a solution, but rather a workaround.
"use strict";const_=require('lodash');classFixS3PublicAccessPlugin{constructor(serverless){this.error=serverless.classes.Error;this.serverless=serverless;this.hooks={'before:aws:package:finalize:mergeCustomProviderResources': this.fixAppBucketPublicAccess.bind(this)};}fixAppBucketPublicAccess(){constbaseResources=this.serverless.service.provider.compiledCloudFormationTemplate;constisSinglePageApp=!!this.serverless.service.custom.fullstack?.singlePageApp;if(!isSinglePageApp){constbucketConfigProps=baseResources.Resources?.WebAppS3Bucket?.Properties;if(!bucketConfigProps)thrownewthis.error("WebAppS3Bucket resource is not defined. Move this plugin lower in the plugins list.");this.serverless.cli.log(`Fixing WebApp bucket access ...`);bucketConfigProps.PublicAccessBlockConfiguration={BlockPublicAcls: false,BlockPublicPolicy: false,IgnorePublicAcls: false,RestrictPublicBuckets: false};}returnbaseResources;}}module.exports=FixS3PublicAccessPlugin;
Hi.
I am facing an issue trying to deploy a full-stack serverless application that used to work to another AWS account. The error is
I have spent some time trying to understand what's going on, and found these articles:
I tried creating a simple CloudFormation stack with just a bucket and a policy, made sure the Block Public Access setting is turned off for my IAM account and the Root account, and the template failed with the same error! Inspecting the created bucket I see that despite all the account settings it still has a Block Public Access setting on by default!
I believe the resource template and the policy preparation code must be changed to specify this setting explicitly for the app bucket. Can you do this? I have several projects depending on
fullstack-serverless
, it will be very unfortunate if I will not be able to deploy them anymore.Thanks in advance!
The text was updated successfully, but these errors were encountered: