From c9dc65f5508bfbb6b2a11edb45c0f1349f309d61 Mon Sep 17 00:00:00 2001 From: Anthony Wat Date: Sun, 5 Nov 2023 20:07:49 -0500 Subject: [PATCH] fix: Change aws_cloudwatch_event_rule pattern size to 4096 --- .changelog/34270.txt | 3 +++ internal/service/events/rule.go | 2 +- website/docs/r/cloudwatch_event_rule.html.markdown | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 .changelog/34270.txt diff --git a/.changelog/34270.txt b/.changelog/34270.txt new file mode 100644 index 000000000000..dc3507b18d16 --- /dev/null +++ b/.changelog/34270.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_cloudwatch_event_rule: Increase `event_pattern` max length for validation to 4096 +``` diff --git a/internal/service/events/rule.go b/internal/service/events/rule.go index 8ccf033a5b8c..171f8a790feb 100644 --- a/internal/service/events/rule.go +++ b/internal/service/events/rule.go @@ -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)) } diff --git a/website/docs/r/cloudwatch_event_rule.html.markdown b/website/docs/r/cloudwatch_event_rule.html.markdown index e58fa1101b3a..b5b33c4f1061 100644 --- a/website/docs/r/cloudwatch_event_rule.html.markdown +++ b/website/docs/r/cloudwatch_event_rule.html.markdown @@ -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`).