|
| 1 | +# Copyright 2024 Google Inc. |
| 2 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 3 | +# you may not use this file except in compliance with the License. |
| 4 | +# You may obtain a copy of the License at |
| 5 | +# |
| 6 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 7 | +# |
| 8 | +# Unless required by applicable law or agreed to in writing, software |
| 9 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 10 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 11 | +# See the License for the specific language governing permissions and |
| 12 | +# limitations under the License. |
| 13 | + |
| 14 | +--- |
| 15 | +name: 'FirewallPolicy' |
| 16 | +api_resource_type_kind: FirewallPolicy |
| 17 | +description: | |
| 18 | + Hierarchical firewall policy rules let you create and enforce a consistent firewall policy across your organization. Rules can explicitly allow or deny connections or delegate evaluation to lower level policies. Policies can be created within organizations or folders. |
| 19 | +
|
| 20 | + This resource should be generally be used with `google_compute_firewall_policy_association` and `google_compute_firewall_policy_rule` |
| 21 | +
|
| 22 | + For more information see the [official documentation](https://cloud.google.com/vpc/docs/firewall-policies) |
| 23 | +min_version: 'beta' |
| 24 | +references: |
| 25 | + guides: |
| 26 | + api: 'https://cloud.google.com/compute/docs/reference/rest/v1/firewallPolicies' |
| 27 | +docs: |
| 28 | +base_url: 'locations/global/firewallPolicies' |
| 29 | +self_link: 'locations/global/firewallPolicies/{{name}}' |
| 30 | +create_url: 'locations/global/firewallPolicies?parentId={{parent}}' |
| 31 | +update_verb: 'PATCH' |
| 32 | +timeouts: |
| 33 | + insert_minutes: 20 |
| 34 | + update_minutes: 20 |
| 35 | + delete_minutes: 20 |
| 36 | +import_format: |
| 37 | + - 'locations/global/firewallPolicies/{{name}}' |
| 38 | + - '{{name}}' |
| 39 | +custom_code: |
| 40 | + post_create: 'templates/terraform/post_create/compute_firewall_policy.go.tmpl' |
| 41 | + post_delete: 'templates/terraform/constants/compute_firewall_policy_operation.go.tmpl' |
| 42 | + post_update: 'templates/terraform/constants/compute_firewall_policy_operation.go.tmpl' |
| 43 | +custom_diff: |
| 44 | + - 'tpgresource.DefaultProviderProject' |
| 45 | +examples: |
| 46 | + - name: 'firewall_policy' |
| 47 | + primary_resource_id: 'default' |
| 48 | + vars: |
| 49 | + policy_name: 'my-policy' |
| 50 | + test_env_vars: |
| 51 | + org_id: 'ORG_ID' |
| 52 | +parameters: |
| 53 | +properties: |
| 54 | + - name: 'creationTimestamp' |
| 55 | + type: String |
| 56 | + description: | |
| 57 | + Creation timestamp in RFC3339 text format. |
| 58 | + output: true |
| 59 | + - name: 'name' |
| 60 | + type: String |
| 61 | + description: | |
| 62 | + Name of the resource. It is a numeric ID allocated by GCP which uniquely identifies the Firewall Policy. |
| 63 | + output: true |
| 64 | + - name: 'firewallPolicyId' |
| 65 | + type: String |
| 66 | + api_name: 'id' |
| 67 | + description: | |
| 68 | + The unique identifier for the resource. This identifier is defined by the server. |
| 69 | + output: true |
| 70 | + - name: 'shortName' |
| 71 | + type: String |
| 72 | + description: | |
| 73 | + User-provided name of the Organization firewall policy. The name should be unique in the organization in which the firewall policy is created. |
| 74 | + This field is not applicable to network firewall policies. This name must be set on creation and cannot be changed. The name must be 1-63 characters long, and comply with RFC1035. |
| 75 | + Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. |
| 76 | + required: true |
| 77 | + immutable: true |
| 78 | + - name: 'description' |
| 79 | + type: String |
| 80 | + description: | |
| 81 | + An optional description of this resource. Provide this property when you create the resource. |
| 82 | + - name: 'parent' |
| 83 | + type: String |
| 84 | + description: | |
| 85 | + The parent of the firewall policy. |
| 86 | + required: true |
| 87 | + immutable: true |
| 88 | + diff_suppress_func: 'tpgresource.CompareSelfLinkOrResourceName' |
| 89 | + - name: 'fingerprint' |
| 90 | + type: Fingerprint |
| 91 | + description: | |
| 92 | + Fingerprint of the resource. This field is used internally during updates of this resource. |
| 93 | + output: true |
| 94 | + - name: 'selfLink' |
| 95 | + type: String |
| 96 | + description: | |
| 97 | + Server-defined URL for the resource. |
| 98 | + output: true |
| 99 | + - name: 'selfLinkWithId' |
| 100 | + type: String |
| 101 | + description: | |
| 102 | + Server-defined URL for this resource with the resource id. |
| 103 | + output: true |
| 104 | + - name: 'ruleTupleCount' |
| 105 | + type: Integer |
| 106 | + description: | |
| 107 | + Total count of all firewall policy rule tuples. A firewall policy can not exceed a set number of tuples. |
| 108 | + output: true |
0 commit comments