

This is the new *CloudFormation Template Reference Guide*. Please update your bookmarks and links. For help getting started with CloudFormation, see the [AWS CloudFormation User Guide](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/Welcome.html).

# AWS::Events::Rule
<a name="aws-resource-events-rule"></a>

Creates or updates the specified rule. Rules are enabled by default, or based on value of the state. You can disable a rule using [DisableRule](https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_DisableRule.html).

A single rule watches for events from a single event bus. Events generated by AWS services go to your account's default event bus. Events generated by SaaS partner services or applications go to the matching partner event bus. If you have custom applications or services, you can specify whether their events go to your default event bus or a custom event bus that you have created. For more information, see [CreateEventBus](https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_CreateEventBus.html).

If you are updating an existing rule, the rule is replaced with what you specify in this `PutRule` command. If you omit arguments in `PutRule`, the old values for those arguments are not kept. Instead, they are replaced with null values.

When you create or update a rule, incoming events might not immediately start matching to new or updated rules. Allow a short period of time for changes to take effect.

A rule must contain at least an EventPattern or ScheduleExpression. Rules with EventPatterns are triggered when a matching event is observed. Rules with ScheduleExpressions self-trigger based on the given schedule. A rule can have both an EventPattern and a ScheduleExpression, in which case the rule triggers on matching events as well as on a schedule.

Most services in AWS treat : or / as the same character in Amazon Resource Names (ARNs). However, EventBridge uses an exact match in event patterns and rules. Be sure to use the correct ARN characters when creating event patterns so that they match the ARN syntax in the event you want to match.

In EventBridge, it is possible to create rules that lead to infinite loops, where a rule is fired repeatedly. For example, a rule might detect that ACLs have changed on an S3 bucket, and trigger software to change them to the desired state. If the rule is not written carefully, the subsequent change to the ACLs fires the rule again, creating an infinite loop.

To prevent this, write the rules so that the triggered actions do not re-fire the same rule. For example, your rule could fire only if ACLs are found to be in a bad state, instead of after any change. 

An infinite loop can quickly cause higher than expected charges. We recommend that you use budgeting, which alerts you when charges exceed your specified limit. For more information, see [Managing Your Costs with Budgets](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/budgets-managing-costs.html).

**Note**  
As an aid to help you jumpstart developing CloudFormation templates, the EventBridge console enables you to create templates from the existing rules in your account. For more information, see [Generating CloudFormation templates from an EventBridge rule](https://docs.aws.amazon.com/eventbridge/latest/userguide/rule-generate-template.html) in the *Amazon EventBridge User Guide*.

## Syntax
<a name="aws-resource-events-rule-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-resource-events-rule-syntax.json"></a>

```
{
  "Type" : "AWS::Events::Rule",
  "Properties" : {
      "[Description](#cfn-events-rule-description)" : String,
      "[EventBusName](#cfn-events-rule-eventbusname)" : String,
      "[EventPattern](#cfn-events-rule-eventpattern)" : Json,
      "[Name](#cfn-events-rule-name)" : String,
      "[RoleArn](#cfn-events-rule-rolearn)" : String,
      "[ScheduleExpression](#cfn-events-rule-scheduleexpression)" : String,
      "[State](#cfn-events-rule-state)" : String,
      "[Tags](#cfn-events-rule-tags)" : [ Tag, ... ],
      "[Targets](#cfn-events-rule-targets)" : [ Target, ... ]
    }
}
```

### YAML
<a name="aws-resource-events-rule-syntax.yaml"></a>

```
Type: AWS::Events::Rule
Properties:
  [Description](#cfn-events-rule-description): String
  [EventBusName](#cfn-events-rule-eventbusname): String
  [EventPattern](#cfn-events-rule-eventpattern): Json
  [Name](#cfn-events-rule-name): String
  [RoleArn](#cfn-events-rule-rolearn): String
  [ScheduleExpression](#cfn-events-rule-scheduleexpression): String
  [State](#cfn-events-rule-state): String
  [Tags](#cfn-events-rule-tags): 
    - Tag
  [Targets](#cfn-events-rule-targets): 
    - Target
```

## Properties
<a name="aws-resource-events-rule-properties"></a>

`Description`  <a name="cfn-events-rule-description"></a>
The description of the rule.  
*Required*: No  
*Type*: String  
*Maximum*: `512`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`EventBusName`  <a name="cfn-events-rule-eventbusname"></a>
The name or ARN of the event bus associated with the rule. If you omit this, the default event bus is used.  
*Required*: No  
*Type*: String  
*Pattern*: `[/\.\-_A-Za-z0-9]+`  
*Minimum*: `1`  
*Maximum*: `256`  
*Update requires*: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

`EventPattern`  <a name="cfn-events-rule-eventpattern"></a>
The event pattern of the rule. For more information, see [Events and Event Patterns](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html) in the * *Amazon EventBridge User Guide* *.  
*Required*: Conditional  
*Type*: Json  
*Maximum*: `4096`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Name`  <a name="cfn-events-rule-name"></a>
The name of the rule.  
*Required*: No  
*Type*: String  
*Pattern*: `[\.\-_A-Za-z0-9]+`  
*Minimum*: `1`  
*Maximum*: `64`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`RoleArn`  <a name="cfn-events-rule-rolearn"></a>
The Amazon Resource Name (ARN) of the role that is used for target invocation.  
If you're setting an event bus in another account as the target and that account granted permission to your account through an organization instead of directly by the account ID, you must specify a `RoleArn` with proper permissions in the `Target` structure, instead of here in this parameter.  
*Required*: No  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `1600`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`ScheduleExpression`  <a name="cfn-events-rule-scheduleexpression"></a>
The scheduling expression. For example, "cron(0 20 \$1 \$1 ? \$1)", "rate(5 minutes)". For more information, see [Creating an Amazon EventBridge rule that runs on a schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-create-rule-schedule.html).  
*Required*: Conditional  
*Type*: String  
*Maximum*: `256`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`State`  <a name="cfn-events-rule-state"></a>
The state of the rule.  
Valid values include:  
+ `DISABLED`: The rule is disabled. EventBridge does not match any events against the rule.
+ `ENABLED`: The rule is enabled. EventBridge matches events against the rule, *except* for AWS management events delivered through CloudTrail.
+ `ENABLED_WITH_ALL_CLOUDTRAIL_MANAGEMENT_EVENTS`: The rule is enabled for all events, including AWS management events delivered through CloudTrail.

  Management events provide visibility into management operations that are performed on resources in your AWS account. These are also known as control plane operations. For more information, see [Logging management events](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-management-events-with-cloudtrail.html#logging-management-events) in the *CloudTrail User Guide*, and [Filtering management events from AWS services](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-service-event.html#eb-service-event-cloudtrail) in the * *Amazon EventBridge User Guide* *.

  This value is only valid for rules on the [default](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-what-is-how-it-works-concepts.html#eb-bus-concepts-buses) event bus or [custom event buses](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-create-event-bus.html). It does not apply to [partner event buses](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-saas.html).
*Required*: No  
*Type*: String  
*Allowed values*: `DISABLED | ENABLED | ENABLED_WITH_ALL_CLOUDTRAIL_MANAGEMENT_EVENTS`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Tags`  <a name="cfn-events-rule-tags"></a>
Property description not available.  
*Required*: No  
*Type*: Array of [Tag](aws-properties-events-rule-tag.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Targets`  <a name="cfn-events-rule-targets"></a>
Adds the specified targets to the specified rule, or updates the targets if they are already associated with the rule.  
Targets are the resources that are invoked when a rule is triggered.  
The maximum number of entries per request is 10.  
Each rule can have up to five (5) targets associated with it at one time.
For a list of services you can configure as targets for events, see [EventBridge targets](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-targets.html) in the * *Amazon EventBridge User Guide* *.  
Creating rules with built-in targets is supported only in the AWS Management Console. The built-in targets are:  
+  `Amazon EBS CreateSnapshot API call` 
+  `Amazon EC2 RebootInstances API call` 
+  `Amazon EC2 StopInstances API call` 
+  `Amazon EC2 TerminateInstances API call` 
For some target types, `PutTargets` provides target-specific parameters. If the target is a Kinesis data stream, you can optionally specify which shard the event goes to by using the `KinesisParameters` argument. To invoke a command on multiple EC2 instances with one rule, you can use the `RunCommandParameters` field.  
To be able to make API calls against the resources that you own, Amazon EventBridge needs the appropriate permissions:   
+ For AWS Lambda and Amazon SNS resources, EventBridge relies on resource-based policies.
+ For EC2 instances, Kinesis Data Streams, AWS Step Functions state machines and API Gateway APIs, EventBridge relies on IAM roles that you specify in the `RoleARN` argument in `PutTargets`.
For more information, see [Authentication and Access Control](https://docs.aws.amazon.com/eventbridge/latest/userguide/auth-and-access-control-eventbridge.html) in the * *Amazon EventBridge User Guide* *.  
If another AWS account is in the same region and has granted you permission (using `PutPermission`), you can send events to that account. Set that account's event bus as a target of the rules in your account. To send the matched events to the other account, specify that account's event bus as the `Arn` value when you run `PutTargets`. If your account sends events to another account, your account is charged for each sent event. Each event sent to another account is charged as a custom event. The account receiving the event is not charged. For more information, see [Amazon EventBridge Pricing](https://aws.amazon.com/eventbridge/pricing/).  
`Input`, `InputPath`, and `InputTransformer` are not available with `PutTarget` if the target is an event bus of a different AWS account.
If you are setting the event bus of another account as the target, and that account granted permission to your account through an organization instead of directly by the account ID, then you must specify a `RoleArn` with proper permissions in the `Target` structure. For more information, see [Sending and Receiving Events Between AWS Accounts](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-cross-account-event-delivery.html) in the *Amazon EventBridge User Guide*.  
If you have an IAM role on a cross-account event bus target, a `PutTargets` call without a role on the same target (same `Id` and `Arn`) will not remove the role.
For more information about enabling cross-account events, see [PutPermission](https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_PutPermission.html).  
**Input**, **InputPath**, and **InputTransformer** are mutually exclusive and optional parameters of a target. When a rule is triggered due to a matched event:  
+ If none of the following arguments are specified for a target, then the entire event is passed to the target in JSON format (unless the target is Amazon EC2 Run Command or Amazon ECS task, in which case nothing from the event is passed to the target).
+ If **Input** is specified in the form of valid JSON, then the matched event is overridden with this constant.
+ If **InputPath** is specified in the form of JSONPath (for example, `$.detail`), then only the part of the event specified in the path is passed to the target (for example, only the detail part of the event is passed).
+ If **InputTransformer** is specified, then one or more specified JSONPaths are extracted from the event and used as values in a template that you specify as the input to the target.
When you specify `InputPath` or `InputTransformer`, you must use JSON dot notation, not bracket notation.  
When you add targets to a rule and the associated rule triggers soon after, new or updated targets might not be immediately invoked. Allow a short period of time for changes to take effect.  
This action can partially fail if too many requests are made at the same time. If that happens, `FailedEntryCount` is non-zero in the response and each entry in `FailedEntries` provides the ID of the failed target and the error code.  
*Required*: No  
*Type*: Array of [Target](aws-properties-events-rule-target.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Return values
<a name="aws-resource-events-rule-return-values"></a>

### Ref
<a name="aws-resource-events-rule-return-values-ref"></a>

When you pass the logical ID of this resource to the intrinsic `Ref` function, `Ref` returns event rule ID, such as `mystack-ScheduledRule-ABCDEFGHIJK`. 

For more information about using the `Ref` function, see [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html).

### Fn::GetAtt
<a name="aws-resource-events-rule-return-values-fn--getatt"></a>

#### 
<a name="aws-resource-events-rule-return-values-fn--getatt-fn--getatt"></a>

`Arn`  <a name="Arn-fn::getatt"></a>
The ARN of the rule, such as `arn:aws:events:us-east-2:123456789012:rule/example`.

## Examples
<a name="aws-resource-events-rule--examples"></a>



**Topics**
+ [Create a cross-Region rule](#aws-resource-events-rule--examples--Create_a_cross-Region_rule)
+ [Create a rule that includes a dead-letter queue for a target](#aws-resource-events-rule--examples--Create_a_rule_that_includes_a_dead-letter_queue_for_a_target)
+ [Regularly invoke Lambda function](#aws-resource-events-rule--examples--Regularly_invoke_Lambda_function)
+ [Invoke Lambda Function in Response to an Event](#aws-resource-events-rule--examples--Invoke_Lambda_Function_in_Response_to_an_Event)
+ [Notify a Topic in Response to a Log Entry](#aws-resource-events-rule--examples--Notify_a_Topic_in_Response_to_a_Log_Entry)

### Create a cross-Region rule
<a name="aws-resource-events-rule--examples--Create_a_cross-Region_rule"></a>

The following example demonstrates how to create a rule that routes events across Regions.

#### JSON
<a name="aws-resource-events-rule--examples--Create_a_cross-Region_rule--json"></a>

```
{
   "Resources": {
      "EventRuleRegion1": {
         "Type": "AWS::Events::Rule",
         "Properties": {
            "Description": "Routes to us-east-1 event bus",
            "EventBusName": "MyBusName",
            "State": "ENABLED",
            "EventPattern": {
               "source": [
                   "MyTestApp"
               ],
               "detail": [
                   "MyTestAppDetail"
               ]
            },
            "Targets": [
               {
                   "Arn": "arn:aws:events:us-east-1:123456789012:event-bus/CrossRegionDestinationBus",
                   "Id": " CrossRegionDestinationBus",
                   "RoleArn": {
                      "Fn::GetAtt": [
                         "EventBridgeIAMrole",
                         "Arn"
                      ]
                   }
               }
           ]
      }
   },
   "EventBridgeIAMrole": {
      "Type": "AWS::IAM::Role",
      "Properties": {
         "AssumeRolePolicyDocument": {
            "Version": "2012-10-17",		 	 	 
            "Statement": [
               {
                  "Effect": "Allow",
                  "Principal": {
                     "Service": {
                        "Fn::Sub": "events.amazonaws.com"
                     }
                  },
                  "Action": "sts:AssumeRole"
               }
            ]
      },
      "Path": "/",
      "Policies": [
         {
            "PolicyName": "PutEventsDestinationBus",
            "PolicyDocument": {
               "Version": "2012-10-17",		 	 	 
               "Statement": [
                  {
                     "Effect": "Allow",
                     "Action": [
                        "events:PutEvents"
                     ],
                     "Resource": [
                        "arn:aws:events:us-east-1:123456789012:event-bus/CrossRegionDestinationBus"
                     ]
                  }
               ]
            }
         }
      ]
   }
}
```

#### YAML
<a name="aws-resource-events-rule--examples--Create_a_cross-Region_rule--yaml"></a>

```
Resources:
  EventRuleRegion1:
    Type: 'AWS::Events::Rule'
    Properties:
      Description: Routes to us-east-1 event bus
      EventBusName: MyBusName
      State: ENABLED
      EventPattern:
        source:
          - MyTestApp
        detail:
          - MyTestAppDetail
      Targets:
        - Arn: >-
            arn:aws:events:us-east-1:123456789012:event-bus/CrossRegionDestinationBus
          Id: ' CrossRegionDestinationBus'
          RoleArn: !GetAtt 
            - EventBridgeIAMrole
            - Arn
  EventBridgeIAMrole:
    Type: 'AWS::IAM::Role'
    Properties:
      AssumeRolePolicyDocument:
        Version: 2012-10-17		 	 	 
        Statement:
          - Effect: Allow
            Principal:
              Service: !Sub events.amazonaws.com
            Action: 'sts:AssumeRole'
      Path: /
      Policies:
        - PolicyName: PutEventsDestinationBus
          PolicyDocument:
            Version: 2012-10-17		 	 	 
            Statement:
              - Effect: Allow
                Action:
                  - 'events:PutEvents'
                Resource:
                  - >-
                    arn:aws:events:us-east-1:123456789012:event-bus/CrossRegionDestinationBus
```

### Create a rule that includes a dead-letter queue for a target
<a name="aws-resource-events-rule--examples--Create_a_rule_that_includes_a_dead-letter_queue_for_a_target"></a>

The following example demonstrates how to send all EC2 events to an SQS queue, and include a dead-letter queue and retry policy settings for the target of the rule.

#### JSON
<a name="aws-resource-events-rule--examples--Create_a_rule_that_includes_a_dead-letter_queue_for_a_target--json"></a>

```
{
   "MyNewEventsRule": {
      "Type": "AWS::Events::Rule",
      "Properties": {
         "Description": "Test Events Rule",
         "Name": "mynewabc",
         "EventPattern": {
            "source": [
               "aws.ec2"
            ]
         },
         "State": "ENABLED",
         "Targets": [
            {
               "Arn": "arn:aws:sqs:us-west-2:081035103721:demoSQS",
               "Id": "Id1234",
               "RetryPolicy": {
                  "MaximumRetryAttempts": 4,
                  "MaximumEventAgeInSeconds": 400
               },
               "DeadLetterConfig": {
                  "Arn": "arn:aws:sqs:us-west-2:081035103721:demoDLQ"
               }
            }
         ]
      }
   }
}
```

#### YAML
<a name="aws-resource-events-rule--examples--Create_a_rule_that_includes_a_dead-letter_queue_for_a_target--yaml"></a>

```
MyNewEventsRule:
  Type: 'AWS::Events::Rule'
  Properties:
    Description: Test Events Rule
    Name: mynewabc
    EventPattern:
      source:
        - aws.ec2
    State: ENABLED
    Targets:
      - Arn: 'arn:aws:sqs:us-west-2:081035103721:demoSQS'
        Id: Id1234
        RetryPolicy:
          MaximumRetryAttempts: 4
          MaximumEventAgeInSeconds: 400
        DeadLetterConfig:
          Arn: 'arn:aws:sqs:us-west-2:081035103721:demoDLQ'
```

### Regularly invoke Lambda function
<a name="aws-resource-events-rule--examples--Regularly_invoke_Lambda_function"></a>

The following example creates a rule that invokes the specified Lambda function every 10 minutes. The `PermissionForEventsToInvokeLambda` resource grants EventBridge permission to invoke the associated function. 

#### JSON
<a name="aws-resource-events-rule--examples--Regularly_invoke_Lambda_function--json"></a>

```
"ScheduledRule": {
  "Type": "AWS::Events::Rule",
  "Properties": {
    "Description": "ScheduledRule",
    "ScheduleExpression": "rate(10 minutes)",
    "State": "ENABLED",
    "Targets": [{
      "Arn": { "Fn::GetAtt": ["LambdaFunction", "Arn"] },
      "Id": "TargetFunctionV1"
    }]
  }
},
"PermissionForEventsToInvokeLambda": {
  "Type": "AWS::Lambda::Permission",
  "Properties": {
    "FunctionName": { "Ref": "LambdaFunction" },
    "Action": "lambda:InvokeFunction",
    "Principal": "events.amazonaws.com",
    "SourceArn": { "Fn::GetAtt": ["ScheduledRule", "Arn"] }
  }
}
```

#### YAML
<a name="aws-resource-events-rule--examples--Regularly_invoke_Lambda_function--yaml"></a>

```
ScheduledRule: 
  Type: AWS::Events::Rule
  Properties: 
    Description: "ScheduledRule"
    ScheduleExpression: "rate(10 minutes)"
    State: "ENABLED"
    Targets: 
      - 
        Arn: 
          Fn::GetAtt: 
            - "LambdaFunction"
            - "Arn"
        Id: "TargetFunctionV1"
PermissionForEventsToInvokeLambda: 
  Type: AWS::Lambda::Permission
  Properties: 
    FunctionName: !Ref "LambdaFunction"
    Action: "lambda:InvokeFunction"
    Principal: "events.amazonaws.com"
    SourceArn: 
      Fn::GetAtt: 
        - "ScheduledRule"
        - "Arn"
```

### Invoke Lambda Function in Response to an Event
<a name="aws-resource-events-rule--examples--Invoke_Lambda_Function_in_Response_to_an_Event"></a>

The following example creates a rule that invokes the specified Lambda function when any EC2 instance's state changes to stopping.

#### JSON
<a name="aws-resource-events-rule--examples--Invoke_Lambda_Function_in_Response_to_an_Event--json"></a>

```
"EventRule": {
  "Type": "AWS::Events::Rule",
  "Properties": {
    "Description": "EventRule",
    "EventPattern": {
      "source": [
        "aws.ec2"
      ],
      "detail-type": [
        "EC2 Instance State-change Notification"
      ],
      "detail": {
        "state": [
          "stopping"
        ]
      }
    },
    "State": "ENABLED",
    "Targets": [{
      "Arn": { "Fn::GetAtt": ["LambdaFunction", "Arn"] },
      "Id": "TargetFunctionV1"
    }]
  }
},
"PermissionForEventsToInvokeLambda": {
  "Type": "AWS::Lambda::Permission",
  "Properties": {
    "FunctionName": { "Ref": "LambdaFunction" },
    "Action": "lambda:InvokeFunction",
    "Principal": "events.amazonaws.com",
    "SourceArn": { "Fn::GetAtt": ["EventRule", "Arn"] }
  }
}
```

#### YAML
<a name="aws-resource-events-rule--examples--Invoke_Lambda_Function_in_Response_to_an_Event--yaml"></a>

```
EventRule: 
  Type: AWS::Events::Rule
  Properties: 
    Description: "EventRule"
    EventPattern: 
      source: 
        - "aws.ec2"
      detail-type: 
        - "EC2 Instance State-change Notification"
      detail: 
        state: 
          - "stopping"
    State: "ENABLED"
    Targets: 
      - 
        Arn: 
          Fn::GetAtt: 
            - "LambdaFunction"
            - "Arn"
        Id: "TargetFunctionV1"
PermissionForEventsToInvokeLambda: 
  Type: AWS::Lambda::Permission
  Properties: 
    FunctionName: 
      Ref: "LambdaFunction"
    Action: "lambda:InvokeFunction"
    Principal: "events.amazonaws.com"
    SourceArn: 
      Fn::GetAtt: 
        - "EventRule"
        - "Arn"
```

### Notify a Topic in Response to a Log Entry
<a name="aws-resource-events-rule--examples--Notify_a_Topic_in_Response_to_a_Log_Entry"></a>

The following example creates a rule that notifies an Amazon Simple Notification Service topic if an AWS CloudTrail log entry contains a call by the root user. The `EventTopicPolicy ` resource grants Amazon EventBridge permission to notify the associated Amazon SNS topic. 

#### JSON
<a name="aws-resource-events-rule--examples--Notify_a_Topic_in_Response_to_a_Log_Entry--json"></a>

```
"OpsEventRule": {
  "Type": "AWS::Events::Rule",
  "Properties": {
    "Description": "EventRule",
    "EventPattern": {
      "detail-type": [ "AWS API Call via CloudTrail" ],
      "detail": { 
        "userIdentity": { 
          "type": [ "Root" ]
        }
      }
    },
    "State": "ENABLED",
    "Targets": [
      {
        "Arn": { "Ref": "MySNSTopic" },
        "Id": "OpsTopic"
      }
    ]
  }
}
"EventTopicPolicy": {
  "Type": "AWS::SNS::TopicPolicy",
  "Properties": {
    "PolicyDocument": {
      "Statement": [
        {
          "Effect": "Allow",
          "Principal": { "Service": "events.amazonaws.com" },
          "Action": "sns:Publish",
          "Resource": "*"
        }
      ]
    },
    "Topics": [ { "Ref": "MySNSTopic" } ]
  }
}
```

#### YAML
<a name="aws-resource-events-rule--examples--Notify_a_Topic_in_Response_to_a_Log_Entry--yaml"></a>

```
OpsEventRule: 
  Type: AWS::Events::Rule
  Properties: 
    Description: "EventRule"
    EventPattern: 
      detail-type: 
        - "AWS API Call via CloudTrail"
      detail: 
        userIdentity: 
          type: 
            - "Root"
    State: "ENABLED"
    Targets: 
      - 
        Arn: 
          Ref: "MySNSTopic"
        Id: "OpsTopic"
EventTopicPolicy:
  Type: 'AWS::SNS::TopicPolicy'
  Properties:
    PolicyDocument:
      Statement:
        - Effect: Allow
          Principal:
            Service: events.amazonaws.com
          Action: 'sns:Publish'
          Resource: '*'
    Topics:
      - !Ref MySNSTopic
```

# AWS::Events::Rule AppSyncParameters
<a name="aws-properties-events-rule-appsyncparameters"></a>

Contains the GraphQL operation to be parsed and executed, if the event target is an AWS AppSync API.

## Syntax
<a name="aws-properties-events-rule-appsyncparameters-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-events-rule-appsyncparameters-syntax.json"></a>

```
{
  "[GraphQLOperation](#cfn-events-rule-appsyncparameters-graphqloperation)" : String
}
```

### YAML
<a name="aws-properties-events-rule-appsyncparameters-syntax.yaml"></a>

```
  [GraphQLOperation](#cfn-events-rule-appsyncparameters-graphqloperation): String
```

## Properties
<a name="aws-properties-events-rule-appsyncparameters-properties"></a>

`GraphQLOperation`  <a name="cfn-events-rule-appsyncparameters-graphqloperation"></a>
The GraphQL operation; that is, the query, mutation, or subscription to be parsed and executed by the GraphQL service.  
For more information, see [Operations](https://docs.aws.amazon.com/appsync/latest/devguide/graphql-architecture.html#graphql-operations) in the *AWS AppSync User Guide*.  
*Required*: Yes  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `1048576`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::Events::Rule AwsVpcConfiguration
<a name="aws-properties-events-rule-awsvpcconfiguration"></a>

This structure specifies the VPC subnets and security groups for the task, and whether a public IP address is to be used. This structure is relevant only for ECS tasks that use the `awsvpc` network mode.

## Syntax
<a name="aws-properties-events-rule-awsvpcconfiguration-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-events-rule-awsvpcconfiguration-syntax.json"></a>

```
{
  "[AssignPublicIp](#cfn-events-rule-awsvpcconfiguration-assignpublicip)" : String,
  "[SecurityGroups](#cfn-events-rule-awsvpcconfiguration-securitygroups)" : [ String, ... ],
  "[Subnets](#cfn-events-rule-awsvpcconfiguration-subnets)" : [ String, ... ]
}
```

### YAML
<a name="aws-properties-events-rule-awsvpcconfiguration-syntax.yaml"></a>

```
  [AssignPublicIp](#cfn-events-rule-awsvpcconfiguration-assignpublicip): String
  [SecurityGroups](#cfn-events-rule-awsvpcconfiguration-securitygroups): 
    - String
  [Subnets](#cfn-events-rule-awsvpcconfiguration-subnets): 
    - String
```

## Properties
<a name="aws-properties-events-rule-awsvpcconfiguration-properties"></a>

`AssignPublicIp`  <a name="cfn-events-rule-awsvpcconfiguration-assignpublicip"></a>
Specifies whether the task's elastic network interface receives a public IP address. You can specify `ENABLED` only when `LaunchType` in `EcsParameters` is set to `FARGATE`.  
*Required*: No  
*Type*: String  
*Allowed values*: `ENABLED | DISABLED`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`SecurityGroups`  <a name="cfn-events-rule-awsvpcconfiguration-securitygroups"></a>
Specifies the security groups associated with the task. These security groups must all be in the same VPC. You can specify as many as five security groups. If you do not specify a security group, the default security group for the VPC is used.  
*Required*: No  
*Type*: Array of String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Subnets`  <a name="cfn-events-rule-awsvpcconfiguration-subnets"></a>
Specifies the subnets associated with the task. These subnets must all be in the same VPC. You can specify as many as 16 subnets.  
*Required*: Yes  
*Type*: Array of String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Examples
<a name="aws-properties-events-rule-awsvpcconfiguration--examples"></a>



### Set the AwsVpcConfiguration parameter
<a name="aws-properties-events-rule-awsvpcconfiguration--examples--Set_the_AwsVpcConfiguration_parameter"></a>

The following example sets the `AwsVpcConfiguration` parameter to not assign a public IP and set the security groups for Vpc01.

#### JSON
<a name="aws-properties-events-rule-awsvpcconfiguration--examples--Set_the_AwsVpcConfiguration_parameter--json"></a>

```
"AwsVpcConfiguration": {
  "AssignPublicIp": "DISABLED",
  "SecurityGroups": [
    {
      "Fn: : GetAtt": [
        "ScheduledFargateTaskScheduledTaskDefSecurityGroupE075BC19",
        "GroupId"
      ]
    }
  ],
  "Subnets": [
    {
      "Ref": "Vpc01"
    }
  ]
}
```

#### YAML
<a name="aws-properties-events-rule-awsvpcconfiguration--examples--Set_the_AwsVpcConfiguration_parameter--yaml"></a>

```
AwsVpcConfiguration:
  AssignPublicIp: "DISABLED"
  SecurityGroups:
    Fn: : GetAtt:
      "ScheduledFargateTaskScheduledTaskDefSecurityGroupE075BC19",
      "GroupId"
  Subnets:
    Ref: 
      "Vpc01"
```

## See also
<a name="aws-properties-events-rule-awsvpcconfiguration--seealso"></a>
+  [AwsVpcConfiguration](https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_AwsVpcConfiguration.html) 

# AWS::Events::Rule BatchArrayProperties
<a name="aws-properties-events-rule-batcharrayproperties"></a>

The array properties for the submitted job, such as the size of the array. The array size can be between 2 and 10,000. If you specify array properties for a job, it becomes an array job. This parameter is used only if the target is an AWS Batch job.

## Syntax
<a name="aws-properties-events-rule-batcharrayproperties-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-events-rule-batcharrayproperties-syntax.json"></a>

```
{
  "[Size](#cfn-events-rule-batcharrayproperties-size)" : Integer
}
```

### YAML
<a name="aws-properties-events-rule-batcharrayproperties-syntax.yaml"></a>

```
  [Size](#cfn-events-rule-batcharrayproperties-size): Integer
```

## Properties
<a name="aws-properties-events-rule-batcharrayproperties-properties"></a>

`Size`  <a name="cfn-events-rule-batcharrayproperties-size"></a>
The size of the array, if this is an array batch job. Valid values are integers between 2 and 10,000.  
*Required*: No  
*Type*: Integer  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Examples
<a name="aws-properties-events-rule-batcharrayproperties--examples"></a>



### Set the BatchArrayProperties property
<a name="aws-properties-events-rule-batcharrayproperties--examples--Set_the_BatchArrayProperties_property"></a>

The following example sets the `BatchArrayProperties` property to 950.

#### JSON
<a name="aws-properties-events-rule-batcharrayproperties--examples--Set_the_BatchArrayProperties_property--json"></a>

```
"ArrayProperties": {
  "Size": 950
}
```

#### YAML
<a name="aws-properties-events-rule-batcharrayproperties--examples--Set_the_BatchArrayProperties_property--yaml"></a>

```
ArrayProperties:
  Size: 950
```

# AWS::Events::Rule BatchParameters
<a name="aws-properties-events-rule-batchparameters"></a>

The custom parameters to be used when the target is an AWS Batch job.

## Syntax
<a name="aws-properties-events-rule-batchparameters-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-events-rule-batchparameters-syntax.json"></a>

```
{
  "[ArrayProperties](#cfn-events-rule-batchparameters-arrayproperties)" : BatchArrayProperties,
  "[JobDefinition](#cfn-events-rule-batchparameters-jobdefinition)" : String,
  "[JobName](#cfn-events-rule-batchparameters-jobname)" : String,
  "[RetryStrategy](#cfn-events-rule-batchparameters-retrystrategy)" : BatchRetryStrategy
}
```

### YAML
<a name="aws-properties-events-rule-batchparameters-syntax.yaml"></a>

```
  [ArrayProperties](#cfn-events-rule-batchparameters-arrayproperties): 
    BatchArrayProperties
  [JobDefinition](#cfn-events-rule-batchparameters-jobdefinition): String
  [JobName](#cfn-events-rule-batchparameters-jobname): String
  [RetryStrategy](#cfn-events-rule-batchparameters-retrystrategy): 
    BatchRetryStrategy
```

## Properties
<a name="aws-properties-events-rule-batchparameters-properties"></a>

`ArrayProperties`  <a name="cfn-events-rule-batchparameters-arrayproperties"></a>
The array properties for the submitted job, such as the size of the array. The array size can be between 2 and 10,000. If you specify array properties for a job, it becomes an array job. This parameter is used only if the target is an AWS Batch job.  
*Required*: No  
*Type*: [BatchArrayProperties](aws-properties-events-rule-batcharrayproperties.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`JobDefinition`  <a name="cfn-events-rule-batchparameters-jobdefinition"></a>
The ARN or name of the job definition to use if the event target is an AWS Batch job. This job definition must already exist.  
*Required*: Yes  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`JobName`  <a name="cfn-events-rule-batchparameters-jobname"></a>
The name to use for this execution of the job, if the target is an AWS Batch job.  
*Required*: Yes  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`RetryStrategy`  <a name="cfn-events-rule-batchparameters-retrystrategy"></a>
The retry strategy to use for failed jobs, if the target is an AWS Batch job. The retry strategy is the number of times to retry the failed job execution. Valid values are 1–10. When you specify a retry strategy here, it overrides the retry strategy defined in the job definition.  
*Required*: No  
*Type*: [BatchRetryStrategy](aws-properties-events-rule-batchretrystrategy.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Examples
<a name="aws-properties-events-rule-batchparameters--examples"></a>



### Set the BatchParameters parameters
<a name="aws-properties-events-rule-batchparameters--examples--Set_the_BatchParameters_parameters"></a>

The following example sets the `BatchParameters` parameter for a job that has 950 objects and will be tried 8 times.

#### JSON
<a name="aws-properties-events-rule-batchparameters--examples--Set_the_BatchParameters_parameters--json"></a>

```
"BatchParameters": {
  "ArrayProperties": {
      "Size": 950
   },
  "JobDefinition": "NewBatchJobDefinition",
  "JobName": "Job1",
  "RetryStrategy": {
      "Attempts": 8
   }
}
```

#### YAML
<a name="aws-properties-events-rule-batchparameters--examples--Set_the_BatchParameters_parameters--yaml"></a>

```
BatchParameters:
  ArrayProperties:
    Size: 950
  JobDefinition: NewBatchJobDefinition
  JobName: Job1
  RetryStrategy:
    Attempts: 8
```

# AWS::Events::Rule BatchRetryStrategy
<a name="aws-properties-events-rule-batchretrystrategy"></a>

The retry strategy to use for failed jobs, if the target is an AWS Batch job. If you specify a retry strategy here, it overrides the retry strategy defined in the job definition.

## Syntax
<a name="aws-properties-events-rule-batchretrystrategy-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-events-rule-batchretrystrategy-syntax.json"></a>

```
{
  "[Attempts](#cfn-events-rule-batchretrystrategy-attempts)" : Integer
}
```

### YAML
<a name="aws-properties-events-rule-batchretrystrategy-syntax.yaml"></a>

```
  [Attempts](#cfn-events-rule-batchretrystrategy-attempts): Integer
```

## Properties
<a name="aws-properties-events-rule-batchretrystrategy-properties"></a>

`Attempts`  <a name="cfn-events-rule-batchretrystrategy-attempts"></a>
The number of times to attempt to retry, if the job fails. Valid values are 1–10.  
*Required*: No  
*Type*: Integer  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Examples
<a name="aws-properties-events-rule-batchretrystrategy--examples"></a>



### Set the BatchRetryStrategy property
<a name="aws-properties-events-rule-batchretrystrategy--examples--Set_the_BatchRetryStrategy_property"></a>

The following example sets the `BatchRetryStrategy` property to 8 retries.

#### JSON
<a name="aws-properties-events-rule-batchretrystrategy--examples--Set_the_BatchRetryStrategy_property--json"></a>

```
"RetryStrategy": {
  "Attempts": 8
}
```

#### YAML
<a name="aws-properties-events-rule-batchretrystrategy--examples--Set_the_BatchRetryStrategy_property--yaml"></a>

```
RetryStrategy
  Attempts: 8
```

# AWS::Events::Rule CapacityProviderStrategyItem
<a name="aws-properties-events-rule-capacityproviderstrategyitem"></a>

The details of a capacity provider strategy. To learn more, see [CapacityProviderStrategyItem](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CapacityProviderStrategyItem.html) in the Amazon ECS API Reference.

## Syntax
<a name="aws-properties-events-rule-capacityproviderstrategyitem-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-events-rule-capacityproviderstrategyitem-syntax.json"></a>

```
{
  "[Base](#cfn-events-rule-capacityproviderstrategyitem-base)" : Integer,
  "[CapacityProvider](#cfn-events-rule-capacityproviderstrategyitem-capacityprovider)" : String,
  "[Weight](#cfn-events-rule-capacityproviderstrategyitem-weight)" : Integer
}
```

### YAML
<a name="aws-properties-events-rule-capacityproviderstrategyitem-syntax.yaml"></a>

```
  [Base](#cfn-events-rule-capacityproviderstrategyitem-base): Integer
  [CapacityProvider](#cfn-events-rule-capacityproviderstrategyitem-capacityprovider): String
  [Weight](#cfn-events-rule-capacityproviderstrategyitem-weight): Integer
```

## Properties
<a name="aws-properties-events-rule-capacityproviderstrategyitem-properties"></a>

`Base`  <a name="cfn-events-rule-capacityproviderstrategyitem-base"></a>
The base value designates how many tasks, at a minimum, to run on the specified capacity provider. Only one capacity provider in a capacity provider strategy can have a base defined. If no value is specified, the default value of 0 is used.   
*Required*: No  
*Type*: Integer  
*Minimum*: `0`  
*Maximum*: `100000`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`CapacityProvider`  <a name="cfn-events-rule-capacityproviderstrategyitem-capacityprovider"></a>
The short name of the capacity provider.  
*Required*: Yes  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `255`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Weight`  <a name="cfn-events-rule-capacityproviderstrategyitem-weight"></a>
The weight value designates the relative percentage of the total number of tasks launched that should use the specified capacity provider. The weight value is taken into consideration after the base value, if defined, is satisfied.  
*Required*: No  
*Type*: Integer  
*Minimum*: `0`  
*Maximum*: `1000`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Examples
<a name="aws-properties-events-rule-capacityproviderstrategyitem--examples"></a>



### Set the CapacityProviderStrategyItem property
<a name="aws-properties-events-rule-capacityproviderstrategyitem--examples--Set_the_CapacityProviderStrategyItem_property"></a>

The following example sets the `CapacityProviderStrategyItem` property to run a minimum of 10 tasks on CapacityProvider1.

#### JSON
<a name="aws-properties-events-rule-capacityproviderstrategyitem--examples--Set_the_CapacityProviderStrategyItem_property--json"></a>

```
"CapacityProviderStrategy": {
  "Base": 10,
  "CapacityProvider": "CapacityProvider1",
  "Weight": 0
}
```

#### YAML
<a name="aws-properties-events-rule-capacityproviderstrategyitem--examples--Set_the_CapacityProviderStrategyItem_property--yaml"></a>

```
CapacityProviderStrategy
  Base: 10
  CapacityProvider: CapacityProvider1
  Weight: 0
```

# AWS::Events::Rule DeadLetterConfig
<a name="aws-properties-events-rule-deadletterconfig"></a>

Configuration details of the Amazon SQS queue for EventBridge to use as a dead-letter queue (DLQ).

For more information, see [Using dead-letter queues to process undelivered events](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-rule-event-delivery.html#eb-rule-dlq) in the *EventBridge User Guide*.

## Syntax
<a name="aws-properties-events-rule-deadletterconfig-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-events-rule-deadletterconfig-syntax.json"></a>

```
{
  "[Arn](#cfn-events-rule-deadletterconfig-arn)" : String
}
```

### YAML
<a name="aws-properties-events-rule-deadletterconfig-syntax.yaml"></a>

```
  [Arn](#cfn-events-rule-deadletterconfig-arn): String
```

## Properties
<a name="aws-properties-events-rule-deadletterconfig-properties"></a>

`Arn`  <a name="cfn-events-rule-deadletterconfig-arn"></a>
The ARN of the SQS queue specified as the target for the dead-letter queue.  
*Required*: No  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `1600`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Examples
<a name="aws-properties-events-rule-deadletterconfig--examples"></a>



### Set the DeadLetterConfig parameter
<a name="aws-properties-events-rule-deadletterconfig--examples--Set_the_DeadLetterConfig_parameter"></a>

The following example sets the `DeadLetterConfig` parameter to set up arn:aws:sqs:us-west-2:081035103721:demoDLQ as a dead-letter queue.

#### JSON
<a name="aws-properties-events-rule-deadletterconfig--examples--Set_the_DeadLetterConfig_parameter--json"></a>

```
"DeadLetterConfig": {
  "Arn": "arn:aws:sqs:us-west-2:081035103721:demoDLQ"
}
```

#### YAML
<a name="aws-properties-events-rule-deadletterconfig--examples--Set_the_DeadLetterConfig_parameter--yaml"></a>

```
DeadLetterConfig:
  Arn: 'arn:aws:sqs:us-west-2:081035103721:demoDLQ'
```

# AWS::Events::Rule EcsParameters
<a name="aws-properties-events-rule-ecsparameters"></a>

The custom parameters to be used when the target is an Amazon ECS task.

## Syntax
<a name="aws-properties-events-rule-ecsparameters-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-events-rule-ecsparameters-syntax.json"></a>

```
{
  "[CapacityProviderStrategy](#cfn-events-rule-ecsparameters-capacityproviderstrategy)" : [ CapacityProviderStrategyItem, ... ],
  "[EnableECSManagedTags](#cfn-events-rule-ecsparameters-enableecsmanagedtags)" : Boolean,
  "[EnableExecuteCommand](#cfn-events-rule-ecsparameters-enableexecutecommand)" : Boolean,
  "[Group](#cfn-events-rule-ecsparameters-group)" : String,
  "[LaunchType](#cfn-events-rule-ecsparameters-launchtype)" : String,
  "[NetworkConfiguration](#cfn-events-rule-ecsparameters-networkconfiguration)" : NetworkConfiguration,
  "[PlacementConstraints](#cfn-events-rule-ecsparameters-placementconstraints)" : [ PlacementConstraint, ... ],
  "[PlacementStrategies](#cfn-events-rule-ecsparameters-placementstrategies)" : [ PlacementStrategy, ... ],
  "[PlatformVersion](#cfn-events-rule-ecsparameters-platformversion)" : String,
  "[PropagateTags](#cfn-events-rule-ecsparameters-propagatetags)" : String,
  "[ReferenceId](#cfn-events-rule-ecsparameters-referenceid)" : String,
  "[TagList](#cfn-events-rule-ecsparameters-taglist)" : [ Tag, ... ],
  "[TaskCount](#cfn-events-rule-ecsparameters-taskcount)" : Integer,
  "[TaskDefinitionArn](#cfn-events-rule-ecsparameters-taskdefinitionarn)" : String
}
```

### YAML
<a name="aws-properties-events-rule-ecsparameters-syntax.yaml"></a>

```
  [CapacityProviderStrategy](#cfn-events-rule-ecsparameters-capacityproviderstrategy): 
    - CapacityProviderStrategyItem
  [EnableECSManagedTags](#cfn-events-rule-ecsparameters-enableecsmanagedtags): Boolean
  [EnableExecuteCommand](#cfn-events-rule-ecsparameters-enableexecutecommand): Boolean
  [Group](#cfn-events-rule-ecsparameters-group): String
  [LaunchType](#cfn-events-rule-ecsparameters-launchtype): String
  [NetworkConfiguration](#cfn-events-rule-ecsparameters-networkconfiguration): 
    NetworkConfiguration
  [PlacementConstraints](#cfn-events-rule-ecsparameters-placementconstraints): 
    - PlacementConstraint
  [PlacementStrategies](#cfn-events-rule-ecsparameters-placementstrategies): 
    - PlacementStrategy
  [PlatformVersion](#cfn-events-rule-ecsparameters-platformversion): String
  [PropagateTags](#cfn-events-rule-ecsparameters-propagatetags): String
  [ReferenceId](#cfn-events-rule-ecsparameters-referenceid): String
  [TagList](#cfn-events-rule-ecsparameters-taglist): 
    - Tag
  [TaskCount](#cfn-events-rule-ecsparameters-taskcount): Integer
  [TaskDefinitionArn](#cfn-events-rule-ecsparameters-taskdefinitionarn): String
```

## Properties
<a name="aws-properties-events-rule-ecsparameters-properties"></a>

`CapacityProviderStrategy`  <a name="cfn-events-rule-ecsparameters-capacityproviderstrategy"></a>
The capacity provider strategy to use for the task.  
If a `capacityProviderStrategy` is specified, the `launchType` parameter must be omitted. If no `capacityProviderStrategy` or launchType is specified, the `defaultCapacityProviderStrategy` for the cluster is used.   
*Required*: No  
*Type*: Array of [CapacityProviderStrategyItem](aws-properties-events-rule-capacityproviderstrategyitem.md)  
*Maximum*: `6`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`EnableECSManagedTags`  <a name="cfn-events-rule-ecsparameters-enableecsmanagedtags"></a>
Specifies whether to enable Amazon ECS managed tags for the task. For more information, see [Tagging Your Amazon ECS Resources](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html) in the Amazon Elastic Container Service Developer Guide.   
*Required*: No  
*Type*: Boolean  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`EnableExecuteCommand`  <a name="cfn-events-rule-ecsparameters-enableexecutecommand"></a>
Whether or not to enable the execute command functionality for the containers in this task. If true, this enables execute command functionality on all containers in the task.  
*Required*: No  
*Type*: Boolean  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Group`  <a name="cfn-events-rule-ecsparameters-group"></a>
Specifies an ECS task group for the task. The maximum length is 255 characters.  
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`LaunchType`  <a name="cfn-events-rule-ecsparameters-launchtype"></a>
Specifies the launch type on which your task is running. The launch type that you specify here must match one of the launch type (compatibilities) of the target task. The `FARGATE` value is supported only in the Regions where AWS Fargate with Amazon ECS is supported. For more information, see [AWS Fargate on Amazon ECS](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/AWS-Fargate.html) in the *Amazon Elastic Container Service Developer Guide*.  
*Required*: No  
*Type*: String  
*Allowed values*: `EC2 | FARGATE | EXTERNAL`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`NetworkConfiguration`  <a name="cfn-events-rule-ecsparameters-networkconfiguration"></a>
Use this structure if the Amazon ECS task uses the `awsvpc` network mode. This structure specifies the VPC subnets and security groups associated with the task, and whether a public IP address is to be used. This structure is required if `LaunchType` is `FARGATE` because the `awsvpc` mode is required for Fargate tasks.  
If you specify `NetworkConfiguration` when the target ECS task does not use the `awsvpc` network mode, the task fails.  
*Required*: No  
*Type*: [NetworkConfiguration](aws-properties-events-rule-networkconfiguration.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`PlacementConstraints`  <a name="cfn-events-rule-ecsparameters-placementconstraints"></a>
An array of placement constraint objects to use for the task. You can specify up to 10 constraints per task (including constraints in the task definition and those specified at runtime).  
*Required*: No  
*Type*: Array of [PlacementConstraint](aws-properties-events-rule-placementconstraint.md)  
*Maximum*: `10`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`PlacementStrategies`  <a name="cfn-events-rule-ecsparameters-placementstrategies"></a>
The placement strategy objects to use for the task. You can specify a maximum of five strategy rules per task.   
*Required*: No  
*Type*: Array of [PlacementStrategy](aws-properties-events-rule-placementstrategy.md)  
*Maximum*: `5`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`PlatformVersion`  <a name="cfn-events-rule-ecsparameters-platformversion"></a>
Specifies the platform version for the task. Specify only the numeric portion of the platform version, such as `1.1.0`.  
This structure is used only if `LaunchType` is `FARGATE`. For more information about valid platform versions, see [AWS Fargate Platform Versions](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html) in the *Amazon Elastic Container Service Developer Guide*.  
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`PropagateTags`  <a name="cfn-events-rule-ecsparameters-propagatetags"></a>
Specifies whether to propagate the tags from the task definition to the task. If no value is specified, the tags are not propagated. Tags can only be propagated to the task during task creation. To add tags to a task after task creation, use the TagResource API action.   
*Required*: No  
*Type*: String  
*Allowed values*: `TASK_DEFINITION`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`ReferenceId`  <a name="cfn-events-rule-ecsparameters-referenceid"></a>
The reference ID to use for the task.  
*Required*: No  
*Type*: String  
*Maximum*: `1024`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`TagList`  <a name="cfn-events-rule-ecsparameters-taglist"></a>
The metadata that you apply to the task to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. To learn more, see [RunTask](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_RunTask.html#ECS-RunTask-request-tags) in the Amazon ECS API Reference.  
*Required*: No  
*Type*: Array of [Tag](aws-properties-events-rule-tag.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`TaskCount`  <a name="cfn-events-rule-ecsparameters-taskcount"></a>
The number of tasks to create based on `TaskDefinition`. The default is 1.  
*Required*: No  
*Type*: Integer  
*Minimum*: `1`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`TaskDefinitionArn`  <a name="cfn-events-rule-ecsparameters-taskdefinitionarn"></a>
The ARN of the task definition to use if the event target is an Amazon ECS task.   
*Required*: Yes  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `1600`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Examples
<a name="aws-properties-events-rule-ecsparameters--examples"></a>



### ECS example
<a name="aws-properties-events-rule-ecsparameters--examples--ECS_example"></a>

The following example defines the ECS parameters.

#### JSON
<a name="aws-properties-events-rule-ecsparameters--examples--ECS_example--json"></a>

```
{
  "LaunchType": "FARGATE",
  "NetworkConfiguration": {
    "AwsVpcConfiguration": {
      "AssignPublicIp": "DISABLED",
      "SecurityGroups": [
        {
          "Fn: : GetAtt": [
            "ScheduledFargateTaskScheduledTaskDefSecurityGroupE075BC19",
            "GroupId"
          ]
        }
      ],
      "Subnets": [
        {
          "Ref": "Vpc01"
        }
      ]
    }
  },
  "TaskCount": 2,
  "TaskDefinitionArn": {
     "Ref": "ScheduledFargateTaskScheduledTaskDef521FA675"
  },
  "enableECSManagedTags": true,
  "placementConstraints": [ 
    { 
        "expression": "attribute:ecs.instance-type == t2.small",
        "type": "memberOf"
    }
  ],
  "placementStrategy": [ 
  { 
     "field": "instanceId",
     "type ": "binpack"
  }
  ],
  "propagateTags": "TASK_DEFINITION",
  "referenceId": "idopsks",
  "startedBy": "user1",
  "tags": [ 
      { 
          "key": "maintask",
          "value ": "taskvalue"
      }
  ]
}
```

#### YAML
<a name="aws-properties-events-rule-ecsparameters--examples--ECS_example--yaml"></a>

```
LaunchType: "FARGATE"
NetworkConfiguration:
  AwsVpcConfiguration:
    AssignPublicIp: "DISABLED"
    SecurityGroups:
      Fn: : GetAtt:
        "ScheduledFargateTaskScheduledTaskDefSecurityGroupE075BC19",
        "GroupId"
    Subnets:
      Ref: 
        "Vpc01"
TaskCount: 2
TaskDefinitionArn:
  Ref: 
    "ScheduledFargateTaskScheduledTaskDef521FA675"
enableECSManagedTags: true
placementConstraints:  
  expression: 
    "attribute:ecs.instance-type == t2.small"
  type: 
    "memberOf"
placementStrategy: 
  field: 
    "instanceId"
  type: 
    "binpack"
propagateTags: 
  "TASK_DEFINITION"
referenceId: 
  "idopsks"
startedBy: 
  "user1"
tags:
  key: 
    "maintask"
  value: 
    "taskvalue"
```

# AWS::Events::Rule HttpParameters
<a name="aws-properties-events-rule-httpparameters"></a>

These are custom parameter to be used when the target is an API Gateway APIs or EventBridge ApiDestinations. In the latter case, these are merged with any InvocationParameters specified on the Connection, with any values from the Connection taking precedence.

## Syntax
<a name="aws-properties-events-rule-httpparameters-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-events-rule-httpparameters-syntax.json"></a>

```
{
  "[HeaderParameters](#cfn-events-rule-httpparameters-headerparameters)" : {Key: Value, ...},
  "[PathParameterValues](#cfn-events-rule-httpparameters-pathparametervalues)" : [ String, ... ],
  "[QueryStringParameters](#cfn-events-rule-httpparameters-querystringparameters)" : {Key: Value, ...}
}
```

### YAML
<a name="aws-properties-events-rule-httpparameters-syntax.yaml"></a>

```
  [HeaderParameters](#cfn-events-rule-httpparameters-headerparameters): 
    Key: Value
  [PathParameterValues](#cfn-events-rule-httpparameters-pathparametervalues): 
    - String
  [QueryStringParameters](#cfn-events-rule-httpparameters-querystringparameters): 
    Key: Value
```

## Properties
<a name="aws-properties-events-rule-httpparameters-properties"></a>

`HeaderParameters`  <a name="cfn-events-rule-httpparameters-headerparameters"></a>
The headers that need to be sent as part of request invoking the API Gateway API or EventBridge ApiDestination.  
*Required*: No  
*Type*: Object of String  
*Pattern*: `[a-zA-Z0-9]+`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`PathParameterValues`  <a name="cfn-events-rule-httpparameters-pathparametervalues"></a>
The path parameter values to be used to populate API Gateway API or EventBridge ApiDestination path wildcards ("\$1").  
*Required*: No  
*Type*: Array of String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`QueryStringParameters`  <a name="cfn-events-rule-httpparameters-querystringparameters"></a>
The query string keys/values that need to be sent as part of request invoking the API Gateway API or EventBridge ApiDestination.  
*Required*: No  
*Type*: Object of String  
*Pattern*: `[a-zA-Z0-9]+`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::Events::Rule InputTransformer
<a name="aws-properties-events-rule-inputtransformer"></a>

Contains the parameters needed for you to provide custom input to a target based on one or more pieces of data extracted from the event.

## Syntax
<a name="aws-properties-events-rule-inputtransformer-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-events-rule-inputtransformer-syntax.json"></a>

```
{
  "[InputPathsMap](#cfn-events-rule-inputtransformer-inputpathsmap)" : {Key: Value, ...},
  "[InputTemplate](#cfn-events-rule-inputtransformer-inputtemplate)" : String
}
```

### YAML
<a name="aws-properties-events-rule-inputtransformer-syntax.yaml"></a>

```
  [InputPathsMap](#cfn-events-rule-inputtransformer-inputpathsmap): 
    Key: Value
  [InputTemplate](#cfn-events-rule-inputtransformer-inputtemplate): String
```

## Properties
<a name="aws-properties-events-rule-inputtransformer-properties"></a>

`InputPathsMap`  <a name="cfn-events-rule-inputtransformer-inputpathsmap"></a>
Map of JSON paths to be extracted from the event. You can then insert these in the template in `InputTemplate` to produce the output you want to be sent to the target.  
`InputPathsMap` is an array key-value pairs, where each value is a valid JSON path. You can have as many as 100 key-value pairs. You must use JSON dot notation, not bracket notation.  
The keys cannot start with "AWS."   
*Required*: No  
*Type*: Object of String  
*Pattern*: `[a-zA-Z0-9]+`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`InputTemplate`  <a name="cfn-events-rule-inputtransformer-inputtemplate"></a>
Input template where you specify placeholders that will be filled with the values of the keys from `InputPathsMap` to customize the data sent to the target. Enclose each `InputPathsMaps` value in brackets: <*value*>   
If `InputTemplate` is a JSON object (surrounded by curly braces), the following restrictions apply:  
+ The placeholder cannot be used as an object key.
The following example shows the syntax for using `InputPathsMap` and `InputTemplate`.  
 ` "InputTransformer":`   
 `{`   
 `"InputPathsMap": {"instance": "$.detail.instance","status": "$.detail.status"},`   
 `"InputTemplate": "<instance> is in state <status>"`   
 `}`   
To have the `InputTemplate` include quote marks within a JSON string, escape each quote marks with a slash, as in the following example:  
 ` "InputTransformer":`   
 `{`   
 `"InputPathsMap": {"instance": "$.detail.instance","status": "$.detail.status"},`   
 `"InputTemplate": "<instance> is in state \"<status>\""`   
 `}`   
The `InputTemplate` can also be valid JSON with varibles in quotes or out, as in the following example:  
 ` "InputTransformer":`   
 `{`   
 `"InputPathsMap": {"instance": "$.detail.instance","status": "$.detail.status"},`   
 `"InputTemplate": '{"myInstance": <instance>,"myStatus": "<instance> is in state \"<status>\""}'`   
 `}`   
*Required*: Yes  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `8192`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Examples
<a name="aws-properties-events-rule-inputtransformer--examples"></a>



**Topics**
+ [Transform input into a string](#aws-properties-events-rule-inputtransformer--examples--Transform_input_into_a_string)
+ [Transform input into JSON](#aws-properties-events-rule-inputtransformer--examples--Transform_input_into_JSON)
+ [Transform input and substitute a variable](#aws-properties-events-rule-inputtransformer--examples--Transform_input_and_substitute_a_variable)

### Transform input into a string
<a name="aws-properties-events-rule-inputtransformer--examples--Transform_input_into_a_string"></a>

The following example takes `instance` and `state` and outputs a string. 

#### JSON
<a name="aws-properties-events-rule-inputtransformer--examples--Transform_input_into_a_string--json"></a>

```
"InputTransformer": {
    "InputPathsMap": {
       "instance": "$.detail.instance-id",
       "state": "$.detail.state"
    },
    "InputTemplate": "\"instance <instance> is in <state>\"\n  }\n"
}
```

#### YAML
<a name="aws-properties-events-rule-inputtransformer--examples--Transform_input_into_a_string--yaml"></a>

```
InputTransformer:
  InputPathsMap:
    "instance" : "$.detail.instance-id"
    "state" : "$.detail.state"
  InputTemplate: |
    "instance <instance> is in <state>"
```

### Transform input into JSON
<a name="aws-properties-events-rule-inputtransformer--examples--Transform_input_into_JSON"></a>

The following example takes `instance` and `state` and outputs JSON that includes strings and variables.

#### JSON
<a name="aws-properties-events-rule-inputtransformer--examples--Transform_input_into_JSON--json"></a>

```
"InputTransformer": {
    "InputPathsMap": {
       "instance": "$.detail.instance-id",
       "state": "$.detail.state"
    },
    "InputTemplate": "{\n   \"instance\" : <instance>,\n   \"state\" : <state>,\n   \"instanceStatus\": \"instance \\\"<instance>\\\" is in <state>\"\n}\n"
}
```

#### YAML
<a name="aws-properties-events-rule-inputtransformer--examples--Transform_input_into_JSON--yaml"></a>

```
InputTransformer:
  InputPathsMap:
    "instance" : "$.detail.instance-id"
    "state" : "$.detail.state"
  InputTemplate: |
    {
       "instance" : <instance>,
       "state" : <state>,
       "instanceStatus": "instance \"<instance>\" is in <state>"
    }
```

### Transform input and substitute a variable
<a name="aws-properties-events-rule-inputtransformer--examples--Transform_input_and_substitute_a_variable"></a>

The following example defines a variable `RootDomainName`. It then takes `instance` and `state`, substitutes `RootDomainName` for `domain`, and outputs JSON.

#### JSON
<a name="aws-properties-events-rule-inputtransformer--examples--Transform_input_and_substitute_a_variable--json"></a>

```
"Parameters": {
    "RootDomainName": {
        "Description": "Domain name to use",
        "Type": "String",
        "Default": "testdomain.com"
    }
},
```

#### JSON
<a name="aws-properties-events-rule-inputtransformer--examples--Transform_input_and_substitute_a_variable--json"></a>

```
"InputTransformer": {
    "InputPathsMap": {
       "instance": "$.detail.instance-id",
       "state": "$.detail.state"
    },
    "InputTemplate": {
        "Fn::Sub": [
            "{\n   \"domain\": \"${Domain}\",\n   \"instance\" : <instance>,\n   \"state\" : <state>,\n   \"instanceStatus\": \"instance \\\"<instance>\\\" is in <state>\"\n} - ( Domain: !Ref RootDomainName )\n"
        ]
    }
}
```

#### YAML
<a name="aws-properties-events-rule-inputtransformer--examples--Transform_input_and_substitute_a_variable--yaml"></a>

```
Parameters:
  RootDomainName:
    Description: Domain name to use
    Type: String
    Default: testdomain.com
```

#### YAML
<a name="aws-properties-events-rule-inputtransformer--examples--Transform_input_and_substitute_a_variable--yaml"></a>

```
InputTransformer:
  InputPathsMap:
    "instance" : "$.detail.instance-id"
    "state" : "$.detail.state"
  InputTemplate: !Sub 
    - |
      {
         "domain": "${Domain}",
         "instance" : <instance>,
         "state" : <state>,
         "instanceStatus": "instance \"<instance>\" is in <state>"
      }
    - Domain: !Ref RootDomainName
```

# AWS::Events::Rule KinesisParameters
<a name="aws-properties-events-rule-kinesisparameters"></a>

This object enables you to specify a JSON path to extract from the event and use as the partition key for the Amazon Kinesis data stream, so that you can control the shard to which the event goes. If you do not include this parameter, the default is to use the `eventId` as the partition key.

## Syntax
<a name="aws-properties-events-rule-kinesisparameters-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-events-rule-kinesisparameters-syntax.json"></a>

```
{
  "[PartitionKeyPath](#cfn-events-rule-kinesisparameters-partitionkeypath)" : String
}
```

### YAML
<a name="aws-properties-events-rule-kinesisparameters-syntax.yaml"></a>

```
  [PartitionKeyPath](#cfn-events-rule-kinesisparameters-partitionkeypath): String
```

## Properties
<a name="aws-properties-events-rule-kinesisparameters-properties"></a>

`PartitionKeyPath`  <a name="cfn-events-rule-kinesisparameters-partitionkeypath"></a>
The JSON path to be extracted from the event and used as the partition key. For more information, see [Amazon Kinesis Streams Key Concepts](https://docs.aws.amazon.com/streams/latest/dev/key-concepts.html#partition-key) in the *Amazon Kinesis Streams Developer Guide*.  
*Required*: Yes  
*Type*: String  
*Maximum*: `256`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::Events::Rule NetworkConfiguration
<a name="aws-properties-events-rule-networkconfiguration"></a>

This structure specifies the network configuration for an ECS task.

## Syntax
<a name="aws-properties-events-rule-networkconfiguration-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-events-rule-networkconfiguration-syntax.json"></a>

```
{
  "[AwsVpcConfiguration](#cfn-events-rule-networkconfiguration-awsvpcconfiguration)" : AwsVpcConfiguration
}
```

### YAML
<a name="aws-properties-events-rule-networkconfiguration-syntax.yaml"></a>

```
  [AwsVpcConfiguration](#cfn-events-rule-networkconfiguration-awsvpcconfiguration): 
    AwsVpcConfiguration
```

## Properties
<a name="aws-properties-events-rule-networkconfiguration-properties"></a>

`AwsVpcConfiguration`  <a name="cfn-events-rule-networkconfiguration-awsvpcconfiguration"></a>
Use this structure to specify the VPC subnets and security groups for the task, and whether a public IP address is to be used. This structure is relevant only for ECS tasks that use the `awsvpc` network mode.  
*Required*: No  
*Type*: [AwsVpcConfiguration](aws-properties-events-rule-awsvpcconfiguration.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## See also
<a name="aws-properties-events-rule-networkconfiguration--seealso"></a>
+  [NetworkConfiguration](https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_NetworkConfiguration.html) 

# AWS::Events::Rule PlacementConstraint
<a name="aws-properties-events-rule-placementconstraint"></a>

An object representing a constraint on task placement. To learn more, see [Task Placement Constraints](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-constraints.html) in the Amazon Elastic Container Service Developer Guide.

## Syntax
<a name="aws-properties-events-rule-placementconstraint-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-events-rule-placementconstraint-syntax.json"></a>

```
{
  "[Expression](#cfn-events-rule-placementconstraint-expression)" : String,
  "[Type](#cfn-events-rule-placementconstraint-type)" : String
}
```

### YAML
<a name="aws-properties-events-rule-placementconstraint-syntax.yaml"></a>

```
  [Expression](#cfn-events-rule-placementconstraint-expression): String
  [Type](#cfn-events-rule-placementconstraint-type): String
```

## Properties
<a name="aws-properties-events-rule-placementconstraint-properties"></a>

`Expression`  <a name="cfn-events-rule-placementconstraint-expression"></a>
A cluster query language expression to apply to the constraint. You cannot specify an expression if the constraint type is `distinctInstance`. To learn more, see [Cluster Query Language](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-query-language.html) in the Amazon Elastic Container Service Developer Guide.   
*Required*: No  
*Type*: String  
*Maximum*: `2000`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Type`  <a name="cfn-events-rule-placementconstraint-type"></a>
The type of constraint. Use distinctInstance to ensure that each task in a particular group is running on a different container instance. Use memberOf to restrict the selection to a group of valid candidates.   
*Required*: No  
*Type*: String  
*Allowed values*: `distinctInstance | memberOf`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::Events::Rule PlacementStrategy
<a name="aws-properties-events-rule-placementstrategy"></a>

The task placement strategy for a task or service. To learn more, see [Task Placement Strategies](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-strategies.html) in the Amazon Elastic Container Service Service Developer Guide.

## Syntax
<a name="aws-properties-events-rule-placementstrategy-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-events-rule-placementstrategy-syntax.json"></a>

```
{
  "[Field](#cfn-events-rule-placementstrategy-field)" : String,
  "[Type](#cfn-events-rule-placementstrategy-type)" : String
}
```

### YAML
<a name="aws-properties-events-rule-placementstrategy-syntax.yaml"></a>

```
  [Field](#cfn-events-rule-placementstrategy-field): String
  [Type](#cfn-events-rule-placementstrategy-type): String
```

## Properties
<a name="aws-properties-events-rule-placementstrategy-properties"></a>

`Field`  <a name="cfn-events-rule-placementstrategy-field"></a>
The field to apply the placement strategy against. For the spread placement strategy, valid values are instanceId (or host, which has the same effect), or any platform or custom attribute that is applied to a container instance, such as attribute:ecs.availability-zone. For the binpack placement strategy, valid values are cpu and memory. For the random placement strategy, this field is not used.   
*Required*: No  
*Type*: String  
*Maximum*: `255`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Type`  <a name="cfn-events-rule-placementstrategy-type"></a>
The type of placement strategy. The random placement strategy randomly places tasks on available candidates. The spread placement strategy spreads placement across available candidates evenly based on the field parameter. The binpack strategy places tasks on available candidates that have the least available amount of the resource that is specified with the field parameter. For example, if you binpack on memory, a task is placed on the instance with the least amount of remaining memory (but still enough to run the task).   
*Required*: No  
*Type*: String  
*Allowed values*: `random | spread | binpack`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::Events::Rule RedshiftDataParameters
<a name="aws-properties-events-rule-redshiftdataparameters"></a>

These are custom parameters to be used when the target is a Amazon Redshift cluster to invoke the Amazon Redshift Data API ExecuteStatement based on EventBridge events.

## Syntax
<a name="aws-properties-events-rule-redshiftdataparameters-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-events-rule-redshiftdataparameters-syntax.json"></a>

```
{
  "[Database](#cfn-events-rule-redshiftdataparameters-database)" : String,
  "[DbUser](#cfn-events-rule-redshiftdataparameters-dbuser)" : String,
  "[SecretManagerArn](#cfn-events-rule-redshiftdataparameters-secretmanagerarn)" : String,
  "[Sql](#cfn-events-rule-redshiftdataparameters-sql)" : String,
  "[Sqls](#cfn-events-rule-redshiftdataparameters-sqls)" : [ String, ... ],
  "[StatementName](#cfn-events-rule-redshiftdataparameters-statementname)" : String,
  "[WithEvent](#cfn-events-rule-redshiftdataparameters-withevent)" : Boolean
}
```

### YAML
<a name="aws-properties-events-rule-redshiftdataparameters-syntax.yaml"></a>

```
  [Database](#cfn-events-rule-redshiftdataparameters-database): String
  [DbUser](#cfn-events-rule-redshiftdataparameters-dbuser): String
  [SecretManagerArn](#cfn-events-rule-redshiftdataparameters-secretmanagerarn): String
  [Sql](#cfn-events-rule-redshiftdataparameters-sql): String
  [Sqls](#cfn-events-rule-redshiftdataparameters-sqls): 
    - String
  [StatementName](#cfn-events-rule-redshiftdataparameters-statementname): String
  [WithEvent](#cfn-events-rule-redshiftdataparameters-withevent): Boolean
```

## Properties
<a name="aws-properties-events-rule-redshiftdataparameters-properties"></a>

`Database`  <a name="cfn-events-rule-redshiftdataparameters-database"></a>
The name of the database. Required when authenticating using temporary credentials.  
*Required*: Yes  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `64`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`DbUser`  <a name="cfn-events-rule-redshiftdataparameters-dbuser"></a>
The database user name. Required when authenticating using temporary credentials.  
*Required*: No  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `128`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`SecretManagerArn`  <a name="cfn-events-rule-redshiftdataparameters-secretmanagerarn"></a>
The name or ARN of the secret that enables access to the database. Required when authenticating using AWS Secrets Manager.  
*Required*: No  
*Type*: String  
*Pattern*: `(^arn:aws([a-z]|\-)*:secretsmanager:[a-z0-9-.]+:.*)|(\$(\.[\w_-]+(\[(\d+|\*)\])*)*)`  
*Minimum*: `1`  
*Maximum*: `1600`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Sql`  <a name="cfn-events-rule-redshiftdataparameters-sql"></a>
The SQL statement text to run.  
*Required*: No  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `100000`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Sqls`  <a name="cfn-events-rule-redshiftdataparameters-sqls"></a>
One or more SQL statements to run. The SQL statements are run as a single transaction. They run serially in the order of the array. Subsequent SQL statements don't start until the previous statement in the array completes. If any SQL statement fails, then because they are run as one transaction, all work is rolled back.  
*Required*: No  
*Type*: Array of String  
*Minimum*: `0`  
*Maximum*: `40`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`StatementName`  <a name="cfn-events-rule-redshiftdataparameters-statementname"></a>
The name of the SQL statement. You can name the SQL statement when you create it to identify the query.  
*Required*: No  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `500`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`WithEvent`  <a name="cfn-events-rule-redshiftdataparameters-withevent"></a>
Indicates whether to send an event back to EventBridge after the SQL statement runs.  
*Required*: No  
*Type*: Boolean  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::Events::Rule RetryPolicy
<a name="aws-properties-events-rule-retrypolicy"></a>

A `RetryPolicy` object that includes information about the retry policy settings.

## Syntax
<a name="aws-properties-events-rule-retrypolicy-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-events-rule-retrypolicy-syntax.json"></a>

```
{
  "[MaximumEventAgeInSeconds](#cfn-events-rule-retrypolicy-maximumeventageinseconds)" : Integer,
  "[MaximumRetryAttempts](#cfn-events-rule-retrypolicy-maximumretryattempts)" : Integer
}
```

### YAML
<a name="aws-properties-events-rule-retrypolicy-syntax.yaml"></a>

```
  [MaximumEventAgeInSeconds](#cfn-events-rule-retrypolicy-maximumeventageinseconds): Integer
  [MaximumRetryAttempts](#cfn-events-rule-retrypolicy-maximumretryattempts): Integer
```

## Properties
<a name="aws-properties-events-rule-retrypolicy-properties"></a>

`MaximumEventAgeInSeconds`  <a name="cfn-events-rule-retrypolicy-maximumeventageinseconds"></a>
The maximum amount of time, in seconds, to continue to make retry attempts.  
*Required*: No  
*Type*: Integer  
*Minimum*: `60`  
*Maximum*: `86400`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`MaximumRetryAttempts`  <a name="cfn-events-rule-retrypolicy-maximumretryattempts"></a>
The maximum number of retry attempts to make before the request fails. Retry attempts continue until either the maximum number of attempts is made or until the duration of the `MaximumEventAgeInSeconds` is met.  
*Required*: No  
*Type*: Integer  
*Minimum*: `0`  
*Maximum*: `185`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::Events::Rule RunCommandParameters
<a name="aws-properties-events-rule-runcommandparameters"></a>

This parameter contains the criteria (either InstanceIds or a tag) used to specify which EC2 instances are to be sent the command. 

## Syntax
<a name="aws-properties-events-rule-runcommandparameters-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-events-rule-runcommandparameters-syntax.json"></a>

```
{
  "[RunCommandTargets](#cfn-events-rule-runcommandparameters-runcommandtargets)" : [ RunCommandTarget, ... ]
}
```

### YAML
<a name="aws-properties-events-rule-runcommandparameters-syntax.yaml"></a>

```
  [RunCommandTargets](#cfn-events-rule-runcommandparameters-runcommandtargets): 
    - RunCommandTarget
```

## Properties
<a name="aws-properties-events-rule-runcommandparameters-properties"></a>

`RunCommandTargets`  <a name="cfn-events-rule-runcommandparameters-runcommandtargets"></a>
Currently, we support including only one RunCommandTarget block, which specifies either an array of InstanceIds or a tag.  
*Required*: Yes  
*Type*: Array of [RunCommandTarget](aws-properties-events-rule-runcommandtarget.md)  
*Minimum*: `1`  
*Maximum*: `5`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::Events::Rule RunCommandTarget
<a name="aws-properties-events-rule-runcommandtarget"></a>

Information about the EC2 instances that are to be sent the command, specified as key-value pairs. Each `RunCommandTarget` block can include only one key, but this key may specify multiple values.

## Syntax
<a name="aws-properties-events-rule-runcommandtarget-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-events-rule-runcommandtarget-syntax.json"></a>

```
{
  "[Key](#cfn-events-rule-runcommandtarget-key)" : String,
  "[Values](#cfn-events-rule-runcommandtarget-values)" : [ String, ... ]
}
```

### YAML
<a name="aws-properties-events-rule-runcommandtarget-syntax.yaml"></a>

```
  [Key](#cfn-events-rule-runcommandtarget-key): String
  [Values](#cfn-events-rule-runcommandtarget-values): 
    - String
```

## Properties
<a name="aws-properties-events-rule-runcommandtarget-properties"></a>

`Key`  <a name="cfn-events-rule-runcommandtarget-key"></a>
Can be either `tag:`*tag-key* or `InstanceIds`.  
*Required*: Yes  
*Type*: String  
*Pattern*: `^[\p{L}\p{Z}\p{N}_.:/=+\-@]*$`  
*Minimum*: `1`  
*Maximum*: `128`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Values`  <a name="cfn-events-rule-runcommandtarget-values"></a>
If `Key` is `tag:`*tag-key*, `Values` is a list of tag values. If `Key` is `InstanceIds`, `Values` is a list of Amazon EC2 instance IDs.  
*Required*: Yes  
*Type*: Array of String  
*Minimum*: `1`  
*Maximum*: `50`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::Events::Rule SageMakerPipelineParameter
<a name="aws-properties-events-rule-sagemakerpipelineparameter"></a>

Name/Value pair of a parameter to start execution of a SageMaker AI Model Building Pipeline.

## Syntax
<a name="aws-properties-events-rule-sagemakerpipelineparameter-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-events-rule-sagemakerpipelineparameter-syntax.json"></a>

```
{
  "[Name](#cfn-events-rule-sagemakerpipelineparameter-name)" : String,
  "[Value](#cfn-events-rule-sagemakerpipelineparameter-value)" : String
}
```

### YAML
<a name="aws-properties-events-rule-sagemakerpipelineparameter-syntax.yaml"></a>

```
  [Name](#cfn-events-rule-sagemakerpipelineparameter-name): String
  [Value](#cfn-events-rule-sagemakerpipelineparameter-value): String
```

## Properties
<a name="aws-properties-events-rule-sagemakerpipelineparameter-properties"></a>

`Name`  <a name="cfn-events-rule-sagemakerpipelineparameter-name"></a>
Name of parameter to start execution of a SageMaker AI Model Building Pipeline.  
*Required*: Yes  
*Type*: String  
*Pattern*: `^[a-zA-Z0-9](-*[a-zA-Z0-9])*$`  
*Minimum*: `1`  
*Maximum*: `256`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Value`  <a name="cfn-events-rule-sagemakerpipelineparameter-value"></a>
Value of parameter to start execution of a SageMaker AI Model Building Pipeline.  
*Required*: Yes  
*Type*: String  
*Maximum*: `1024`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::Events::Rule SageMakerPipelineParameters
<a name="aws-properties-events-rule-sagemakerpipelineparameters"></a>

These are custom parameters to use when the target is a SageMaker AI Model Building Pipeline that starts based on EventBridge events.

## Syntax
<a name="aws-properties-events-rule-sagemakerpipelineparameters-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-events-rule-sagemakerpipelineparameters-syntax.json"></a>

```
{
  "[PipelineParameterList](#cfn-events-rule-sagemakerpipelineparameters-pipelineparameterlist)" : [ SageMakerPipelineParameter, ... ]
}
```

### YAML
<a name="aws-properties-events-rule-sagemakerpipelineparameters-syntax.yaml"></a>

```
  [PipelineParameterList](#cfn-events-rule-sagemakerpipelineparameters-pipelineparameterlist): 
    - SageMakerPipelineParameter
```

## Properties
<a name="aws-properties-events-rule-sagemakerpipelineparameters-properties"></a>

`PipelineParameterList`  <a name="cfn-events-rule-sagemakerpipelineparameters-pipelineparameterlist"></a>
List of Parameter names and values for SageMaker AI Model Building Pipeline execution.  
*Required*: No  
*Type*: Array of [SageMakerPipelineParameter](aws-properties-events-rule-sagemakerpipelineparameter.md)  
*Minimum*: `0`  
*Maximum*: `200`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::Events::Rule SqsParameters
<a name="aws-properties-events-rule-sqsparameters"></a>

The custom parameters for EventBridge to use for a target that is an Amazon SQS fair or FIFO queue. 



## Syntax
<a name="aws-properties-events-rule-sqsparameters-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-events-rule-sqsparameters-syntax.json"></a>

```
{
  "[MessageGroupId](#cfn-events-rule-sqsparameters-messagegroupid)" : String
}
```

### YAML
<a name="aws-properties-events-rule-sqsparameters-syntax.yaml"></a>

```
  [MessageGroupId](#cfn-events-rule-sqsparameters-messagegroupid): String
```

## Properties
<a name="aws-properties-events-rule-sqsparameters-properties"></a>

`MessageGroupId`  <a name="cfn-events-rule-sqsparameters-messagegroupid"></a>
The ID of the message group to use as the target.  
*Required*: Yes  
*Type*: String  
*Maximum*: `100`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::Events::Rule Tag
<a name="aws-properties-events-rule-tag"></a>

A key-value pair associated with an ECS Target of an EventBridge rule. The tag will be propagated to ECS by EventBridge when starting an ECS task based on a matched event. 

**Important**  
Currently, tags are only available when using ECS with EventBridge.

## Syntax
<a name="aws-properties-events-rule-tag-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-events-rule-tag-syntax.json"></a>

```
{
  "[Key](#cfn-events-rule-tag-key)" : String,
  "[Value](#cfn-events-rule-tag-value)" : String
}
```

### YAML
<a name="aws-properties-events-rule-tag-syntax.yaml"></a>

```
  [Key](#cfn-events-rule-tag-key): String
  [Value](#cfn-events-rule-tag-value): String
```

## Properties
<a name="aws-properties-events-rule-tag-properties"></a>

`Key`  <a name="cfn-events-rule-tag-key"></a>
A string you can use to assign a value. The combination of tag keys and values can help you organize and categorize your resources.  
*Required*: No  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `128`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Value`  <a name="cfn-events-rule-tag-value"></a>
The value for the specified tag key.  
*Required*: No  
*Type*: String  
*Minimum*: `0`  
*Maximum*: `256`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::Events::Rule Target
<a name="aws-properties-events-rule-target"></a>

Targets are the resources to be invoked when a rule is triggered. For a complete list of services and resources that can be set as a target, see [PutTargets](https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_PutTargets.html).

If you are setting the event bus of another account as the target, and that account granted permission to your account through an organization instead of directly by the account ID, then you must specify a `RoleArn` with proper permissions in the `Target` structure. For more information, see [Sending and Receiving Events Between AWS Accounts](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-cross-account-event-delivery.html) in the *Amazon EventBridge User Guide*.

## Syntax
<a name="aws-properties-events-rule-target-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-events-rule-target-syntax.json"></a>

```
{
  "[AppSyncParameters](#cfn-events-rule-target-appsyncparameters)" : AppSyncParameters,
  "[Arn](#cfn-events-rule-target-arn)" : String,
  "[BatchParameters](#cfn-events-rule-target-batchparameters)" : BatchParameters,
  "[DeadLetterConfig](#cfn-events-rule-target-deadletterconfig)" : DeadLetterConfig,
  "[EcsParameters](#cfn-events-rule-target-ecsparameters)" : EcsParameters,
  "[HttpParameters](#cfn-events-rule-target-httpparameters)" : HttpParameters,
  "[Id](#cfn-events-rule-target-id)" : String,
  "[Input](#cfn-events-rule-target-input)" : String,
  "[InputPath](#cfn-events-rule-target-inputpath)" : String,
  "[InputTransformer](#cfn-events-rule-target-inputtransformer)" : InputTransformer,
  "[KinesisParameters](#cfn-events-rule-target-kinesisparameters)" : KinesisParameters,
  "[RedshiftDataParameters](#cfn-events-rule-target-redshiftdataparameters)" : RedshiftDataParameters,
  "[RetryPolicy](#cfn-events-rule-target-retrypolicy)" : RetryPolicy,
  "[RoleArn](#cfn-events-rule-target-rolearn)" : String,
  "[RunCommandParameters](#cfn-events-rule-target-runcommandparameters)" : RunCommandParameters,
  "[SageMakerPipelineParameters](#cfn-events-rule-target-sagemakerpipelineparameters)" : SageMakerPipelineParameters,
  "[SqsParameters](#cfn-events-rule-target-sqsparameters)" : SqsParameters
}
```

### YAML
<a name="aws-properties-events-rule-target-syntax.yaml"></a>

```
  [AppSyncParameters](#cfn-events-rule-target-appsyncparameters): 
    AppSyncParameters
  [Arn](#cfn-events-rule-target-arn): String
  [BatchParameters](#cfn-events-rule-target-batchparameters): 
    BatchParameters
  [DeadLetterConfig](#cfn-events-rule-target-deadletterconfig): 
    DeadLetterConfig
  [EcsParameters](#cfn-events-rule-target-ecsparameters): 
    EcsParameters
  [HttpParameters](#cfn-events-rule-target-httpparameters): 
    HttpParameters
  [Id](#cfn-events-rule-target-id): String
  [Input](#cfn-events-rule-target-input): String
  [InputPath](#cfn-events-rule-target-inputpath): String
  [InputTransformer](#cfn-events-rule-target-inputtransformer): 
    InputTransformer
  [KinesisParameters](#cfn-events-rule-target-kinesisparameters): 
    KinesisParameters
  [RedshiftDataParameters](#cfn-events-rule-target-redshiftdataparameters): 
    RedshiftDataParameters
  [RetryPolicy](#cfn-events-rule-target-retrypolicy): 
    RetryPolicy
  [RoleArn](#cfn-events-rule-target-rolearn): String
  [RunCommandParameters](#cfn-events-rule-target-runcommandparameters): 
    RunCommandParameters
  [SageMakerPipelineParameters](#cfn-events-rule-target-sagemakerpipelineparameters): 
    SageMakerPipelineParameters
  [SqsParameters](#cfn-events-rule-target-sqsparameters): 
    SqsParameters
```

## Properties
<a name="aws-properties-events-rule-target-properties"></a>

`AppSyncParameters`  <a name="cfn-events-rule-target-appsyncparameters"></a>
Contains the GraphQL operation to be parsed and executed, if the event target is an AWS AppSync API.  
*Required*: No  
*Type*: [AppSyncParameters](aws-properties-events-rule-appsyncparameters.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Arn`  <a name="cfn-events-rule-target-arn"></a>
The Amazon Resource Name (ARN) of the target.  
*Required*: Yes  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `1600`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`BatchParameters`  <a name="cfn-events-rule-target-batchparameters"></a>
If the event target is an AWS Batch job, this contains the job definition, job name, and other parameters. For more information, see [Jobs](https://docs.aws.amazon.com/batch/latest/userguide/jobs.html) in the *AWS Batch User Guide*.  
*Required*: No  
*Type*: [BatchParameters](aws-properties-events-rule-batchparameters.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`DeadLetterConfig`  <a name="cfn-events-rule-target-deadletterconfig"></a>
The `DeadLetterConfig` that defines the target queue to send dead-letter queue events to.  
*Required*: No  
*Type*: [DeadLetterConfig](aws-properties-events-rule-deadletterconfig.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`EcsParameters`  <a name="cfn-events-rule-target-ecsparameters"></a>
Contains the Amazon ECS task definition and task count to be used, if the event target is an Amazon ECS task. For more information about Amazon ECS tasks, see [Task Definitions ](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_defintions.html) in the *Amazon EC2 Container Service Developer Guide*.  
*Required*: No  
*Type*: [EcsParameters](aws-properties-events-rule-ecsparameters.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`HttpParameters`  <a name="cfn-events-rule-target-httpparameters"></a>
Contains the HTTP parameters to use when the target is a API Gateway endpoint or EventBridge ApiDestination.  
If you specify an API Gateway API or EventBridge ApiDestination as a target, you can use this parameter to specify headers, path parameters, and query string keys/values as part of your target invoking request. If you're using ApiDestinations, the corresponding Connection can also have these values configured. In case of any conflicting keys, values from the Connection take precedence.  
*Required*: No  
*Type*: [HttpParameters](aws-properties-events-rule-httpparameters.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Id`  <a name="cfn-events-rule-target-id"></a>
The ID of the target within the specified rule. Use this ID to reference the target when updating the rule. We recommend using a memorable and unique string.  
*Required*: Yes  
*Type*: String  
*Pattern*: `[\.\-_A-Za-z0-9]+`  
*Minimum*: `1`  
*Maximum*: `64`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Input`  <a name="cfn-events-rule-target-input"></a>
Valid JSON text passed to the target. In this case, nothing from the event itself is passed to the target. For more information, see [The JavaScript Object Notation (JSON) Data Interchange Format](http://www.rfc-editor.org/rfc/rfc7159.txt).  
*Required*: No  
*Type*: String  
*Maximum*: `8192`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`InputPath`  <a name="cfn-events-rule-target-inputpath"></a>
The value of the JSONPath that is used for extracting part of the matched event when passing it to the target. You may use JSON dot notation or bracket notation. For more information about JSON paths, see [JSONPath](http://goessner.net/articles/JsonPath/).  
*Required*: No  
*Type*: String  
*Maximum*: `256`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`InputTransformer`  <a name="cfn-events-rule-target-inputtransformer"></a>
Settings to enable you to provide custom input to a target based on certain event data. You can extract one or more key-value pairs from the event and then use that data to send customized input to the target.  
*Required*: No  
*Type*: [InputTransformer](aws-properties-events-rule-inputtransformer.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`KinesisParameters`  <a name="cfn-events-rule-target-kinesisparameters"></a>
The custom parameter you can use to control the shard assignment, when the target is a Kinesis data stream. If you do not include this parameter, the default is to use the `eventId` as the partition key.  
*Required*: No  
*Type*: [KinesisParameters](aws-properties-events-rule-kinesisparameters.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`RedshiftDataParameters`  <a name="cfn-events-rule-target-redshiftdataparameters"></a>
Contains the Amazon Redshift Data API parameters to use when the target is a Amazon Redshift cluster.  
If you specify a Amazon Redshift Cluster as a Target, you can use this to specify parameters to invoke the Amazon Redshift Data API ExecuteStatement based on EventBridge events.  
*Required*: No  
*Type*: [RedshiftDataParameters](aws-properties-events-rule-redshiftdataparameters.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`RetryPolicy`  <a name="cfn-events-rule-target-retrypolicy"></a>
The retry policy configuration to use for the dead-letter queue.  
*Required*: No  
*Type*: [RetryPolicy](aws-properties-events-rule-retrypolicy.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`RoleArn`  <a name="cfn-events-rule-target-rolearn"></a>
The Amazon Resource Name (ARN) of the IAM role to be used for this target when the rule is triggered. If one rule triggers multiple targets, you can use a different IAM role for each target.  
*Required*: Conditional  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `1600`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`RunCommandParameters`  <a name="cfn-events-rule-target-runcommandparameters"></a>
Parameters used when you are using the rule to invoke Amazon EC2 Run Command.  
*Required*: No  
*Type*: [RunCommandParameters](aws-properties-events-rule-runcommandparameters.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`SageMakerPipelineParameters`  <a name="cfn-events-rule-target-sagemakerpipelineparameters"></a>
Contains the SageMaker AI Model Building Pipeline parameters to start execution of a SageMaker AI Model Building Pipeline.  
If you specify a SageMaker AI Model Building Pipeline as a target, you can use this to specify parameters to start a pipeline execution based on EventBridge events.  
*Required*: No  
*Type*: [SageMakerPipelineParameters](aws-properties-events-rule-sagemakerpipelineparameters.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`SqsParameters`  <a name="cfn-events-rule-target-sqsparameters"></a>
Contains the message group ID to use when the target is an Amazon SQS fair or FIFO queue.  
If you specify a fair or FIFO queue as a target, the queue must have content-based deduplication enabled.  
*Required*: No  
*Type*: [SqsParameters](aws-properties-events-rule-sqsparameters.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Examples
<a name="aws-properties-events-rule-target--examples"></a>



**Topics**
+ [Target with KinesisParameters](#aws-properties-events-rule-target--examples--Target_with_KinesisParameters)
+ [Target with EcsParameters](#aws-properties-events-rule-target--examples--Target_with_EcsParameters)

### Target with KinesisParameters
<a name="aws-properties-events-rule-target--examples--Target_with_KinesisParameters"></a>

The following snippet creates a Kinesis data stream target.

#### JSON
<a name="aws-properties-events-rule-target--examples--Target_with_KinesisParameters--json"></a>

```
"MyEventsRule": {
    "Type": "AWS::Events::Rule",
    "Properties": {
        "Description": "Events Rule with KinesisParameters",
        "EventPattern": {
            "source": [
                "aws.ec2"
            ]
        },
        "RoleArn": {
            "Fn::GetAtt": [
                "EventsInvokeKinesisTargetRole",
                "Arn"
            ]
        },
        "ScheduleExpression": "rate(5 minutes)",
        "State": "ENABLED",
        "Targets": [
            {
                "Arn": {
                    "Fn::GetAtt": [
                        "MyFirstStream",
                        "Arn"
                    ]
                },
                "Id": "Id123",
                "RoleArn": {
                    "Fn::GetAtt": [
                        "EventsInvokeKinesisTargetRole",
                        "Arn"
                    ]
                },
                "KinesisParameters": {
                    "PartitionKeyPath": "$"
                }
            }
        ]
    }
}
```

#### YAML
<a name="aws-properties-events-rule-target--examples--Target_with_KinesisParameters--yaml"></a>

```
MyEventsRule:
  Type: AWS::Events::Rule
  Properties:
    Description: Events Rule with KinesisParameters
    EventPattern:
      source:
        - aws.ec2
    RoleArn: !GetAtt 
      - EventsInvokeKinesisTargetRole
      - Arn
    ScheduleExpression: rate(5 minutes)
    State: ENABLED
    Targets:
      - Arn: !GetAtt 
          - MyFirstStream
          - Arn
        Id: Id123
        RoleArn: !GetAtt 
          - EventsInvokeKinesisTargetRole
          - Arn
        KinesisParameters:
          PartitionKeyPath: $
```

### Target with EcsParameters
<a name="aws-properties-events-rule-target--examples--Target_with_EcsParameters"></a>

The following snippet creates an Amazon ECS task target.

#### JSON
<a name="aws-properties-events-rule-target--examples--Target_with_EcsParameters--json"></a>

```
"MyEventsRule": {
  "Type": "AWS::Events::Rule",
  "Properties": {
      "Description": "Events Rule with EcsParameters",
      "EventPattern": {
          "source": [
              "aws.ec2"
          ],
          "detail-type": [
              "EC2 Instance State-change Notification"
          ],
          "detail": {
              "state": [
                  "stopping"
              ]
          }
      },
      "ScheduleExpression": "rate(15 minutes)",
      "State": "DISABLED",
      "Targets": [
          {
              "Arn": {
                  "Fn::GetAtt": [
                      "MyCluster",
                      "Arn"
                  ]
              },
              "RoleArn": {
                  "Fn::GetAtt": [
                      "ECSTaskRole",
                      "Arn"
                  ]
              },
              "Id": "Id345",
              "EcsParameters": {
                  "TaskCount": 1,
                  "TaskDefinitionArn": {
                      "Ref": "MyECSTask"
                  }
              }
          }
      ]
  }
}
```

#### YAML
<a name="aws-properties-events-rule-target--examples--Target_with_EcsParameters--yaml"></a>

```
MyEventsRule:
  Type: AWS::Events::Rule
  Properties:
    Description: Events Rule with EcsParameters
    EventPattern:
      source:
        - aws.ec2
      detail-type:
        - EC2 Instance State-change Notification
      detail:
        state:
          - stopping
    ScheduleExpression: rate(15 minutes)
    State: DISABLED
    Targets:
      - Arn: !GetAtt 
          - MyCluster
          - Arn
        RoleArn: !GetAtt 
          - ECSTaskRole
          - Arn
        Id: Id345
        EcsParameters:
          TaskCount: 1
          TaskDefinitionArn: !Ref MyECSTask
```