FEATURES OPEN SOURCE ABOUT DOCS LOGIN REGISTER

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.name}"
  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. -> Note: In order to be able to have your AWS Lambda function or SNS topic invoked by a CloudWatch Events rule, you must setup the right permissions using aws_lambda_permission or aws_sns_topic.policy. More info here here.

The following arguments are supported:


See the source of this document at Terraform.io