cloudformation-coverage-roadmap icon indicating copy to clipboard operation
cloudformation-coverage-roadmap copied to clipboard

CloudFormation reports drift when there is no drift for BucketOwnerPreferred

Open lvthillo opened this issue 1 year ago • 0 comments

Name of the resource

AWS::S3::Bucket

Resource Name

No response

Issue Description

We have an S3 bucket with the following ownership control in the template:

      OwnershipControls:
        Rules:
          - ObjectOwnership: BucketOwnerPreferred

Drift detection will tell us the stack is drifted: Property: OwnershipControls Change: REMOVE Expected Value: {"Rules":[{"ObjectOwnership":"BucketOwnerPreferred"}]} Current Value: -

When we check the s3 bucket we can see that the ObjectOwnership is configured correctly

Expected Behavior

No drift, drift detection should see:

  "OwnershipControls": {
    "Rules": [
      {
        "ObjectOwnership": "BucketOwnerPreferred"
      }
    ]
  },

For the actual resource

Observed Behavior

CloudFormation reports drift

Test Cases

Create an S3 bucket using CF with the following setting:

      OwnershipControls:
        Rules:
          - ObjectOwnership: BucketOwnerPreferred

Check for drift.

Other Details

No response

lvthillo avatar Aug 25 '22 07:08 lvthillo