Google Compute Engine Organization Security Policy

This page shows how to write Terraform for Compute Engine Organization Security Policy and write them securely.


Fix issues in your cloud & app configurations

Test for misconfigurations of this resource in your cloud.


Terraform Example (google_compute_organization_security_policy)

Organization security policies are used to control incoming/outgoing traffic.

Warning: This resource is in beta, and should be used with the terraform-provider-google-beta provider. See Provider Versions for more details on beta resources. To get more information about OrganizationSecurityPolicy, see:


The following arguments are supported:

  • display_name - (Required) A textual name of the security policy.

  • parent - (Required) The parent of this OrganizationSecurityPolicy in the Cloud Resource Hierarchy. Format: organizations/[organization_id] or folders/[folder_id]

  • description - (Optional) A textual description for the organization security policy.

  • type - (Optional) The type indicates the intended use of the security policy. For organization security policies, the only supported type is "FIREWALL". Default value is FIREWALL. Possible values are FIREWALL.

In addition to the arguments listed above, the following computed attributes are exported:

  • id - an identifier for the resource with format locations/global/securityPolicies/[[policy_id]]

  • fingerprint - Fingerprint of this resource. This field is used internally during updates of this resource.

  • policy_id - The unique identifier for the resource. This identifier is defined by the server.

Example Usage (from GitHub)

resource "google_compute_organization_security_policy" "policy" {
  provider = google

  display_name = "tf-income%{random_suffix}"
  parent       = "organizations/id"

Frequently asked questions

What is Google Compute Engine Organization Security Policy?

Google Compute Engine Organization Security Policy is a resource for Compute Engine of Google Cloud Platform. Settings can be wrote in Terraform.

Where can I find the example code for the Google Compute Engine Organization Security Policy?

For Terraform, the Aniki-lee/GCP source code example is useful. See the Terraform Example section for further details.