- Newest
- Most votes
- Most comments
This appears to be a known issue with CloudFormation drift detection rather than an actual drift in your resources.
When CloudFormation performs drift detection, it sometimes reports false positives for certain resource properties, particularly when comparing null values or empty collections. In your case, the drift detection is showing Tags and IdentitySource being replaced with null values, even though the actual resources likely still have their proper configuration.
For AWS::ApiGateway::Authorizer and AWS::CloudFront::Distribution resources specifically, there are known issues with how CloudFormation interprets certain properties during drift detection. The CloudFormation service might be interpreting the absence of a value differently than how the CDK defined it.
To work around this issue, you could:
-
Verify in the AWS Console that your resources actually have the expected configuration (tags, identity sources, etc.)
-
If using the CDK's CloudFormationStackDriftDetectionCheck for automated drift detection, be aware that these false positives might trigger compliance failures
-
Consider explicitly setting values for properties that tend to show up as drifted, even if they would normally be optional
-
For critical infrastructure, you might want to implement additional validation beyond CloudFormation drift detection
This is not an issue with your CDK code or deployment process, but rather with how CloudFormation's drift detection mechanism interprets certain resource properties.
Sources
aws-cdk-lib.aws_config module · AWS CDK
CDK Version Upgrade Causing DynamoDB Table Replacement and Unreferenced Historical Data | AWS re:Post
Reset the landing zone to resolve drift - AWS Control Tower
answered 9 months ago
Relevant content
asked a year ago
asked 2 years ago
- AWS OFFICIALUpdated a month ago
