You might use third party solutions for monitoring serverless applications. If this is the case, enabling tracing for AppSync APIs might be optional. Refer to the documentation of your monitoring solutions to see if you should enable AWS X-Ray tracing or not.
import{GraphqlApi}from'@aws-cdk/aws-appsync';exportclassMyStackextendscdk.Stack{constructor(scope:cdk.Construct,id:string,props?:cdk.StackProps){super(scope,id,props);constmyApi=newGraphqlApi(scope,'MyApi',{name:'my-api',// Enable active tracingxrayEnabled:true,});}}
1 2 3 4 5 6 7 8 91011121314
{"Resources":{"GraphQLApi":{"Type":"AWS::AppSync::GraphQLApi","Properties":{"Name":"api","AuthenticationType":"AWS_IAM",// Enable active tracing"XrayEnabled":true}}}}
123456789
Resources:GraphQLApi:Type:AWS::AppSync::GraphQLApiProperties:Name:apiAuthenticationType:AWS_IAM# Enable active tracingXrayEnabled:true
1 2 3 4 5 6 7 8 910
resources:Resources:GraphQLApi:Type:AWS::AppSync::GraphQLApiProperties:Name:apiAuthenticationType:AWS_IAM# Enable active tracingXrayEnabled:true
1234567
resource"aws_appsync_graphql_api""this"{name="api"authentication_type="AWS_IAM" # Enable active tracingxray_enabled=true}