provider/aws: Add docs for CloudWatch Log Metric Filter

This commit is contained in:
Radek Simko 2016-03-02 12:20:57 +00:00
parent 3bfcd47238
commit 7a33fad25f
2 changed files with 58 additions and 0 deletions

View File

@ -0,0 +1,54 @@
---
layout: "aws"
page_title: "AWS: aws_cloudwatch_log_metric_filter"
sidebar_current: "docs-aws-resource-cloudwatch-log-metric-filter"
description: |-
Provides a CloudWatch Log Metric Filter resource.
---
# aws\_cloudwatch\_log\_metric\_filter
Provides a CloudWatch Log Metric Filter resource.
## Example Usage
```
resource "aws_cloudwatch_log_metric_filter" "yada" {
name = "MyAppAccessCount"
pattern = ""
log_group_name = "${aws_cloudwatch_log_group.dada.name}"
metric_transformation {
name = "EventCount"
namespace = "YourNamespace"
value = "1"
}
}
resource "aws_cloudwatch_log_group" "dada" {
name = "MyApp/access.log"
}
```
## Argument Reference
The following arguments are supported:
* `name` - (Required) A name for the metric filter.
* `pattern` - (Required) 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.
* `log_group_name` - (Required) The name of the log group to associate the metric filter with.
* `metric_transformation` - (Required) A block defining collection of information
needed to define how metric data gets emitted. See below.
The `metric_transformation` block supports the following arguments:
* `name` - (Required) The name of the CloudWatch metric to which the monitored log information should be published (e.g. `ErrorCount`)
* `namespace` - (Required) The destination namespace of the CloudWatch metric.
* `value` - (Required) What to publish to the metric. For example, if you're counting the occurrences of a particular term like "Error", the value will be "1" for each occurrence. If you're counting the bytes transferred the published value will be the value in the log event.
## Attributes Reference
The following attributes are exported:
* `id` - The name of the metric filter.

View File

@ -76,6 +76,10 @@
<a href="/docs/providers/aws/r/cloudwatch_log_group.html">aws_cloudwatch_log_group</a>
</li>
<li<%= sidebar_current("docs-aws-resource-cloudwatch-log-metric-filter") %>>
<a href="/docs/providers/aws/r/cloudwatch_log_metric_filter.html">aws_cloudwatch_log_metric_filter</a>
</li>
<li<%= sidebar_current("docs-aws-resource-cloudwatch-metric-alarm") %>>
<a href="/docs/providers/aws/r/cloudwatch_metric_alarm.html">aws_cloudwatch_metric_alarm</a>
</li>