UNPKG

@pulumi/gcp

Version:

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

191 lines • 9.2 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.GatewaySecurityPolicyRule = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("../utilities")); /** * The GatewaySecurityPolicyRule resource is in a nested collection within a GatewaySecurityPolicy and represents * a traffic matching condition and associated action to perform. * * To get more information about GatewaySecurityPolicyRule, see: * * * [API documentation](https://cloud.google.com/secure-web-proxy/docs/reference/network-security/rest/v1/projects.locations.gatewaySecurityPolicies.rules) * * ## Example Usage * * ### Network Security Gateway Security Policy Rules Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const _default = new gcp.networksecurity.GatewaySecurityPolicy("default", { * name: "my-gateway-security-policy", * location: "us-central1", * description: "gateway security policy created to be used as reference by the rule.", * }); * const defaultGatewaySecurityPolicyRule = new gcp.networksecurity.GatewaySecurityPolicyRule("default", { * name: "my-gateway-security-policy-rule", * location: "us-central1", * gatewaySecurityPolicy: _default.name, * enabled: true, * description: "my description", * priority: 0, * sessionMatcher: "host() == 'example.com'", * basicProfile: "ALLOW", * }); * ``` * ### Network Security Gateway Security Policy Rules Advanced * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const _default = new gcp.networksecurity.GatewaySecurityPolicy("default", { * name: "my-gateway-security-policy", * location: "us-central1", * description: "gateway security policy created to be used as reference by the rule.", * }); * const defaultGatewaySecurityPolicyRule = new gcp.networksecurity.GatewaySecurityPolicyRule("default", { * name: "my-gateway-security-policy-rule", * location: "us-central1", * gatewaySecurityPolicy: _default.name, * enabled: true, * description: "my description", * priority: 0, * sessionMatcher: "host() == 'example.com'", * applicationMatcher: "request.method == 'POST'", * tlsInspectionEnabled: false, * basicProfile: "ALLOW", * }); * ``` * * ## Import * * GatewaySecurityPolicyRule can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{location}}/gatewaySecurityPolicies/{{gateway_security_policy}}/rules/{{name}}` * * `{{project}}/{{location}}/{{gateway_security_policy}}/{{name}}` * * `{{location}}/{{gateway_security_policy}}/{{name}}` * * When using the `pulumi import` command, GatewaySecurityPolicyRule can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:networksecurity/gatewaySecurityPolicyRule:GatewaySecurityPolicyRule default projects/{{project}}/locations/{{location}}/gatewaySecurityPolicies/{{gateway_security_policy}}/rules/{{name}} * $ pulumi import gcp:networksecurity/gatewaySecurityPolicyRule:GatewaySecurityPolicyRule default {{project}}/{{location}}/{{gateway_security_policy}}/{{name}} * $ pulumi import gcp:networksecurity/gatewaySecurityPolicyRule:GatewaySecurityPolicyRule default {{location}}/{{gateway_security_policy}}/{{name}} * ``` */ class GatewaySecurityPolicyRule extends pulumi.CustomResource { /** * Get an existing GatewaySecurityPolicyRule 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 GatewaySecurityPolicyRule(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'gcp:networksecurity/gatewaySecurityPolicyRule:GatewaySecurityPolicyRule'; /** * Returns true if the given object is an instance of GatewaySecurityPolicyRule. 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'] === GatewaySecurityPolicyRule.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["applicationMatcher"] = state?.applicationMatcher; resourceInputs["basicProfile"] = state?.basicProfile; resourceInputs["createTime"] = state?.createTime; resourceInputs["deletionPolicy"] = state?.deletionPolicy; resourceInputs["description"] = state?.description; resourceInputs["enabled"] = state?.enabled; resourceInputs["gatewaySecurityPolicy"] = state?.gatewaySecurityPolicy; resourceInputs["location"] = state?.location; resourceInputs["name"] = state?.name; resourceInputs["priority"] = state?.priority; resourceInputs["project"] = state?.project; resourceInputs["selfLink"] = state?.selfLink; resourceInputs["sessionMatcher"] = state?.sessionMatcher; resourceInputs["tlsInspectionEnabled"] = state?.tlsInspectionEnabled; resourceInputs["updateTime"] = state?.updateTime; } else { const args = argsOrState; if (args?.basicProfile === undefined && !opts.urn) { throw new Error("Missing required property 'basicProfile'"); } if (args?.enabled === undefined && !opts.urn) { throw new Error("Missing required property 'enabled'"); } if (args?.gatewaySecurityPolicy === undefined && !opts.urn) { throw new Error("Missing required property 'gatewaySecurityPolicy'"); } if (args?.location === undefined && !opts.urn) { throw new Error("Missing required property 'location'"); } if (args?.priority === undefined && !opts.urn) { throw new Error("Missing required property 'priority'"); } if (args?.sessionMatcher === undefined && !opts.urn) { throw new Error("Missing required property 'sessionMatcher'"); } resourceInputs["applicationMatcher"] = args?.applicationMatcher; resourceInputs["basicProfile"] = args?.basicProfile; resourceInputs["deletionPolicy"] = args?.deletionPolicy; resourceInputs["description"] = args?.description; resourceInputs["enabled"] = args?.enabled; resourceInputs["gatewaySecurityPolicy"] = args?.gatewaySecurityPolicy; resourceInputs["location"] = args?.location; resourceInputs["name"] = args?.name; resourceInputs["priority"] = args?.priority; resourceInputs["project"] = args?.project; resourceInputs["sessionMatcher"] = args?.sessionMatcher; resourceInputs["tlsInspectionEnabled"] = args?.tlsInspectionEnabled; resourceInputs["createTime"] = undefined /*out*/; resourceInputs["selfLink"] = undefined /*out*/; resourceInputs["updateTime"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(GatewaySecurityPolicyRule.__pulumiType, name, resourceInputs, opts); } } exports.GatewaySecurityPolicyRule = GatewaySecurityPolicyRule; //# sourceMappingURL=gatewaySecurityPolicyRule.js.map