-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
provider/aws: Document CloudWatch Events
- Loading branch information
Radek Simko
committed
Feb 13, 2016
1 parent
30082a4
commit e288b16
Showing
3 changed files
with
121 additions
and
0 deletions.
There are no files selected for viewing
57 changes: 57 additions & 0 deletions
57
website/source/docs/providers/aws/r/cloudwatch_event_rule.html.markdown
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
--- | ||
layout: "aws" | ||
page_title: "AWS: aws_cloudwatch_event_rule" | ||
sidebar_current: "docs-aws-resource-cloudwatch-event-rule" | ||
description: |- | ||
Provides a CloudWatch Event Rule resource. | ||
--- | ||
|
||
# aws\_cloudwatch\_event\_rule | ||
|
||
Provides a CloudWatch Event Rule resource. | ||
|
||
## Example Usage | ||
|
||
``` | ||
resource "aws_cloudwatch_event_rule" "console" { | ||
name = "capture-aws-sign-in" | ||
description = "Capture each AWS Console Sign In" | ||
event_pattern = <<PATTERN | ||
{ | ||
"detail-type": [ | ||
"AWS Console Sign In via CloudTrail" | ||
] | ||
} | ||
PATTERN | ||
} | ||
resource "aws_cloudwatch_event_target" "sns" { | ||
rule = "${aws_cloudwatch_event_rule.console.name}" | ||
target_id = "SendToSNS" | ||
arn = "${aws_sns_topic.aws_logins.arn}" | ||
} | ||
resource "aws_sns_topic" "aws_logins" { | ||
name = "aws-console-logins" | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
The following arguments are supported: | ||
|
||
* `name` - (Required) The rule's name. | ||
* `schedule_expression` - (Required, if `event_pattern` isn't specified) The scheduling expression. | ||
For example, `cron(0 20 * * ? *)` or `rate(5 minutes)`. | ||
* `event_pattern` - (Required, if `schedule_expression` isn't specified) Event pattern | ||
described a JSON object. | ||
See full documentation of [CloudWatch Events and Event Patterns](http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/CloudWatchEventsandEventPatterns.html) for details. | ||
* `description` - (Optional) The description of the rule. | ||
* `role_arn` - (Optional) The Amazon Resource Name (ARN) associated with the role that is used for target invocation. | ||
* `is_enabled` - (Optional) Whether the rule should be enabled (defaults to `true`). | ||
|
||
## Attributes Reference | ||
|
||
The following attributes are exported: | ||
|
||
* `arn` - The Amazon Resource Name (ARN) of the rule. |
57 changes: 57 additions & 0 deletions
57
website/source/docs/providers/aws/r/cloudwatch_event_target.html.markdown
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
--- | ||
layout: "aws" | ||
page_title: "AWS: aws_cloudwatch_event_target" | ||
sidebar_current: "docs-aws-resource-cloudwatch-event-target" | ||
description: |- | ||
Provides a CloudWatch Event Target resource. | ||
--- | ||
|
||
# aws\_cloudwatch\_event\_target | ||
|
||
Provides a CloudWatch Event Target resource. | ||
|
||
## Example Usage | ||
|
||
``` | ||
resource "aws_cloudwatch_event_target" "yada" { | ||
target_id = "Yada" | ||
rule = "${aws_cloudwatch_event_rule.console.arn}" | ||
arn = "${aws_kinesis_stream.test_stream.arn}" | ||
} | ||
resource "aws_cloudwatch_event_rule" "console" { | ||
name = "capture-ec2-scaling-events" | ||
description = "Capture all EC2 scaling events" | ||
event_pattern = <<PATTERN | ||
{ | ||
"source": [ | ||
"aws.autoscaling" | ||
], | ||
"detail-type": [ | ||
"EC2 Instance Launch Successful", | ||
"EC2 Instance Terminate Successful", | ||
"EC2 Instance Launch Unsuccessful", | ||
"EC2 Instance Terminate Unsuccessful" | ||
] | ||
} | ||
PATTERN | ||
} | ||
resource "aws_kinesis_stream" "test_stream" { | ||
name = "terraform-kinesis-test" | ||
shard_count = 1 | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
-> **Note:** `input` and `input_path` are mutually exclusive options. | ||
|
||
The following arguments are supported: | ||
|
||
* `rule` - (Required) The name of the rule you want to add targets to. | ||
* `target_id` - (Required) The unique target assignment ID. | ||
* `arn` - (Required) The Amazon Resource Name (ARN) associated of the target. | ||
* `input` - (Optional) Valid JSON text passed to the target. | ||
* `input_path` - (Optional) The value of the [JSONPath](http://goessner.net/articles/JsonPath/) | ||
that is used for extracting part of the matched event when passing it to the target. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters