[Enhancement] Validate aws_guardduty_filter description

Author: nemo-lmCreated Sep 18, 2026Updated Sep 18, 2026
Labelsenhancementservice/guarddutyneeds-triage

Description

The current validation is as per the official documentation:

The Description is optional. If you enter a description, it can have up to 512 characters.

Matching Code: https://github.com/hashicorp/terraform-provider-aws/blob/3c404c0aee1e48a6a2675e010003a78dfedbe49f/internal/service/guardduty/filter.go#L62-L65

However, editing the filter on the GuardDuty Web Console shows the actual validation:

Image

Description must be less than 512 characters. Valid characters are a-z, A-Z, 0-9, period (.), hyphen (-), colon (:), brackets({}()[]), forward slash (/), and space.

As such, it is quite simple to get valid plans if you use a simple and common characters like $ or , in your description. Happy to file a PR.

Affected Resource(s) or Data Source(s)

  • aws_guardduty_filter

Potential Terraform Configuration

hcl

# Should fail the plan
resource "aws_guardduty_filter" "invalid" {
  name        = "invvalid_filter"
  action      = "ARCHIVE"
  description = "Not a Valid Filter $,"
}

References

No response

Would you like to implement the enhancement?

Yes

Source: hashicorp/terraform-provider-aws