|
| 1 | +--- |
| 2 | +# ---------------------------------------------------------------------------- |
| 3 | +# |
| 4 | +# *** AUTO GENERATED CODE *** Type: MMv1 *** |
| 5 | +# |
| 6 | +# ---------------------------------------------------------------------------- |
| 7 | +# |
| 8 | +# This file is automatically generated by Magic Modules and manual |
| 9 | +# changes will be clobbered when the file is regenerated. |
| 10 | +# |
| 11 | +# Please read more about how to change this file in |
| 12 | +# .github/CONTRIBUTING.md. |
| 13 | +# |
| 14 | +# ---------------------------------------------------------------------------- |
| 15 | +subcategory: "Compute Engine" |
| 16 | +description: |- |
| 17 | + Represents a Region Cloud Armor Security Policy resource. |
| 18 | +--- |
| 19 | + |
| 20 | +# google\_compute\_region\_security\_policy |
| 21 | + |
| 22 | +Represents a Region Cloud Armor Security Policy resource. |
| 23 | + |
| 24 | +~> **Warning:** This resource is in beta, and should be used with the terraform-provider-google-beta provider. |
| 25 | +See [Provider Versions](https://terraform.io/docs/providers/google/guides/provider_versions.html) for more details on beta resources. |
| 26 | + |
| 27 | +To get more information about RegionSecurityPolicy, see: |
| 28 | + |
| 29 | +* [API documentation](https://cloud.google.com/compute/docs/reference/rest/v1/regionSecurityPolicies) |
| 30 | +* How-to Guides |
| 31 | + * [Official Documentation](https://cloud.google.com/armor/docs/security-policy-concepts) |
| 32 | + |
| 33 | +<div class = "oics-button" style="float: right; margin: 0 0 -15px"> |
| 34 | + <a href="https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.jpy.wang%2Fterraform-google-modules%2Fdocs-examples.git&cloudshell_working_dir=region_security_policy_basic&cloudshell_image=gcr.io%2Fgraphite-cloud-shell-images%2Fterraform%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md" target="_blank"> |
| 35 | + <img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;"> |
| 36 | + </a> |
| 37 | +</div> |
| 38 | +## Example Usage - Region Security Policy Basic |
| 39 | + |
| 40 | + |
| 41 | +```hcl |
| 42 | +resource "google_compute_region_security_policy" "region-sec-policy-basic" { |
| 43 | + provider = google-beta |
| 44 | +
|
| 45 | + name = "my-sec-policy-basic" |
| 46 | + description = "basic region security policy" |
| 47 | + type = "CLOUD_ARMOR" |
| 48 | +} |
| 49 | +``` |
| 50 | +<div class = "oics-button" style="float: right; margin: 0 0 -15px"> |
| 51 | + <a href="https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.jpy.wang%2Fterraform-google-modules%2Fdocs-examples.git&cloudshell_working_dir=region_security_policy_with_ddos_protection_config&cloudshell_image=gcr.io%2Fgraphite-cloud-shell-images%2Fterraform%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md" target="_blank"> |
| 52 | + <img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;"> |
| 53 | + </a> |
| 54 | +</div> |
| 55 | +## Example Usage - Region Security Policy With Ddos Protection Config |
| 56 | + |
| 57 | + |
| 58 | +```hcl |
| 59 | +resource "google_compute_region_security_policy" "region-sec-policy-ddos-protection" { |
| 60 | + provider = google-beta |
| 61 | +
|
| 62 | + name = "my-sec-policy-ddos-protection" |
| 63 | + description = "with ddos protection config" |
| 64 | + type = "CLOUD_ARMOR_NETWORK" |
| 65 | +
|
| 66 | + ddos_protection_config { |
| 67 | + ddos_protection = "ADVANCED_PREVIEW" |
| 68 | + } |
| 69 | +} |
| 70 | +``` |
| 71 | + |
| 72 | +## Argument Reference |
| 73 | + |
| 74 | +The following arguments are supported: |
| 75 | + |
| 76 | + |
| 77 | +* `name` - |
| 78 | + (Required) |
| 79 | + Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. |
| 80 | + 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. |
| 81 | + |
| 82 | + |
| 83 | +- - - |
| 84 | + |
| 85 | + |
| 86 | +* `description` - |
| 87 | + (Optional) |
| 88 | + An optional description of this resource. Provide this property when you create the resource. |
| 89 | + |
| 90 | +* `type` - |
| 91 | + (Optional) |
| 92 | + The type indicates the intended use of the security policy. |
| 93 | + - CLOUD_ARMOR: Cloud Armor backend security policies can be configured to filter incoming HTTP requests targeting backend services. They filter requests before they hit the origin servers. |
| 94 | + - CLOUD_ARMOR_EDGE: Cloud Armor edge security policies can be configured to filter incoming HTTP requests targeting backend services (including Cloud CDN-enabled) as well as backend buckets (Cloud Storage). They filter requests before the request is served from Google's cache. |
| 95 | + - CLOUD_ARMOR_NETWORK: Cloud Armor network policies can be configured to filter packets targeting network load balancing resources such as backend services, target pools, target instances, and instances with external IPs. They filter requests before the request is served from the application. |
| 96 | + This field can be set only at resource creation time. |
| 97 | + Possible values are: `CLOUD_ARMOR`, `CLOUD_ARMOR_EDGE`, `CLOUD_ARMOR_NETWORK`. |
| 98 | + |
| 99 | +* `ddos_protection_config` - |
| 100 | + (Optional) |
| 101 | + Configuration for Google Cloud Armor DDOS Proctection Config. |
| 102 | + Structure is [documented below](#nested_ddos_protection_config). |
| 103 | + |
| 104 | +* `region` - |
| 105 | + (Optional) |
| 106 | + The Region in which the created Region Security Policy should reside. |
| 107 | + If it is not provided, the provider region is used. |
| 108 | + |
| 109 | +* `project` - (Optional) The ID of the project in which the resource belongs. |
| 110 | + If it is not provided, the provider project is used. |
| 111 | + |
| 112 | + |
| 113 | +<a name="nested_ddos_protection_config"></a>The `ddos_protection_config` block supports: |
| 114 | + |
| 115 | +* `ddos_protection` - |
| 116 | + (Required) |
| 117 | + Google Cloud Armor offers the following options to help protect systems against DDoS attacks: |
| 118 | + - STANDARD: basic always-on protection for network load balancers, protocol forwarding, or VMs with public IP addresses. |
| 119 | + - ADVANCED: additional protections for Managed Protection Plus subscribers who use network load balancers, protocol forwarding, or VMs with public IP addresses. |
| 120 | + - ADVANCED_PREVIEW: flag to enable the security policy in preview mode. |
| 121 | + Possible values are: `ADVANCED`, `ADVANCED_PREVIEW`, `STANDARD`. |
| 122 | + |
| 123 | +## Attributes Reference |
| 124 | + |
| 125 | +In addition to the arguments listed above, the following computed attributes are exported: |
| 126 | + |
| 127 | +* `id` - an identifier for the resource with format `projects/{{project}}/regions/{{region}}/securityPolicies/{{name}}` |
| 128 | + |
| 129 | +* `policy_id` - |
| 130 | + The unique identifier for the resource. This identifier is defined by the server. |
| 131 | + |
| 132 | +* `fingerprint` - |
| 133 | + Fingerprint of this resource. This field is used internally during |
| 134 | + updates of this resource. |
| 135 | + |
| 136 | +* `self_link` - |
| 137 | + Server-defined URL for the resource. |
| 138 | + |
| 139 | +* `self_link_with_policy_id` - |
| 140 | + Server-defined URL for this resource with the resource id. |
| 141 | + |
| 142 | + |
| 143 | +## Timeouts |
| 144 | + |
| 145 | +This resource provides the following |
| 146 | +[Timeouts](https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/retries-and-customizable-timeouts) configuration options: |
| 147 | + |
| 148 | +- `create` - Default is 20 minutes. |
| 149 | +- `update` - Default is 20 minutes. |
| 150 | +- `delete` - Default is 20 minutes. |
| 151 | + |
| 152 | +## Import |
| 153 | + |
| 154 | + |
| 155 | +RegionSecurityPolicy can be imported using any of these accepted formats: |
| 156 | + |
| 157 | +``` |
| 158 | +$ terraform import google_compute_region_security_policy.default projects/{{project}}/regions/{{region}}/securityPolicies/{{name}} |
| 159 | +$ terraform import google_compute_region_security_policy.default {{project}}/{{region}}/{{name}} |
| 160 | +$ terraform import google_compute_region_security_policy.default {{region}}/{{name}} |
| 161 | +$ terraform import google_compute_region_security_policy.default {{name}} |
| 162 | +``` |
| 163 | + |
| 164 | +## User Project Overrides |
| 165 | + |
| 166 | +This resource supports [User Project Overrides](https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/provider_reference#user_project_override). |
0 commit comments