Skip to content

Conversation

@benpriestman
Copy link
Member

Adding tests to module and attempting to define a type

  • test: adding unit tests for existing use-cases
  • wip: adding a type for rule

Adding a suite of tests, based upon and extending the current examples.
This reduces the risk of unintended breaking changes.
It also makes developing changes eaiser.

Run tests with \`terraform test\`.

Tests are found in the \`tests/\` directory.
They have the same name as the example files for the behaviour they are testing.
In addition, there are WebAcl and WebAclAssociation files that test behaviour not covered in those examples.
With a lot of help from claude sketched a rule type that almost works.

Current issues:
- there's a problem with the top-level action and action_override keys. Terraform can't handle objects ina list that have a mixture of these. ie: can't combine managed rules with other types.
- and and or statements are undefined. this creates similar problems.
- may be problem with other elements that have the any type. Can be anything, but all must match.
@benpriestman benpriestman self-assigned this Oct 20, 2025
@benpriestman benpriestman deleted the CPSTREAM-2338-tests-and-type branch October 24, 2025 13:54
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.

1 participant