AWS Fundamentals Logo
AWS Fundamentals
L2 Construct

QueryDefinition

Define a query definition for CloudWatch Logs Insights.

Import

import { QueryDefinition } from 'aws-cdk-lib/aws-logs';

Or use the module namespace:

import * as logs from 'aws-cdk-lib/aws-logs';
// logs.QueryDefinition

Properties

Configuration passed to the constructor as QueryDefinitionProps.

queryDefinitionNameRequired
string

Name of the query definition.

queryStringRequired
QueryString

The query string to use for this query definition.

logGroupsOptional
ILogGroupRef[]

Specify certain log groups for the query definition.

Default: - no specified log groups

Learn AWS the Practical Way

Our bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.

Subscribe to Newsletter