UNPKG

@pulumi/gcp

Version:

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

141 lines 5.81 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.FirewallRule = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(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}} * $ pulumi import gcp:appengine/firewallRule:FirewallRule default {{project}}/{{priority}} * $ 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, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'gcp:appengine/firewallRule:FirewallRule'; /** * 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?.action; resourceInputs["deletionPolicy"] = state?.deletionPolicy; resourceInputs["description"] = state?.description; resourceInputs["priority"] = state?.priority; resourceInputs["project"] = state?.project; resourceInputs["sourceRange"] = state?.sourceRange; } else { const args = argsOrState; if (args?.action === undefined && !opts.urn) { throw new Error("Missing required property 'action'"); } if (args?.sourceRange === undefined && !opts.urn) { throw new Error("Missing required property 'sourceRange'"); } resourceInputs["action"] = args?.action; resourceInputs["deletionPolicy"] = args?.deletionPolicy; resourceInputs["description"] = args?.description; resourceInputs["priority"] = args?.priority; resourceInputs["project"] = args?.project; resourceInputs["sourceRange"] = args?.sourceRange; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(FirewallRule.__pulumiType, name, resourceInputs, opts); } } exports.FirewallRule = FirewallRule; //# sourceMappingURL=firewallRule.js.map