AWS Trigger

AWS Trigger

Certified

Trigger on CloudWatch metric results

Polls a CloudWatch metric query at a fixed interval and fires when the query returns at least one datapoint. Reuses Query task parameters and AWS connection fields.

yaml
type: io.kestra.plugin.aws.cloudwatch.Trigger

Trigger when a CloudWatch metric query returns non-empty results

yaml
id: aws_cloudwatch_trigger
namespace: company.team
tasks:
  - id: each
    type: io.kestra.plugin.core.flow.ForEach
    values: "{{ trigger.series }}"
    tasks:
      - id: log
        type: io.kestra.plugin.core.log.Log
        message: "Datapoint: {{ fromJson(taskrun.value) }}"

triggers:
  - id: watch
    type: io.kestra.plugin.aws.cloudwatch.Trigger
    interval: "PT1M"
    accessKeyId: "{{ secret('AWS_ACCESS_KEY_ID') }}"
    secretKeyId: "{{ secret('AWS_SECRET_KEY_ID') }}"
    region: "us-east-1"
    namespace: "AWS/EC2"
    metricName: "CPUUtilization"
    statistic: "Average"
    periodSeconds: 60
    window: PT5M
    dimensions:
      - name: "InstanceId"
        value: "i-0abcd1234ef567890"
Properties

AWS access key ID

Optional static credential. If omitted, the default credentials provider chain is used.

Defaultfalse

Specifies whether a trigger is allowed to start a new execution even if a previous run is still in progress.

Dimensions

Definitions
namestring

Dimension name

valuestring

Dimension value

Endpoint override

DefaultPT1M
Formatduration

Interval

Metric name

Namespace

Period seconds

Region

AWS secret access key

Pairs with accessKeyId for static credentials. If omitted, the default credentials provider chain is used.

AWS session token for temporary credentials

Used with STS- or SSO-issued temporary credentials. If omitted, the default credentials provider chain is used.

Statistic

SubTypestring
Possible Values
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTED

List of execution states after which a trigger should be stopped (a.k.a. disabled).

Sts endpoint override

Sts role arn

Sts role external id

DefaultPT15M

Sts role session duration

Sts role session name

Defaulttrue

A condition that determines whether the trigger should run.

A Pebble expression evaluated at trigger time. The trigger fires only when the expression evaluates to a truthy value (true, a non-empty string, a non-zero number). Use this to gate trigger execution on dynamic runtime values such as execution labels, flow variables, or environment conditions.

Window

Datapoint count

Number of datapoints returned after sorting.

SubTypeobject

Series

List of datapoints as maps, sorted by timestamp.