FEATURES OPEN SOURCE ABOUT DOCS LOGIN REGISTER

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:

Attributes Reference

The following attributes are exported:

Import

Cloudwatch Event Rules can be imported using the name, e.g.

$ terraform import aws_cloudwatch_event_rule.console capture-console-sign-in

See the source of this document at Terraform.io