1. Packages
  2. Packages
  3. AWS Cloud Control
  4. API Docs
  5. logs
  6. QueryDefinition

We recommend new projects start with resources from the AWS provider.

Viewing docs for AWS Cloud Control v1.62.0
published on Monday, Apr 20, 2026 by Pulumi
aws-native logo

We recommend new projects start with resources from the AWS provider.

Viewing docs for AWS Cloud Control v1.62.0
published on Monday, Apr 20, 2026 by Pulumi

    The resource schema for AWSLogs QueryDefinition

    Create QueryDefinition Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new QueryDefinition(name: string, args: QueryDefinitionArgs, opts?: CustomResourceOptions);
    @overload
    def QueryDefinition(resource_name: str,
                        args: QueryDefinitionArgs,
                        opts: Optional[ResourceOptions] = None)
    
    @overload
    def QueryDefinition(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        query_string: Optional[str] = None,
                        log_group_names: Optional[Sequence[str]] = None,
                        name: Optional[str] = None,
                        parameters: Optional[Sequence[QueryDefinitionQueryParameterArgs]] = None,
                        query_language: Optional[QueryDefinitionQueryLanguage] = None)
    func NewQueryDefinition(ctx *Context, name string, args QueryDefinitionArgs, opts ...ResourceOption) (*QueryDefinition, error)
    public QueryDefinition(string name, QueryDefinitionArgs args, CustomResourceOptions? opts = null)
    public QueryDefinition(String name, QueryDefinitionArgs args)
    public QueryDefinition(String name, QueryDefinitionArgs args, CustomResourceOptions options)
    
    type: aws-native:logs:QueryDefinition
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args QueryDefinitionArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args QueryDefinitionArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args QueryDefinitionArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args QueryDefinitionArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args QueryDefinitionArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    QueryDefinition Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The QueryDefinition resource accepts the following input properties:

    QueryString string
    The query string to use for this definition
    LogGroupNames List<string>
    Optionally define specific log groups as part of your query definition
    Name string
    A name for the saved query definition
    Parameters List<Pulumi.AwsNative.Logs.Inputs.QueryDefinitionQueryParameter>
    Use this parameter to include specific query parameters as part of your query definition. Query parameters are supported only for Logs Insights QL queries. Query parameters allow you to use placeholder variables in your query string that are substituted with values at execution time. Use the {{parameterName}} syntax in your query string to reference a parameter.
    QueryLanguage Pulumi.AwsNative.Logs.QueryDefinitionQueryLanguage
    Query language of the query string. Possible values are CWLI, SQL, PPL, with CWLI being the default.
    QueryString string
    The query string to use for this definition
    LogGroupNames []string
    Optionally define specific log groups as part of your query definition
    Name string
    A name for the saved query definition
    Parameters []QueryDefinitionQueryParameterArgs
    Use this parameter to include specific query parameters as part of your query definition. Query parameters are supported only for Logs Insights QL queries. Query parameters allow you to use placeholder variables in your query string that are substituted with values at execution time. Use the {{parameterName}} syntax in your query string to reference a parameter.
    QueryLanguage QueryDefinitionQueryLanguage
    Query language of the query string. Possible values are CWLI, SQL, PPL, with CWLI being the default.
    queryString String
    The query string to use for this definition
    logGroupNames List<String>
    Optionally define specific log groups as part of your query definition
    name String
    A name for the saved query definition
    parameters List<QueryDefinitionQueryParameter>
    Use this parameter to include specific query parameters as part of your query definition. Query parameters are supported only for Logs Insights QL queries. Query parameters allow you to use placeholder variables in your query string that are substituted with values at execution time. Use the {{parameterName}} syntax in your query string to reference a parameter.
    queryLanguage QueryDefinitionQueryLanguage
    Query language of the query string. Possible values are CWLI, SQL, PPL, with CWLI being the default.
    queryString string
    The query string to use for this definition
    logGroupNames string[]
    Optionally define specific log groups as part of your query definition
    name string
    A name for the saved query definition
    parameters QueryDefinitionQueryParameter[]
    Use this parameter to include specific query parameters as part of your query definition. Query parameters are supported only for Logs Insights QL queries. Query parameters allow you to use placeholder variables in your query string that are substituted with values at execution time. Use the {{parameterName}} syntax in your query string to reference a parameter.
    queryLanguage QueryDefinitionQueryLanguage
    Query language of the query string. Possible values are CWLI, SQL, PPL, with CWLI being the default.
    query_string str
    The query string to use for this definition
    log_group_names Sequence[str]
    Optionally define specific log groups as part of your query definition
    name str
    A name for the saved query definition
    parameters Sequence[QueryDefinitionQueryParameterArgs]
    Use this parameter to include specific query parameters as part of your query definition. Query parameters are supported only for Logs Insights QL queries. Query parameters allow you to use placeholder variables in your query string that are substituted with values at execution time. Use the {{parameterName}} syntax in your query string to reference a parameter.
    query_language QueryDefinitionQueryLanguage
    Query language of the query string. Possible values are CWLI, SQL, PPL, with CWLI being the default.
    queryString String
    The query string to use for this definition
    logGroupNames List<String>
    Optionally define specific log groups as part of your query definition
    name String
    A name for the saved query definition
    parameters List<Property Map>
    Use this parameter to include specific query parameters as part of your query definition. Query parameters are supported only for Logs Insights QL queries. Query parameters allow you to use placeholder variables in your query string that are substituted with values at execution time. Use the {{parameterName}} syntax in your query string to reference a parameter.
    queryLanguage "CWLI" | "SQL" | "PPL"
    Query language of the query string. Possible values are CWLI, SQL, PPL, with CWLI being the default.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the QueryDefinition resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    QueryDefinitionId string
    Unique identifier of a query definition
    Id string
    The provider-assigned unique ID for this managed resource.
    QueryDefinitionId string
    Unique identifier of a query definition
    id String
    The provider-assigned unique ID for this managed resource.
    queryDefinitionId String
    Unique identifier of a query definition
    id string
    The provider-assigned unique ID for this managed resource.
    queryDefinitionId string
    Unique identifier of a query definition
    id str
    The provider-assigned unique ID for this managed resource.
    query_definition_id str
    Unique identifier of a query definition
    id String
    The provider-assigned unique ID for this managed resource.
    queryDefinitionId String
    Unique identifier of a query definition

    Supporting Types

    QueryDefinitionQueryLanguage, QueryDefinitionQueryLanguageArgs

    Cwli
    CWLI
    Sql
    SQL
    Ppl
    PPL
    QueryDefinitionQueryLanguageCwli
    CWLI
    QueryDefinitionQueryLanguageSql
    SQL
    QueryDefinitionQueryLanguagePpl
    PPL
    Cwli
    CWLI
    Sql
    SQL
    Ppl
    PPL
    Cwli
    CWLI
    Sql
    SQL
    Ppl
    PPL
    CWLI
    CWLI
    SQL
    SQL
    PPL
    PPL
    "CWLI"
    CWLI
    "SQL"
    SQL
    "PPL"
    PPL

    QueryDefinitionQueryParameter, QueryDefinitionQueryParameterArgs

    This structure defines a query parameter for a saved CloudWatch Logs Insights query definition. Query parameters are supported only for Logs Insights QL queries. They are placeholder variables that you can reference in a query string using the {{parameterName}} syntax. Each parameter can include a default value and a description.
    Name string
    The name of the query parameter. A query parameter name must start with a letter or underscore, and contain only letters, digits, and underscores.
    DefaultValue string
    The default value to use for this query parameter if no value is supplied at execution time.
    Description string
    A description of the query parameter that explains its purpose or expected values.
    Name string
    The name of the query parameter. A query parameter name must start with a letter or underscore, and contain only letters, digits, and underscores.
    DefaultValue string
    The default value to use for this query parameter if no value is supplied at execution time.
    Description string
    A description of the query parameter that explains its purpose or expected values.
    name String
    The name of the query parameter. A query parameter name must start with a letter or underscore, and contain only letters, digits, and underscores.
    defaultValue String
    The default value to use for this query parameter if no value is supplied at execution time.
    description String
    A description of the query parameter that explains its purpose or expected values.
    name string
    The name of the query parameter. A query parameter name must start with a letter or underscore, and contain only letters, digits, and underscores.
    defaultValue string
    The default value to use for this query parameter if no value is supplied at execution time.
    description string
    A description of the query parameter that explains its purpose or expected values.
    name str
    The name of the query parameter. A query parameter name must start with a letter or underscore, and contain only letters, digits, and underscores.
    default_value str
    The default value to use for this query parameter if no value is supplied at execution time.
    description str
    A description of the query parameter that explains its purpose or expected values.
    name String
    The name of the query parameter. A query parameter name must start with a letter or underscore, and contain only letters, digits, and underscores.
    defaultValue String
    The default value to use for this query parameter if no value is supplied at execution time.
    description String
    A description of the query parameter that explains its purpose or expected values.

    Package Details

    Repository
    AWS Native pulumi/pulumi-aws-native
    License
    Apache-2.0
    aws-native logo

    We recommend new projects start with resources from the AWS provider.

    Viewing docs for AWS Cloud Control v1.62.0
    published on Monday, Apr 20, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.