@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
144 lines (143 loc) • 6.25 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
/**
* Provides a CloudWatch Log Metric Filter resource.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const dada = new aws.cloudwatch.LogGroup("dada", {name: "MyApp/access.log"});
* const yada = new aws.cloudwatch.LogMetricFilter("yada", {
* name: "MyAppAccessCount",
* pattern: "",
* logGroupName: dada.name,
* metricTransformation: {
* name: "EventCount",
* namespace: "YourNamespace",
* value: "1",
* },
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import CloudWatch Log Metric Filter using the `log_group_name:name`. For example:
*
* ```sh
* $ pulumi import aws:cloudwatch/logMetricFilter:LogMetricFilter test /aws/lambda/function:test
* ```
*/
export declare class LogMetricFilter extends pulumi.CustomResource {
/**
* Get an existing LogMetricFilter 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?: LogMetricFilterState, opts?: pulumi.CustomResourceOptions): LogMetricFilter;
/**
* Returns true if the given object is an instance of LogMetricFilter. 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 LogMetricFilter;
/**
* Whether the metric filter will be applied on the transformed version of the log events instead of the original ingested log events. Defaults to `false`. Valid only for log groups that have an active log transformer.
*/
readonly applyOnTransformedLogs: pulumi.Output<boolean>;
/**
* The name of the log group to associate the metric filter with.
*/
readonly logGroupName: pulumi.Output<string>;
/**
* A block defining collection of information needed to define how metric data gets emitted. See below.
*/
readonly metricTransformation: pulumi.Output<outputs.cloudwatch.LogMetricFilterMetricTransformation>;
/**
* A name for the metric filter.
*/
readonly name: pulumi.Output<string>;
/**
* A valid [CloudWatch Logs filter pattern](https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/FilterAndPatternSyntax.html)
* for extracting metric data out of ingested log events.
*/
readonly pattern: 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 LogMetricFilter 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: LogMetricFilterArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering LogMetricFilter resources.
*/
export interface LogMetricFilterState {
/**
* Whether the metric filter will be applied on the transformed version of the log events instead of the original ingested log events. Defaults to `false`. Valid only for log groups that have an active log transformer.
*/
applyOnTransformedLogs?: pulumi.Input<boolean>;
/**
* The name of the log group to associate the metric filter with.
*/
logGroupName?: pulumi.Input<string>;
/**
* A block defining collection of information needed to define how metric data gets emitted. See below.
*/
metricTransformation?: pulumi.Input<inputs.cloudwatch.LogMetricFilterMetricTransformation>;
/**
* A name for the metric filter.
*/
name?: pulumi.Input<string>;
/**
* A valid [CloudWatch Logs filter pattern](https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/FilterAndPatternSyntax.html)
* for extracting metric data out of ingested log events.
*/
pattern?: 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 LogMetricFilter resource.
*/
export interface LogMetricFilterArgs {
/**
* Whether the metric filter will be applied on the transformed version of the log events instead of the original ingested log events. Defaults to `false`. Valid only for log groups that have an active log transformer.
*/
applyOnTransformedLogs?: pulumi.Input<boolean>;
/**
* The name of the log group to associate the metric filter with.
*/
logGroupName: pulumi.Input<string>;
/**
* A block defining collection of information needed to define how metric data gets emitted. See below.
*/
metricTransformation: pulumi.Input<inputs.cloudwatch.LogMetricFilterMetricTransformation>;
/**
* A name for the metric filter.
*/
name?: pulumi.Input<string>;
/**
* A valid [CloudWatch Logs filter pattern](https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/FilterAndPatternSyntax.html)
* for extracting metric data out of ingested log events.
*/
pattern: 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>;
}