WAFv2 web_acl "action" from variable?

I’m trying to create a TF module for WAFv2 that will use values from variables.
The blocker that is holding me back right now is the way that “action” for aws_wafv2_web_acl rules has changed into empty nested blocks, like this:

rule {
    name     = "rule-1"
    priority = 1

    action {
      count {}

    statement {


If it’s an empty block of type “allow”/“block”/“count”, any ideas how can I pass the selected behaviour from variables now?

Best regards,

This is what dynamic block is used for