Google App Engine Firewall Rule
This page shows how to write Terraform for App Engine Firewall Rule and write them securely.
google_app_engine_firewall_rule (Terraform)
The Firewall Rule in App Engine can be configured in Terraform with the resource name google_app_engine_firewall_rule
. The following sections describe 5 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "google_app_engine_firewall_rule" "gae_firewall_rule_allow_cron" {
project = var.bbq_project
priority = 1000
action = "ALLOW"
source_range = "0.1.0.1"
description = "Allow GAE cron requests"
resource "google_app_engine_firewall_rule" "broad_firewall" {
count = length(var.broad_range_cidrs)
project = google_app_engine_application.gae_import_service.project
priority = 1000 + count.index
action = "ALLOW"
description = "Broad office ips"
resource "google_app_engine_firewall_rule" "whitelist" {
project = "try-10"
priority = 1000
action = "ALLOW"
source_range = "109.155.0.0"
}
resource "google_app_engine_firewall_rule" "gae_firewall_rule_allow_cron" {
project = var.bbq_project
priority = 1000
action = "ALLOW"
source_range = "0.1.0.1"
description = "Allow GAE cron requests"
resource "google_app_engine_firewall_rule" "firewall_rule" {
source_range = var.source_range
action = var.action
description = var.description
priority = var.priority
Parameters
-
action
required - string
The action to take if this rule matches. Possible values: ["UNSPECIFIED_ACTION", "ALLOW", "DENY"]
-
description
optional - string
An optional string description of this rule.
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 computed - string -
source_range
required - string
IP address or range, defined using CIDR notation, of requests that this rule applies to.
Explanation in Terraform Registry
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
- How-to Guides
Frequently asked questions
What is Google App Engine Firewall Rule?
Google App Engine Firewall Rule is a resource for App Engine of Google Cloud Platform. Settings can be wrote in Terraform.
Where can I find the example code for the Google App Engine Firewall Rule?
For Terraform, the gustcol/Canivete, broadinstitute/import_service_terraform and ianhomer/try-gcp source code examples are useful. See the Terraform Example section for further details.