Skip to content

Commit

Permalink
fix: Change aws_cloudwatch_event_rule pattern size to 4096
Browse files Browse the repository at this point in the history
  • Loading branch information
acwwat committed Nov 6, 2023
1 parent c4c48f0 commit c9dc65f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .changelog/34270.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
resource/aws_cloudwatch_event_rule: Increase `event_pattern` max length for validation to 4096
```
2 changes: 1 addition & 1 deletion internal/service/events/rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ func validateEventPatternValue() schema.SchemaValidateFunc {
}

// Check whether the normalized JSON is within the given length.
const maxJSONLength = 2048
const maxJSONLength = 4096
if len(json) > maxJSONLength {
errors = append(errors, fmt.Errorf("%q cannot be longer than %d characters: %q", k, maxJSONLength, json))
}
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/cloudwatch_event_rule.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ This resource supports the following arguments:
* `schedule_expression` - (Optional) The scheduling expression. For example, `cron(0 20 * * ? *)` or `rate(5 minutes)`. At least one of `schedule_expression` or `event_pattern` is required. Can only be used on the default event bus. For more information, refer to the AWS documentation [Schedule Expressions for Rules](https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html).
* `event_bus_name` - (Optional) The name or ARN of the event bus to associate with this rule.
If you omit this, the `default` event bus is used.
* `event_pattern` - (Optional) The event pattern described a JSON object. At least one of `schedule_expression` or `event_pattern` is required. See full documentation of [Events and Event Patterns in EventBridge](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html) for details.
* `event_pattern` - (Optional) The event pattern described a JSON object. At least one of `schedule_expression` or `event_pattern` is required. See full documentation of [Events and Event Patterns in EventBridge](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html) for details. **Note**: The event pattern size is 2048 by default but it is adjustable up to 4096 characters by submitting a service quota increase request. See [Amazon EventBridge quotas](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-quota.html) for details.
* `description` - (Optional) The description of the rule.
* `role_arn` - (Optional) The Amazon Resource Name (ARN) associated with the role that is used for target invocation.
* `is_enabled` - (Optional) Whether the rule should be enabled (defaults to `true`).
Expand Down

0 comments on commit c9dc65f

Please sign in to comment.