The following resource(s) failed to create: [mcLoggingBucket].

0

I am trying to generate a Valheim game server using this guide: https://aws.amazon.com/blogs/gametech/hosting-your-own-dedicated-valheim-server-in-the-cloud/

However, when trying to create the Stack in CloudFormation, I get the below error:

"Bucket cannot have ACLs set with ObjectOwnership's BucketOwnerEnforced setting (Service: Amazon S3; Status Code: 400; Error Code: InvalidBucketAclWithObjectOwnership; Request ID: 51R10FQCBW6BCSC9; S3 Extended Request ID: p2+/TRD2zyg4WtFDht/oETooFwJkZkZm0MINYLPK+qQ9fw78R2un1E1araLGUym3cpGe023uUdg=; Proxy: null)"

Here is the code for that resource from the YAML file (@=a)

mcLoggingBucket:
    Type: AWS::S3::Bucket
    Properties: 
      BucketEncryption:
        ServerSideEncryptionConfiguration:
          - ServerSideEncryptionByDefault:
              SSEAlgorithm: 'aws:kms'
              KMSM@sterKeyID: KMS-KEY-ARN
      PublicAccessBlockConfiguration: 
        BlockPublicAcls: True
        BlockPublicPolicy: True
        IgnorePublicAcls: True
        RestrictPublicBuckets: True
      AccessControl: LogDeliveryWrite

asked a year ago1472 views
1 Answer
1
Accepted Answer

This error is related to the bucket being recognized as a “Bucket Owner Enforced” bucket during creation. ACLs such as “LogDeliveryWrite” are not able to be enabled when a bucket is in this state. This template can only work on buckets with ObjectWriter or BucketOwnerPreffered object ownership currently.

You can consider using the below options

1.Edit the template to specify a new object ownership rule

2.Remove the “LogDeliveryWrite” line and allow S3 to handle this itself via bucket policy.

=== Template ObjectOwnership: ObjectWriter (also tested) | ObjectOwnership: BucketOwnerEnforced (Returns the same error)- ===

  OwnershipControls:
    Rules:
      - ObjectOwnership: BucketOwnerPreferred

Add this section to your template and that should resolve your issue

AWS
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions