aws-cloudformation / cloudformation-coverage-roadmap

The AWS CloudFormation Public Coverage Roadmap
https://aws.amazon.com/cloudformation/
Creative Commons Attribution Share Alike 4.0 International
1.11k stars 54 forks source link

Incorrect drift detection results for `AWS::Logs::QueryDefinition` resource type #1867

Open aerle opened 9 months ago

aerle commented 9 months ago

Name of the resource

AWS::Logs::QueryDefinition

Resource Name

No response

Issue Description

Drift detection operations are not functioning for the AWS::Logs::QueryDefinition resource type.

Expected Behavior

Running a drift detection should compare the expected and actual configuration of the resource.

Observed Behavior

When running a drift detection operation, CloudFormation marks the resource as MODIFIED, returning a REMOVED status under the 'Change' column. This behavior is consistent and easily replicated.

Test Cases

  1. Deploy a AWS::Logs::QueryDefinition:
Resources:
  myQueryDefinition:
    Type: AWS::Logs::QueryDefinition
    Properties:
      Name: "myQueryName"
      QueryString: “fields @timestamp, @message | sort @timestamp desc | limit 20"
  1. Run a drift detection operation on the stack.
  2. CloudFormation returns the MODIFIED status, with the following details:

Expected

{
  "QueryString": "?fields @timestamp, @message | sort @timestamp desc | limit 20\"",
  "Name": "myQueryName"
}

Actual

{}

Other Details

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/resource-import-supported-resources.html