UNPKG

@volcengine/pulumi

Version:

A Pulumi package for creating and managing volcengine cloud resources.

127 lines 5.26 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.CustomBot = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a resource to manage waf custom bot * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as volcengine from "@volcengine/pulumi"; * * const foo = new volcengine.waf.CustomBot("foo", { * accurate: { * accurateRules: [ * { * httpObj: "request.uri", * objType: 1, * opretar: 2, * property: 0, * valueString: "tf", * }, * { * httpObj: "request.schema", * objType: 0, * opretar: 2, * property: 0, * valueString: "tf-2", * }, * ], * logic: 2, * }, * action: "observe", * botType: "tf-test", * description: "tf-test", * enable: 1, * host: "www.tf-test.com", * projectName: "default", * }); * ``` * * ## Import * * WafCustomBot can be imported using the id, e.g. * * ```sh * $ pulumi import volcengine:waf/customBot:CustomBot default resource_id * ``` */ class CustomBot extends pulumi.CustomResource { /** * Get an existing CustomBot 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 CustomBot(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of CustomBot. 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'] === CustomBot.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["accurate"] = state ? state.accurate : undefined; resourceInputs["action"] = state ? state.action : undefined; resourceInputs["advanced"] = state ? state.advanced : undefined; resourceInputs["botType"] = state ? state.botType : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["enable"] = state ? state.enable : undefined; resourceInputs["host"] = state ? state.host : undefined; resourceInputs["projectName"] = state ? state.projectName : undefined; resourceInputs["ruleTag"] = state ? state.ruleTag : undefined; resourceInputs["updateTime"] = state ? state.updateTime : undefined; } else { const args = argsOrState; if ((!args || args.accurate === undefined) && !opts.urn) { throw new Error("Missing required property 'accurate'"); } if ((!args || args.action === undefined) && !opts.urn) { throw new Error("Missing required property 'action'"); } if ((!args || args.botType === undefined) && !opts.urn) { throw new Error("Missing required property 'botType'"); } if ((!args || args.enable === undefined) && !opts.urn) { throw new Error("Missing required property 'enable'"); } if ((!args || args.host === undefined) && !opts.urn) { throw new Error("Missing required property 'host'"); } resourceInputs["accurate"] = args ? args.accurate : undefined; resourceInputs["action"] = args ? args.action : undefined; resourceInputs["botType"] = args ? args.botType : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["enable"] = args ? args.enable : undefined; resourceInputs["host"] = args ? args.host : undefined; resourceInputs["projectName"] = args ? args.projectName : undefined; resourceInputs["advanced"] = undefined /*out*/; resourceInputs["ruleTag"] = undefined /*out*/; resourceInputs["updateTime"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(CustomBot.__pulumiType, name, resourceInputs, opts); } } exports.CustomBot = CustomBot; /** @internal */ CustomBot.__pulumiType = 'volcengine:waf/customBot:CustomBot'; //# sourceMappingURL=customBot.js.map