title: Terraform Quicksight Cloudtrail
body: <p>I am having issues making a trail in cloudtrail to log all the quicksight related data resources / management events in S3. I'll put some of my code further:</p>
  <pre><code>resource &quot;aws_cloudtrail&quot; &quot;analytics_trail&quot; {
    name                          = &quot;some-trail&quot;
    s3_bucket_name                = module.somedatalake.s3_bucket_id
    s3_key_prefix                 = &quot;some_trail&quot;
    include_global_service_events = false
    is_multi_region_trail         = false
  
    event_selector {
      read_write_type           = &quot;All&quot;
      include_management_events = true
  
      data_resource {
        type   = &quot;AWS::S3::Object&quot;
        values = [&quot;arn:aws:quicksight&quot;]
      }
    }
    depends_on = [aws_s3_bucket_policy.datalake_policy]
  }
  </code></pre>
  <p>Below is the policy for the S3 bucket.</p>
  <pre><code>policy = &lt;&lt;-POLICY
    {
        &quot;Version&quot;: &quot;2012-10-17&quot;,
        &quot;Statement&quot;: [
            {
                &quot;Sid&quot;: &quot;AWSCloudTrailAclCheck20150319&quot;,
                &quot;Effect&quot;: &quot;Allow&quot;,
                &quot;Principal&quot;: {&quot;Service&quot;: &quot;cloudtrail.amazonaws.com&quot;},
                &quot;Action&quot;: &quot;s3:GetBucketAcl&quot;,
                &quot;Resource&quot;: &quot;${module.somedatalake.s3_bucket_arn}&quot;
            },
            {
                &quot;Sid&quot;: &quot;AWSCloudTrailWrite20150319&quot;,
                &quot;Effect&quot;: &quot;Allow&quot;,
                &quot;Principal&quot;: {&quot;Service&quot;: &quot;cloudtrail.amazonaws.com&quot;},
                &quot;Action&quot;: &quot;s3:PutObject&quot;,
                &quot;Resource&quot;: &quot;${module.somedatalake.s3_bucket_arn}/analytics_trail/AWSLogs/${data.aws_caller_identity.current.account_id}/*&quot;,
                &quot;Condition&quot;: {
                    &quot;StringEquals&quot;: {
                        &quot;s3:x-amz-acl&quot;: &quot;bucket-owner-full-control&quot;
                    }
                }
            }
        ]
    }
    POLICY
  </code></pre>
  <p>The error I am getting is the following:</p>
  <pre><code>Error: Error set event selector on CloudTrail (analytics-trail): InvalidEventSelectorsException: Value arn:aws:quicksight for DataResources.Values is invalid.
  </code></pre>
  <p>I checked the documentation on terraform and aws, but maybe I am missing something. Why is my data_resource values incorrect? I want to log everything related to quicksight.</p>