@Stability(value=Stable)
See: Description
| Interface | Description |
|---|---|
| CfnEventBusPolicy.ConditionProperty | |
| CfnEventBusPolicyProps |
Properties for defining a `AWS::Events::EventBusPolicy`.
|
| CfnRule.EcsParametersProperty | |
| CfnRule.InputTransformerProperty | |
| CfnRule.KinesisParametersProperty | |
| CfnRule.RunCommandParametersProperty | |
| CfnRule.RunCommandTargetProperty | |
| CfnRule.SqsParametersProperty | |
| CfnRule.TargetProperty | |
| CfnRuleProps |
Properties for defining a `AWS::Events::Rule`.
|
| CronOptions |
Options to configure a cron expression.
|
| EventPattern |
Events in Amazon CloudWatch Events are represented as JSON objects.
|
| IRule | |
| IRuleTarget |
An abstract target for EventRules.
|
| OnEventOptions |
Standard set of options for `onXxx` event handlers on construct.
|
| RuleProps | |
| RuleTargetConfig |
Properties for an event rule target.
|
| RuleTargetInputProperties |
The input properties for an event target.
|
| Class | Description |
|---|---|
| CfnEventBusPolicy |
A CloudFormation `AWS::Events::EventBusPolicy`.
|
| CfnEventBusPolicy.ConditionProperty.Builder |
A builder for
CfnEventBusPolicy.ConditionProperty |
| CfnEventBusPolicy.ConditionProperty.Jsii$Proxy |
A proxy class which represents a concrete javascript instance of this type.
|
| CfnEventBusPolicyProps.Builder |
A builder for
CfnEventBusPolicyProps |
| CfnEventBusPolicyProps.Jsii$Proxy |
A proxy class which represents a concrete javascript instance of this type.
|
| CfnRule |
A CloudFormation `AWS::Events::Rule`.
|
| CfnRule.EcsParametersProperty.Builder |
A builder for
CfnRule.EcsParametersProperty |
| CfnRule.EcsParametersProperty.Jsii$Proxy |
A proxy class which represents a concrete javascript instance of this type.
|
| CfnRule.InputTransformerProperty.Builder |
A builder for
CfnRule.InputTransformerProperty |
| CfnRule.InputTransformerProperty.Jsii$Proxy |
A proxy class which represents a concrete javascript instance of this type.
|
| CfnRule.KinesisParametersProperty.Builder |
A builder for
CfnRule.KinesisParametersProperty |
| CfnRule.KinesisParametersProperty.Jsii$Proxy |
A proxy class which represents a concrete javascript instance of this type.
|
| CfnRule.RunCommandParametersProperty.Builder |
A builder for
CfnRule.RunCommandParametersProperty |
| CfnRule.RunCommandParametersProperty.Jsii$Proxy |
A proxy class which represents a concrete javascript instance of this type.
|
| CfnRule.RunCommandTargetProperty.Builder |
A builder for
CfnRule.RunCommandTargetProperty |
| CfnRule.RunCommandTargetProperty.Jsii$Proxy |
A proxy class which represents a concrete javascript instance of this type.
|
| CfnRule.SqsParametersProperty.Builder |
A builder for
CfnRule.SqsParametersProperty |
| CfnRule.SqsParametersProperty.Jsii$Proxy |
A proxy class which represents a concrete javascript instance of this type.
|
| CfnRule.TargetProperty.Builder |
A builder for
CfnRule.TargetProperty |
| CfnRule.TargetProperty.Jsii$Proxy |
A proxy class which represents a concrete javascript instance of this type.
|
| CfnRuleProps.Builder |
A builder for
CfnRuleProps |
| CfnRuleProps.Jsii$Proxy |
A proxy class which represents a concrete javascript instance of this type.
|
| CronOptions.Builder |
A builder for
CronOptions |
| CronOptions.Jsii$Proxy |
A proxy class which represents a concrete javascript instance of this type.
|
| EventField |
Represents a field in the event pattern.
|
| EventPattern.Builder |
A builder for
EventPattern |
| EventPattern.Jsii$Proxy |
A proxy class which represents a concrete javascript instance of this type.
|
| IRule.Jsii$Proxy |
A proxy class which represents a concrete javascript instance of this type.
|
| IRuleTarget.Jsii$Proxy |
A proxy class which represents a concrete javascript instance of this type.
|
| OnEventOptions.Builder |
A builder for
OnEventOptions |
| OnEventOptions.Jsii$Proxy |
A proxy class which represents a concrete javascript instance of this type.
|
| Rule |
Defines a CloudWatch Event Rule in this stack.
|
| RuleProps.Builder |
A builder for
RuleProps |
| RuleProps.Jsii$Proxy |
A proxy class which represents a concrete javascript instance of this type.
|
| RuleTargetConfig.Builder |
A builder for
RuleTargetConfig |
| RuleTargetConfig.Jsii$Proxy |
A proxy class which represents a concrete javascript instance of this type.
|
| RuleTargetInput |
The input to send to the event target.
|
| RuleTargetInputProperties.Builder |
A builder for
RuleTargetInputProperties |
| RuleTargetInputProperties.Jsii$Proxy |
A proxy class which represents a concrete javascript instance of this type.
|
| Schedule |
Schedule for scheduled event rules.
|
Amazon CloudWatch Events delivers a near real-time stream of system events that describe changes in AWS resources. For example, an AWS CodePipeline emits the State Change event when the pipeline changes it's state.
The Rule construct defines a CloudWatch events rule which monitors an
event based on an event
pattern
and invoke event targets when the pattern is matched against a triggered
event. Event targets are objects that implement the IRuleTarget interface.
Normally, you will use one of the source.onXxx(name[, target[, options]]) -> Rule methods on the event source to define an event rule associated with
the specific activity. You can targets either via props, or add targets using
rule.addTarget.
For example, to define an rule that triggers a CodeBuild project build when a commit is pushed to the "master" branch of a CodeCommit repository:
const onCommitRule = repo.onCommit('OnCommit', {
target: new targets.CodeBuildProject(project),
branches: ['master']
});
You can add additional targets, with optional input
transformer
using eventRule.addTarget(target[, input]). For example, we can add a SNS
topic target which formats a human-readable message for the commit.
For example, this adds an SNS topic as a target:
onCommitRule.addTarget(new targets.SnsTopic(topic, {
message: events.RuleTargetInput.fromText(
`A commit was pushed to the repository ${codecommit.ReferenceEvent.repositoryName} on branch ${codecommit.ReferenceEvent.referenceName}`
)
}));
The @aws-cdk/aws-events-targets module includes classes that implement the IRuleTarget
interface for various AWS services.
The following targets are supported:
targets.CodeBuildProject: Start an AWS CodeBuild buildtargets.CodePipeline: Start an AWS CodePipeline pipeline executiontargets.EcsTask: Start a task on an Amazon ECS clustertargets.LambdaFunction: Invoke an AWS Lambda functiontargets.SnsTopic: Publish into an SNS topictargets.SqsQueue: Send a message to an Amazon SQS Queuetargets.SfnStateMachine: Trigger an AWS Step Functions state machineCopyright © 2019. All rights reserved.