# Data source for google\_compute\_firewall

**URL:** <https://discuss.hashicorp.com/t/data-source-for-google-compute-firewall/32147>\
**Category:** Terraform\
**Created:** [November 19, 2021, 3:43am UTC](https://discuss.hashicorp.com/t/data-source-for-google-compute-firewall/32147 "2021-11-19T03:43:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![meetravi007](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/meetravi007/32/23687_2.png) [@meetravi007](https://discuss.hashicorp.com/u/meetravi007)\
**Post date:** [November 19, 2021, 3:43am UTC](https://discuss.hashicorp.com/t/data-source-for-google-compute-firewall/32147/1 "2021-11-19T03:43:09Z")

</div>

Hey Guys,  
│ Error: Invalid data source  
│  
│ on main.tf line 10, in data “google\_compute\_firewall” “allow-ssh”:  
│ 10: data “google\_compute\_firewall” “allow-ssh” {  
│  
│ The provider hashicorp/google does not support data source “google\_compute\_firewall”.  
│  
│ Did you intend to use the managed resource type “google\_compute\_firewall”? If so, declare this using a “resource” block instead of a “data” block.  
╵  
is that means I can not import my existing firewalls rules to terraform ? I tried with data source.

---

<div class="post-metadata">

**Author:** ![Didainius](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/didainius/32/23529_2.png) [@Didainius](https://discuss.hashicorp.com/u/Didainius)\
**Post date:** [November 19, 2021, 8:47am UTC](https://discuss.hashicorp.com/t/data-source-for-google-compute-firewall/32147/2 "2021-11-19T08:47:08Z")

</div>

> [@meetravi007](#):
>
> google\_compute\_firewall

Hey,  
Not a GCP or HashiCorp member, but a quick glance at registry shows me there is no such data source google\_compute\_firewall. Only a resource - [Terraform Registry](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_firewall)

Have a look at `import` example at the bottom of the doc - [Terraform Registry](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_firewall#import)

---

<div class="post-metadata">

**Author:** ![stuart-c](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/stuart-c/32/10789_2.png) [@stuart-c](https://discuss.hashicorp.com/u/stuart-c)\
**Post date:** [November 19, 2021, 9:26am UTC](https://discuss.hashicorp.com/t/data-source-for-google-compute-firewall/32147/3 "2021-11-19T09:26:56Z")

</div>

Or if you are only needing to reference something (rather than search for it or lookup lots of details) you can just use the ID wherever it needs to be used.

---

<div class="post-metadata">

**Author:** ![meetravi007](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/meetravi007/32/23687_2.png) [@meetravi007](https://discuss.hashicorp.com/u/meetravi007)\
**Post date:** [November 24, 2021, 12:57am UTC](https://discuss.hashicorp.com/t/data-source-for-google-compute-firewall/32147/4 "2021-11-24T00:57:46Z")

</div>

Thank you so much, everyone, I have resolved my issue by defining the firewall rule as a resource, as of now it does not support as the data source and you can not import existing firewalls rules however you may use import to call them.  
Remember importing resources will be deleted during destroying command however if you use data sources to call them in terraform they will keep remaining even after destroy.
