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

feat: Improve filter validation to show error on misconfiguration #45

Merged
merged 2 commits into from
May 6, 2024

Conversation

alexluong
Copy link
Collaborator

Improving the filter validation so that if users have a wrong TF resource configuration we'll throw an error. For example:

resource "hookdeck_connection" "connection_example" {
  source_id      = hookdeck_source.example.id
  destination_id = hookdeck_destination.destination_example.id
  name           = "my-connection"
  rules = [
    {
      filter_rule = {
        body = {
          hello = "world"
        }
      }
    }
  ]
}

will result in this error

│ Error: Invalid Attribute Type
│
│   with hookdeck_connection.connection_example,
│   on main.tf line 52, in resource "hookdeck_connection" "connection_example":
│   52: resource "hookdeck_connection" "connection_example" {
│
│ Attribute rules[0].filter_rule.body value must have exactly one child attribute defined, got:
│ {"boolean":<null>,"json":<null>,"number":<null>,"string":<null>}

@leggetter leggetter merged commit d155963 into hookdeck:main May 6, 2024
7 checks passed
@alexluong alexluong deleted the improve-filter-validation branch May 6, 2024 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants