aws-cloudformation / aws-cloudformation/cloudformation-coverage-roadmap

[AWS::S3::Bucket] drift false positive with the properties ReplicationConfiguration: Metrics and ReplicationTime

Open
#1,714 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
No language data
Stars
1.1k
Forks
62
PR merge metrics
No merged PRs in 30d

Description

### Name of the resource

AWS::S3::Bucket

### Resource Name

_No response_

### Issue Description

CloudFormation detect drift returns false positive for the resource `AWS::S3::Bucket` `ReplicationConfiguration` properties - **Metrics** and **ReplicationTime** .

Sample Template

```
Resources:
MyTestBucket:
Type: 'AWS::S3::Bucket'
Properties:
ReplicationConfiguration:
Role: !GetAtt WorkItemBucketBackupRole.Arn
Rules:
- DeleteMarkerReplication:
Status: Enabled
Destination:
Bucket: ''
Metrics:
EventThreshold:
Minutes: 15
Status: Enabled
ReplicationTime:
Status: Enabled
Time:
Minutes: 15
StorageClass: STANDARD
Filter:
Prefix: ''
Id: Replication-1
Priority: 1
Status: Enabled
- DeleteMarkerReplication:
Status: Enabled
Destination:
Bucket: ''
Metrics:
EventThreshold:
Minutes: 15
Status: Enabled
ReplicationTime:
Status: Enabled
Time:
Minutes: 15
StorageClass: STANDARD
Filter:
Prefix: ''
Id: Replication-2
Priority: 2
Status: Enabled
- DeleteMarkerReplication:
Status: Enabled
Destination:
Bucket: ''
Metrics:
EventThreshold:
Minutes: 15
Status: Enabled
ReplicationTime:
Status: Enabled
Time:
Minutes: 15
StorageClass: STANDARD
Filter:
Prefix: ''
Id: Replication-3
Priority: 3
Status: Enabled
VersioningConfiguration:
Status: Enabled

WorkItemBucketBackupRole:
Type: 'AWS::IAM::Role'
Properties:
AssumeRolePolicyDocument:
Statement:
- Action:
- 'sts:AssumeRole'
Effect: Allow
Principal:
Service:
- s3.amazonaws.com
BucketBackupPolicy:
Type: 'AWS::IAM::Policy'
Properties:
PolicyDocument:
Statement:
- Action: '*'
Effect: Allow
Resource: '*'
PolicyName: BucketBackupPolicy
Roles:
- !Ref WorkItemBucketBackupRole
```

### Expected Behavior

CloudFormation shouldn't be reporting these properties as drifted

### Observed Behavior

Expected values show all the **Metrics** and **ReplicationTime** as defined in the template where as the current values show them as empty.

### Test Cases

- Create a stack with the provided sample template.
- Replace the bucket arn with valid bucket arns.
- Run Detect drift after the stack is created successfully.
- Select the drifted resource and View drifted results.

### Other Details

_No response_

Contributor guide

Open the contributing guide

Research direction

The issue names no repository files, tests, or entry points. Start by reproducing the drift with the provided CloudFormation sample template and valid bucket ARNs, then inspect the resource coverage and drift-reporting paths. Done means Metrics and ReplicationTime are reported from the template rather than as empty current values.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws
Domain
cloud, infrastructure
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.