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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

S3 Bucket with public read access fails to create #3102

Closed
1 task done
AlexCheema opened this issue Jun 27, 2019 · 2 comments
Closed
1 task done

S3 Bucket with public read access fails to create #3102

AlexCheema opened this issue Jun 27, 2019 · 2 comments
Labels
needs-triage This issue or PR still needs to be triaged.

Comments

@AlexCheema
Copy link
Contributor

AlexCheema commented Jun 27, 2019

Note: for support questions, please first reference our documentation, then use Stackoverflow. This repository's issues are intended for feature requests and bug reports.

  • I'm submitting a ...

    • 馃 bug report
  • What is the current behavior?
    If the current behavior is a 馃bug馃: Please provide the steps to reproduce

    const staticBucket = new s3.Bucket(this, "StaticBucket", {
      versioned: false,
      publicReadAccess: true
    });

This code gives the following error:

3/7 | 12:26:06 PM | CREATE_FAILED        | AWS::S3::BucketPolicy       | StaticBucket/Policy (StaticBucketPolicy4D0F6D8E) API: s3:PutBucketPolicy Access Denied
        new BucketPolicy (/node_modules/@aws-cdk/aws-s3/lib/bucket-policy.ts:32:5)
        \_ Bucket.addToResourcePolicy (/node_modules/@aws-cdk/aws-s3/lib/bucket.ts:346:21)
        \_ Function.addToPrincipalOrResource (/node_modules/@aws-cdk/aws-iam/lib/grant.ts:115:22)
        \_ Bucket.grantPublicAccess (/node_modules/@aws-cdk/aws-s3/lib/bucket.ts:497:22)
        ...
  • What is the expected behavior (or behavior of feature suggested)?
    Should create an S3 Bucket with public read access.

  • Please tell us about your environment:

    • CDK CLI Version: 0.36.0
    • Module Version: 0.36.0
    • OS: Windows 10
    • Language: Typescript
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. associated pull-request, stackoverflow, gitter, etc)
    This happens on both v0.35.0 and v0.36.0

@AlexCheema AlexCheema added the needs-triage This issue or PR still needs to be triaged. label Jun 27, 2019
@AlexCheema
Copy link
Contributor Author

False alarm. Somehow the "Block public access (account settings)" was enabled on my AWS account.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

2 participants