https://registry.terraform.io/modules/digitickets/cli/aws/latest This may help simplify the logic in this module. I initially tried it and had some issues. The leftover commented code remains. https://github.com/infralicious/terraform-aws-securityhub-batchupdatefindings/blob/667096f7387c59a0471f589b7bbd49e11844e7af/main.tf#L53