Skip to main content
MEDIUMAppSyncOperational Excellence

AppSync Logging Disabled

appsync-logging-disabled

What this rule checks

Detects AppSync APIs without logging, field-level logging, or X-Ray tracing.

How to fix it

  1. 1Configure LogConfig to capture request/response logs in CloudWatch
  2. 2Set FieldLogLevel to ERROR or ALL for resolver execution detail
  3. 3Enable XrayEnabled for distributed tracing
FlaggedThe API has no LogConfig and XrayEnabled is not true. The check flags AppSync APIs that lack request/response logging and X-Ray tracing.
import * as appsync from 'aws-cdk-lib/aws-appsync';

new appsync.CfnGraphQLApi(this, 'Api', {
  name: 'my-api',
  authenticationType: 'AWS_IAM',
});
FixedAdding logConfig with fieldLogLevel: ERROR and setting xrayEnabled: true satisfies both the logging and tracing conditions.
import * as appsync from 'aws-cdk-lib/aws-appsync';

new appsync.CfnGraphQLApi(this, 'Api', {
  name: 'my-api',
  authenticationType: 'AWS_IAM',
  xrayEnabled: true,
  logConfig: {
    cloudWatchLogsRoleArn: 'arn:aws:iam::111122223333:role/AppSyncLogs',
    fieldLogLevel: 'ERROR',
  },
});

CDK Insights pinpoints the exact file and line in your CDK source for every finding, so you can jump straight to the fix.

Affected resource types

AWS::AppSync::GraphQLApi

Compliance frameworks

SOC2HIPAAPCI-DSSNIST

AWS documentation

Read the AWS guidance

Intentional? Suppress this finding

Sometimes a flag is deliberate β€” a genuinely public endpoint, say. You can dismiss appsync-logging-disabled and the reason is kept in the report, not silently hidden.

In .cdk-insights.json:

{
  "ignoreRules": [
    { "id": "appsync-logging-disabled", "reason": "Why this is intentional" }
  ]
}

Or inline in your CDK code:

Validations.of(scope).acknowledge({
  id: 'cdk-insights::appsync-logging-disabled',
  reason: 'Why this is intentional',
});

Use the rule ID appsync-logging-disabled shown above β€” not the CDK-* ID from SARIF / GitHub code scanning. To dismiss every finding on one construct instead, use ignorePaths. Suppression docs β†’

Catch this in your stack

$ npx cdk-insights scan

CDK Insights runs this and 118+ other rules locally against your synthesised CDK app β€” free, no account, your code never leaves your machine.

More AppSync rules