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:
How-to Guides
Example Usage
App Engine Firewall Rule Basic
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.organizations.Project;
import com.pulumi.gcp.organizations.ProjectArgs;
import com.pulumi.gcp.appengine.Application;
import com.pulumi.gcp.appengine.ApplicationArgs;
import com.pulumi.gcp.appengine.FirewallRule;
import com.pulumi.gcp.appengine.FirewallRuleArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var myProject = new Project("myProject", ProjectArgs.builder()
.projectId("ae-project")
.orgId("123456789")
.billingAccount("000000-0000000-0000000-000000")
.build());
var app = new Application("app", ApplicationArgs.builder()
.project(myProject.projectId())
.locationId("us-central")
.build());
var rule = new FirewallRule("rule", FirewallRuleArgs.builder()
.project(app.project())
.priority(1000)
.action("ALLOW")
.sourceRange("*")
.build());
}
}Content copied to clipboard
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 to import FirewallRule using one of the formats above. For exampletf import { id = "apps/{{project}}/firewall/ingressRules/{{priority}}" to = google_app_engine_firewall_rule.default }
$ pulumi import gcp:appengine/firewallRule:FirewallRule 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 exampleContent copied to clipboard
$ pulumi import gcp:appengine/firewallRule:FirewallRule default apps/{{project}}/firewall/ingressRules/{{priority}}Content copied to clipboard
$ pulumi import gcp:appengine/firewallRule:FirewallRule default {{project}}/{{priority}}Content copied to clipboard
$ pulumi import gcp:appengine/firewallRule:FirewallRule default {{priority}}Content copied to clipboard