UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

124 lines 4.91 kB
"use strict"; // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.FirewallRule = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * 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 * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const myProject = new gcp.organizations.Project("my_project", { * name: "tf-test-project", * projectId: "ae-project", * orgId: "123456789", * billingAccount: "000000-0000000-0000000-000000", * deletionPolicy: "DELETE", * }); * const app = new gcp.appengine.Application("app", { * project: myProject.projectId, * locationId: "us-central", * }); * const rule = new gcp.appengine.FirewallRule("rule", { * project: app.project, * priority: 1000, * action: "ALLOW", * sourceRange: "*", * }); * ``` * * ## Import * * FirewallRule can be imported using any of these accepted formats: * * * `apps/{{project}}/firewall/ingressRules/{{priority}}` * * * `{{project}}/{{priority}}` * * * `{{priority}}` * * When using the `pulumi import` command, FirewallRule can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:appengine/firewallRule:FirewallRule default apps/{{project}}/firewall/ingressRules/{{priority}} * ``` * * ```sh * $ pulumi import gcp:appengine/firewallRule:FirewallRule default {{project}}/{{priority}} * ``` * * ```sh * $ pulumi import gcp:appengine/firewallRule:FirewallRule default {{priority}} * ``` */ class FirewallRule extends pulumi.CustomResource { /** * Get an existing FirewallRule resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name, id, state, opts) { return new FirewallRule(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of FirewallRule. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === FirewallRule.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["action"] = state ? state.action : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["priority"] = state ? state.priority : undefined; resourceInputs["project"] = state ? state.project : undefined; resourceInputs["sourceRange"] = state ? state.sourceRange : undefined; } else { const args = argsOrState; if ((!args || args.action === undefined) && !opts.urn) { throw new Error("Missing required property 'action'"); } if ((!args || args.sourceRange === undefined) && !opts.urn) { throw new Error("Missing required property 'sourceRange'"); } resourceInputs["action"] = args ? args.action : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["priority"] = args ? args.priority : undefined; resourceInputs["project"] = args ? args.project : undefined; resourceInputs["sourceRange"] = args ? args.sourceRange : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(FirewallRule.__pulumiType, name, resourceInputs, opts); } } exports.FirewallRule = FirewallRule; /** @internal */ FirewallRule.__pulumiType = 'gcp:appengine/firewallRule:FirewallRule'; //# sourceMappingURL=firewallRule.js.map