| --- |
| # ---------------------------------------------------------------------------- |
| # |
| # *** AUTO GENERATED CODE *** Type: MMv1 *** |
| # |
| # ---------------------------------------------------------------------------- |
| # |
| # This file is automatically generated by Magic Modules and manual |
| # changes will be clobbered when the file is regenerated. |
| # |
| # Please read more about how to change this file in |
| # .github/CONTRIBUTING.md. |
| # |
| # ---------------------------------------------------------------------------- |
| subcategory: "Compute Engine" |
| description: |- |
| Organization security policies are used to control incoming/outgoing traffic. |
| --- |
| |
| # 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](https://terraform.io/docs/providers/google/guides/provider_versions.html) for more details on beta resources. |
| |
| To get more information about OrganizationSecurityPolicy, see: |
| |
| * [API documentation](https://cloud.google.com/compute/docs/reference/rest/beta/organizationSecurityPolicies) |
| * How-to Guides |
| * [Creating a firewall policy](https://cloud.google.com/vpc/docs/using-firewall-policies#create-policy) |
| |
| ## Example Usage - Organization Security Policy Basic |
| |
| |
| ```hcl |
| resource "google_compute_organization_security_policy" "policy" { |
| provider = google-beta |
| display_name = "tf-test%{random_suffix}" |
| parent = "organizations/123456789" |
| } |
| ``` |
| |
| ## Argument Reference |
| |
| 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`. |
| |
| |
| ## Attributes Reference |
| |
| 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. |
| |
| |
| ## Timeouts |
| |
| This resource provides the following |
| [Timeouts](https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/retries-and-customizable-timeouts) configuration options: |
| |
| - `create` - Default is 20 minutes. |
| - `update` - Default is 20 minutes. |
| - `delete` - Default is 20 minutes. |
| |
| ## Import |
| |
| |
| OrganizationSecurityPolicy can be imported using any of these accepted formats: |
| |
| * `locations/global/securityPolicies/{{policy_id}}` |
| * `{{policy_id}}` |
| |
| |
| In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import OrganizationSecurityPolicy using one of the formats above. For example: |
| |
| ```tf |
| import { |
| id = "locations/global/securityPolicies/{{policy_id}}" |
| to = google_compute_organization_security_policy.default |
| } |
| ``` |
| |
| When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), OrganizationSecurityPolicy can be imported using one of the formats above. For example: |
| |
| ``` |
| $ terraform import google_compute_organization_security_policy.default locations/global/securityPolicies/{{policy_id}} |
| $ terraform import google_compute_organization_security_policy.default {{policy_id}} |
| ``` |