serverless-application-model: Property PublicAccessBlockConfiguration not defined

I’m using the very new AWS::S3::Bucket property PublicAccessBlockConfiguration

I also have the latest AWS SDK and aws-cli version: aws-cli/1.16.60 Python/3.7.1 Darwin/16.7.0 botocore/1.12.50

My template looks like:

AWSTemplateFormatVersion: 2010-09-09
Transform: AWS::Serverless-2016-10-31

Resources:
  Bucket:
    Type: AWS::S3::Bucket
    Properties:
      PublicAccessBlockConfiguration:
        BlockPublicAcls       : true
        BlockPublicPolicy     : true
        IgnorePublicAcls      : true
        RestrictPublicBuckets : true

And I’m having the following error:

Failed to create the changeset:
Waiter ChangeSetCreateComplete failed:
Waiter encountered a terminal failure state Status: FAILED.
Reason: Transform AWS::Serverless-2016-10-31 failed with:
 Invalid Serverless Application Specification document.
 Number of errors found: 1.
 Resource with id [Bucket] is invalid.
 property PublicAccessBlockConfiguration not defined for resource of type AWS::S3::Bucket

This looks like an AWS::Serverless-2016-10-31 transform error? Or am I wrong? 🤔

Edit: I’ve updated many buckets with PublicAccessBlockConfigurationand everything looks fine except when the CloudFormation template uses Transform: AWS::Serverless-2016-10-31 and the S3 is a CloudFormation dependency 🤔

Note also than I’m doing aws cloudformation package prior to aws cloudformation deploy

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 17 (4 by maintainers)

Commits related to this issue

Most upvoted comments

Ok, here’s what it looks like:

When SAM adds an event to an S3 bucket, it tries to load that bucket into an internal S3 bucket class which has all the accepted parameters hard coded. I submitted a fix in https://github.com/awslabs/serverless-application-model/pull/700, but this brings up a good thing to think about- I would rather not need to manually update these resources every time some small change is made to them.

Released!

Correct. We will update this issue when this is available. You can expect it with the upcoming v1.10.0 release