blob: 67bbd321a2226e4eaa7125c06b9ef26a2ea02842 [file] [log] [blame]
---
# ----------------------------------------------------------------------------
#
# *** 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: "App Engine"
description: |-
A single firewall rule that is evaluated against incoming traffic
and provides an action to take on matched requests.
---
# google\_app\_engine\_firewall\_rule
A single firewall rule that is evaluated against incoming traffic
and provides an action to take on matched requests.
To get more information about FirewallRule, see:
* [API documentation](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.firewall.ingressRules)
* How-to Guides
* [Official Documentation](https://cloud.google.com/appengine/docs/standard/python/creating-firewalls#creating_firewall_rules)
## Example Usage - App Engine Firewall Rule Basic
```hcl
resource "google_project" "my_project" {
name = "tf-test-project"
project_id = "ae-project"
org_id = "123456789"
billing_account = "000000-0000000-0000000-000000"
}
resource "google_app_engine_application" "app" {
project = google_project.my_project.project_id
location_id = "us-central"
}
resource "google_app_engine_firewall_rule" "rule" {
project = google_app_engine_application.app.project
priority = 1000
action = "ALLOW"
source_range = "*"
}
```
## Argument Reference
The following arguments are supported:
* `source_range` -
(Required)
IP address or range, defined using CIDR notation, of requests that this rule applies to.
* `action` -
(Required)
The action to take if this rule matches.
Possible values are: `UNSPECIFIED_ACTION`, `ALLOW`, `DENY`.
- - -
* `description` -
(Optional)
An optional string description of this rule.
* `priority` -
(Optional)
A positive integer that defines the order of rule evaluation.
Rules with the lowest priority are evaluated first.
A default rule at priority Int32.MaxValue matches all IPv4 and
IPv6 traffic when no previous rule matches. Only the action of
this rule can be modified by the user.
* `project` - (Optional) The ID of the project in which the resource belongs.
If it is not provided, the provider project is used.
## Attributes Reference
In addition to the arguments listed above, the following computed attributes are exported:
* `id` - an identifier for the resource with format `apps/{{project}}/firewall/ingressRules/{{priority}}`
## 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
FirewallRule can be imported using any of these accepted formats:
* `apps/{{project}}/firewall/ingressRules/{{priority}}`
* `{{project}}/{{priority}}`
* `{{priority}}`
In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import FirewallRule using one of the formats above. For example:
```tf
import {
id = "apps/{{project}}/firewall/ingressRules/{{priority}}"
to = google_app_engine_firewall_rule.default
}
```
When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), FirewallRule can be imported using one of the formats above. For example:
```
$ terraform import google_app_engine_firewall_rule.default apps/{{project}}/firewall/ingressRules/{{priority}}
$ terraform import google_app_engine_firewall_rule.default {{project}}/{{priority}}
$ terraform import google_app_engine_firewall_rule.default {{priority}}
```
## User Project Overrides
This resource supports [User Project Overrides](https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/provider_reference#user_project_override).