UNPKG

@pulumi/fastly

Version:

A Pulumi package for creating and managing fastly cloud resources.. Based on terraform-provider-fastly: version v4

95 lines 3.84 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! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.NgwafVirtualPatches = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Provides a Fastly Next-Gen WAF Virtual Patch. Virtual patching * rules block or log requests matching specific vulnerabilities. * * ## Example Usage * * Basic usage: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as fastly from "@pulumi/fastly"; * * const demo = new fastly.NgwafVirtualPatches("demo", { * action: "block", * enabled: true, * virtualPatchId: "CVE-2017-5638", * workspaceId: demoFastlyNgwafWorkspace.id, * }); * ``` * * ## Import * * Fastly Next-Gen WAF Virtual Patches can be imported using their workspace and Virtual Patch ID, e.g. * * ```sh * $ pulumi import fastly:index/ngwafVirtualPatches:NgwafVirtualPatches demo <workspace_id>/<virtual_patch_id> * ``` */ class NgwafVirtualPatches extends pulumi.CustomResource { /** * Get an existing NgwafVirtualPatches 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 NgwafVirtualPatches(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of NgwafVirtualPatches. 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'] === NgwafVirtualPatches.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["action"] = state?.action; resourceInputs["enabled"] = state?.enabled; resourceInputs["virtualPatchId"] = state?.virtualPatchId; resourceInputs["workspaceId"] = state?.workspaceId; } else { const args = argsOrState; if (args?.action === undefined && !opts.urn) { throw new Error("Missing required property 'action'"); } if (args?.enabled === undefined && !opts.urn) { throw new Error("Missing required property 'enabled'"); } if (args?.virtualPatchId === undefined && !opts.urn) { throw new Error("Missing required property 'virtualPatchId'"); } if (args?.workspaceId === undefined && !opts.urn) { throw new Error("Missing required property 'workspaceId'"); } resourceInputs["action"] = args?.action; resourceInputs["enabled"] = args?.enabled; resourceInputs["virtualPatchId"] = args?.virtualPatchId; resourceInputs["workspaceId"] = args?.workspaceId; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(NgwafVirtualPatches.__pulumiType, name, resourceInputs, opts); } } exports.NgwafVirtualPatches = NgwafVirtualPatches; /** @internal */ NgwafVirtualPatches.__pulumiType = 'fastly:index/ngwafVirtualPatches:NgwafVirtualPatches'; //# sourceMappingURL=ngwafVirtualPatches.js.map