UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

123 lines (122 loc) 4.79 kB
import * as pulumi from "@pulumi/pulumi"; /** * Provides a CloudWatch Logs query definition resource. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.cloudwatch.QueryDefinition("example", { * name: "custom_query", * logGroupNames: [ * "/aws/logGroup1", * "/aws/logGroup2", * ], * queryString: `fields @timestamp, @message * | sort @timestamp desc * | limit 25 * `, * }); * ``` * * ## Import * * Using `pulumi import`, import CloudWatch query definitions using the query definition ARN. The ARN can be found on the "Edit Query" page for the query in the AWS Console. For example: * * ```sh * $ pulumi import aws:cloudwatch/queryDefinition:QueryDefinition example arn:aws:logs:us-west-2:123456789012:query-definition:269951d7-6f75-496d-9d7b-6b7a5486bdbd * ``` */ export declare class QueryDefinition extends pulumi.CustomResource { /** * Get an existing QueryDefinition resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: QueryDefinitionState, opts?: pulumi.CustomResourceOptions): QueryDefinition; /** * Returns true if the given object is an instance of QueryDefinition. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is QueryDefinition; /** * Specific log groups to use with the query. */ readonly logGroupNames: pulumi.Output<string[] | undefined>; /** * The name of the query. */ readonly name: pulumi.Output<string>; /** * The query definition ID. */ readonly queryDefinitionId: pulumi.Output<string>; /** * The query to save. You can read more about CloudWatch Logs Query Syntax in the [documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax.html). */ readonly queryString: pulumi.Output<string>; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ readonly region: pulumi.Output<string>; /** * Create a QueryDefinition resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: QueryDefinitionArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering QueryDefinition resources. */ export interface QueryDefinitionState { /** * Specific log groups to use with the query. */ logGroupNames?: pulumi.Input<pulumi.Input<string>[]>; /** * The name of the query. */ name?: pulumi.Input<string>; /** * The query definition ID. */ queryDefinitionId?: pulumi.Input<string>; /** * The query to save. You can read more about CloudWatch Logs Query Syntax in the [documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax.html). */ queryString?: pulumi.Input<string>; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input<string>; } /** * The set of arguments for constructing a QueryDefinition resource. */ export interface QueryDefinitionArgs { /** * Specific log groups to use with the query. */ logGroupNames?: pulumi.Input<pulumi.Input<string>[]>; /** * The name of the query. */ name?: pulumi.Input<string>; /** * The query to save. You can read more about CloudWatch Logs Query Syntax in the [documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax.html). */ queryString: pulumi.Input<string>; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input<string>; }