Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Change aws_cloudwatch_event_rule pattern size to 4096 #34270

Conversation

acwwat
Copy link
Contributor

@acwwat acwwat commented Nov 6, 2023

Description

This PR is for increasing the event rule pattern size from 2048 to 4096 in the event_pattern validation rule for aws_cloudwatch_event_rule. I was contemplating whether it's more appropriate to remove the max length validation and just let the error propagate at the AWS API level, but saw in the AWS API schema that it sets the max length to 4096. To follow this pattern, I've opted to increase the max length in the attribute validation function. For good measure, I've added a note about quota limit in the documentation.

Relations

Closes #33732

References

  • Amazon EventBridge quotas provides details on the quota limit
  • Rule indicates that the AWS API has a technical max length of 4096, although the API will return a 400 error if the length exceeds the quota limit.

Output from Acceptance Testing

% make testacc TESTS=TestAccXXX PKG=ec2

...
antw@U-UQPXPV4N2NIW:~/git/terraform-provider-aws$ make testacc TESTS=TestAccEventsRule PKG=events
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/events/... -v -count 1 -parallel 20 -run='TestAccEventsRule'  -timeout 360m
=== RUN   TestAccEventsRule_basic
=== PAUSE TestAccEventsRule_basic
=== RUN   TestAccEventsRule_eventBusName
=== PAUSE TestAccEventsRule_eventBusName
=== RUN   TestAccEventsRule_role
=== PAUSE TestAccEventsRule_role
=== RUN   TestAccEventsRule_description
=== PAUSE TestAccEventsRule_description
=== RUN   TestAccEventsRule_pattern
=== PAUSE TestAccEventsRule_pattern
=== RUN   TestAccEventsRule_patternJSONEncoder
=== PAUSE TestAccEventsRule_patternJSONEncoder
=== RUN   TestAccEventsRule_scheduleAndPattern
=== PAUSE TestAccEventsRule_scheduleAndPattern
=== RUN   TestAccEventsRule_namePrefix
=== PAUSE TestAccEventsRule_namePrefix
=== RUN   TestAccEventsRule_Name_generated
=== PAUSE TestAccEventsRule_Name_generated
=== RUN   TestAccEventsRule_tags
=== PAUSE TestAccEventsRule_tags
=== RUN   TestAccEventsRule_isEnabled
=== PAUSE TestAccEventsRule_isEnabled
=== RUN   TestAccEventsRule_partnerEventBus
    rule_test.go:506: Environment variable EVENT_BRIDGE_PARTNER_EVENT_BUS_NAME is not set
--- SKIP: TestAccEventsRule_partnerEventBus (0.00s)
=== RUN   TestAccEventsRule_eventBusARN
=== PAUSE TestAccEventsRule_eventBusARN
=== CONT  TestAccEventsRule_basic
=== CONT  TestAccEventsRule_eventBusARN
=== CONT  TestAccEventsRule_isEnabled
=== CONT  TestAccEventsRule_tags
=== CONT  TestAccEventsRule_Name_generated
=== CONT  TestAccEventsRule_namePrefix
=== CONT  TestAccEventsRule_scheduleAndPattern
=== CONT  TestAccEventsRule_patternJSONEncoder
=== CONT  TestAccEventsRule_pattern
=== CONT  TestAccEventsRule_description
=== CONT  TestAccEventsRule_role
=== CONT  TestAccEventsRule_eventBusName
--- PASS: TestAccEventsRule_patternJSONEncoder (230.40s)
--- PASS: TestAccEventsRule_namePrefix (247.78s)
--- PASS: TestAccEventsRule_scheduleAndPattern (247.82s)
--- PASS: TestAccEventsRule_Name_generated (260.10s)
--- PASS: TestAccEventsRule_role (267.78s)
--- PASS: TestAccEventsRule_eventBusARN (268.17s)
--- PASS: TestAccEventsRule_description (347.36s)
--- PASS: TestAccEventsRule_pattern (347.38s)
--- PASS: TestAccEventsRule_tags (404.23s)
--- PASS: TestAccEventsRule_basic (404.79s)
--- PASS: TestAccEventsRule_isEnabled (406.55s)
--- PASS: TestAccEventsRule_eventBusName (407.63s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/events     407.981s
antw@U-UQPXPV4N2NIW:~/git/terraform-provider-aws$

Copy link

github-actions bot commented Nov 6, 2023

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added size/XS Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. service/events Issues and PRs that pertain to the events service. labels Nov 6, 2023
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Nov 6, 2023
@acwwat acwwat force-pushed the b-aws_cloudwatch_event_rule-event_pattern_size branch from a5424f4 to c9dc65f Compare November 6, 2023 01:18
@acwwat acwwat changed the title [WIP] fix: Change aws_cloudwatch_event_rule pattern size to 4096 fix: Change aws_cloudwatch_event_rule pattern size to 4096 Nov 6, 2023
@ewbankkit ewbankkit removed the needs-triage Waiting for first response or review from a maintainer. label Nov 6, 2023
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀.

@ewbankkit
Copy link
Contributor

@acwwat Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit c01a343 into hashicorp:main Nov 6, 2023
49 checks passed
@github-actions github-actions bot added this to the v5.25.0 milestone Nov 6, 2023
Copy link

This functionality has been released in v5.25.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 11, 2023
@acwwat acwwat deleted the b-aws_cloudwatch_event_rule-event_pattern_size branch January 13, 2024 22:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. service/events Issues and PRs that pertain to the events service. size/XS Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: aws_cloudwatch_event_rule event_pattern should can be longer than 2048 characters
2 participants