Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v3: Error: Cannot use 'publicReadAccess' property on a bucket without allowing bucket-level public access through 'blockPublicAceess' property. #395

Closed
richard-stafflink opened this issue Jun 3, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@richard-stafflink
Copy link

richard-stafflink commented Jun 3, 2024

Issue description

I'm not sure the cause, as we've not updated the serverless version, we're lock it to serverless@3.38.0.
And serverless-lift hasn't had an update in 7 months.

It's got to do with the call from serverless -> serverless-lift -> aws-cdk-lib

aws-cdk-lib was updated on 2024-05-31 @ 23:15 GTM, which may somewhat line up:
https://github.com/aws/aws-cdk/releases/tag/v2.144.0

The error was on (you'll notice the typo blockPublicAceess ('ee' in Aceess)):
https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/aws-s3/lib/bucket.ts#L2004

How to Reproduce

Context

serverless.yml:

service: my-web
 
useDotenv: true
 
plugins:
  - serverless-lift
 
constructs:
  web:
    type: static-website
    path: dist
 
provider:
  name: aws
  region: ap-southeast-2
  runtime: nodejs18.x
 
constructs:
  web:
    type: static-website
    path: dist
    extensions:
      bucket:
        Properties:
          PublicAccessBlockConfiguration:
            BlockPublicAcls: false
          OwnershipControls:
            Rules:
              - ObjectOwnership: ObjectWriter

Additional Information

The error stack trace:

Error: Cannot use 'publicReadAccess' property on a bucket without allowing bucket-level public access through 'blockPublicAceess' property.
at new Bucket (/codebuild/output/src2380560000/src/github.com/-pty-ltd/xxxx/node_modules/aws-cdk-lib/aws-s3/lib/bucket.js:1:23243)
at new _StaticWebsiteAbstract (/codebuild/output/src2380560000/src/github.com/
-pty-ltd/projectName/node_modules/serverless-lift/dist/src/constructs/aws/abstracts/StaticWebsiteAbstract.js:84:19)
at new StaticWebsite (/codebuild/output/src2380560000/src/github.com/-pty-ltd/projectName/node_modules/serverless-lift/dist/src/constructs/aws/StaticWebsite.js:43:5)
at StaticWebsite.create (/codebuild/output/src2380560000/src/github.com/
-pty-ltd/projectName/node_modules/serverless-lift/dist/src/constructs/abstracts/AwsConstruct.js:79:23)
at _AwsProvider.createConstruct (/codebuild/output/src2380560000/src/github.com/-pty-ltd/projectName/node_modules/serverless-lift/dist/src/providers/AwsProvider.js:90:22)
at _LiftPlugin.loadConstructs (/codebuild/output/src2380560000/src/github.com/
-pty-ltd/projectName/node_modules/serverless-lift/dist/src/plugin.js:201:64)
at initialize (/codebuild/output/src2380560000/src/github.com/-pty-ltd/projectName/node_modules/serverless-lift/dist/src/plugin.js:101:14)
at PluginManager.run (/codebuild/output/src2380560000/src/github.com/
-pty-ltd/projectName/node_modules/serverless/lib/classes/plugin-manager.js:598:65)
at async Serverless.run (/codebuild/output/src2380560000/src/github.com/-pty-ltd/projectName/node_modules/serverless/lib/serverless.js:179:5)
at async /codebuild/output/src2380560000/src/github.com/
-pty-ltd/projectName/node_modules/serverless/scripts/serverless.js:819:9

@richard-stafflink
Copy link
Author

Could be related to this issue: #320

@richard-stafflink
Copy link
Author

Looks like this PR fixes it: #384

@mnapoli
Copy link
Member

mnapoli commented Jun 4, 2024

Indeed duplicates #320

@mnapoli mnapoli closed this as not planned Won't fix, can't repro, duplicate, stale Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants