Is there a data source for reading Compute Firewall Rules?

Hi, is there a data source for reading Compute Firewall Rules?

I want to list the firewall rules matching a regex filter and read the target tags of the first result. How can I do that at the moment?

This is a good example of a question that is best answered by the provider documentation: Terraform Registry

The answer appears to be “No” as there is no firewall rule data source.

Yep, and that I figured myself :sweat_smile:

I just want a way to do it, doesn’t need to be first-class.

Would it be possible to combine this:

https://registry.terraform.io/modules/terraform-google-modules/gcloud/google/latest

With this:

https://registry.terraform.io/providers/hashicorp/external/latest/docs

And achieve the same? I already have a gcloud command here with the filter that works perfectly, so it’d be perfect it could get executed on the beginning of every plan and apply and the result be available for being fed to my modules.

Thanks in advance for the help!

Seems like you have it all figured out then.

Well, yeah, I’m gonna try it and update here, but if anybody has experience doing that pls also let me know :pray: