aws::cloudwatch-event-rule

Create a CloudWatch rule and its targets.

Example

aws::cloudwatch-event-rule event-pattern-example
    name: "event-pattern-test"
    description: "first rule test"
    event-pattern-path: 'event-pattern.json'
    schedule-event: true
    schedule-expression: 'rate(5 minutes)'
    state: "ENABLED"

    target
        target-id: "event-pattern-match-target1"
        target-arn: "arn:aws:sqs:us-east-2:242040583208:cloudwatch-test.fifo"
        message-group-id: "test123"
    end
end

Attributes

Attribute Description
name The name of the rule associated that matches incoming events. (Required)
description The description of the rule associated with the event.
role The IAM role that gives permissions to invoke actions on the targets.
event-pattern The event pattern which activates target actions when matched.
schedule-expression The schedule expression that triggers an automated rule action. See AWS Services Schedule Expressions.
state This value indicates if the rule is enabled to invoke target actions. Valid values are ENABLED or DISABLED Valid values are ENABLED or DISABLED.
target set subresource

The list of target resources which can be invoked when an event pattern is matched or scheduled.

target-id
The identifier of the target resource. (Required)
target-arn
The arn of the target resource. (Required)
role
The IAM role arn that gives permission to invoke actions on the target resource.
input
The input json text that triggers an action on the target resource. If provided, doesn’t consider the matched event conditions.
input-path
The input path that passes the part of the event to trigger the target resource.
message-group-id
The SQS queue message group id which will be the destination for the target when triggered. The SQS queue must be a FIFO type and should have content-based-deduplication enabled.
ecs-task-count
The number of tasks created when the target is an Amazon ECS task.
ecs-task-definition-arn
The arn of the task that is created when the target is an Amazon ECS task.
input-transformer-path-map map
The map of customized inputs that can be used to configure cloudwatch event targets. See AWS Services CloudWatch InputTransformer property.
input-transformer-template
The input template which contains the values of the keys of the input path maps. See AWS Services CloudWatch InputTransformer property.
kinesis-partition-key-path
The path of the kinesis data stream target. See AWS Services CloudWatch Kinesis parameter property.

Outputs

Attribute Description
managed-by If role arn is given, this field specifies which aws service can manage the rules.
arn The arn for the cloudwatch rule.