github.com/xsb/terraform@v0.6.13-0.20160314145438-fe415c2f09d7/website/source/docs/providers/aws/r/cloudwatch_event_target.html.markdown (about) 1 --- 2 layout: "aws" 3 page_title: "AWS: aws_cloudwatch_event_target" 4 sidebar_current: "docs-aws-resource-cloudwatch-event-target" 5 description: |- 6 Provides a CloudWatch Event Target resource. 7 --- 8 9 # aws\_cloudwatch\_event\_target 10 11 Provides a CloudWatch Event Target resource. 12 13 ## Example Usage 14 15 ``` 16 resource "aws_cloudwatch_event_target" "yada" { 17 target_id = "Yada" 18 rule = "${aws_cloudwatch_event_rule.console.name}" 19 arn = "${aws_kinesis_stream.test_stream.arn}" 20 } 21 22 resource "aws_cloudwatch_event_rule" "console" { 23 name = "capture-ec2-scaling-events" 24 description = "Capture all EC2 scaling events" 25 event_pattern = <<PATTERN 26 { 27 "source": [ 28 "aws.autoscaling" 29 ], 30 "detail-type": [ 31 "EC2 Instance Launch Successful", 32 "EC2 Instance Terminate Successful", 33 "EC2 Instance Launch Unsuccessful", 34 "EC2 Instance Terminate Unsuccessful" 35 ] 36 } 37 PATTERN 38 } 39 40 resource "aws_kinesis_stream" "test_stream" { 41 name = "terraform-kinesis-test" 42 shard_count = 1 43 } 44 ``` 45 46 ## Argument Reference 47 48 -> **Note:** `input` and `input_path` are mutually exclusive options. 49 50 The following arguments are supported: 51 52 * `rule` - (Required) The name of the rule you want to add targets to. 53 * `target_id` - (Required) The unique target assignment ID. 54 * `arn` - (Required) The Amazon Resource Name (ARN) associated of the target. 55 * `input` - (Optional) Valid JSON text passed to the target. 56 * `input_path` - (Optional) The value of the [JSONPath](http://goessner.net/articles/JsonPath/) 57 that is used for extracting part of the matched event when passing it to the target.