(Repost of https://serverfault.com/questions/970586/how-to-configure-optional-tags-for-terraform-aws-inspector-resource-group since I did not receive a response there. Slightly abbreviated)
I am trying to develop a reusable module to be used in our multi account setup to enable AWS Inspector setup. Some accounts would like to scan only tagged instances (and probably define multiple resource groups based on tags) whereas others would like to scan all instances (and they aren’t tagged).
How do I define a
tags property in
aws_inspector_resource_group that uses tags passed into the module, or leaves out the tags property altogether if no tags are specified? I tried an empty value for
tags property but TF did not like it, and I don’t suppose
* is an option.