UNPKG

@pulumi/sumologic

Version:

A Pulumi package for creating and managing sumologic cloud resources.

141 lines 6.52 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.CseChainRule = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Provides a Sumo Logic CSE [Chain Rule](https://help.sumologic.com/Cloud_SIEM_Enterprise/CSE_Rules/07_Write_a_Chain_Rule). * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as sumologic from "@pulumi/sumologic"; * * const chainRule = new sumologic.CseChainRule("chain_rule", { * description: "Signal description", * enabled: true, * entitySelectors: [{ * entityType: "_username", * expression: "user_username", * }], * expressionsAndLimits: [ * { * expression: "success = false", * limit: 5, * }, * { * expression: "success = true", * limit: 1, * }, * ], * groupByFields: [], * isPrototype: false, * ordered: true, * name: "Chain Rule Example", * severity: 5, * summaryExpression: "Signal summary", * tags: ["_mitreAttackTactic:TA0009"], * windowSize: "T30M", * suppressionWindowSize: 2100000, * }); * ``` * * ## Import * * Chain Rules can be imported using the field id, e.g.: * * hcl * * ```sh * $ pulumi import sumologic:index/cseChainRule:CseChainRule chain_rule id * ``` */ class CseChainRule extends pulumi.CustomResource { /** * Get an existing CseChainRule 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 CseChainRule(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of CseChainRule. 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'] === CseChainRule.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["enabled"] = state ? state.enabled : undefined; resourceInputs["entitySelectors"] = state ? state.entitySelectors : undefined; resourceInputs["expressionsAndLimits"] = state ? state.expressionsAndLimits : undefined; resourceInputs["groupByFields"] = state ? state.groupByFields : undefined; resourceInputs["isPrototype"] = state ? state.isPrototype : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["ordered"] = state ? state.ordered : undefined; resourceInputs["severity"] = state ? state.severity : undefined; resourceInputs["summaryExpression"] = state ? state.summaryExpression : undefined; resourceInputs["suppressionWindowSize"] = state ? state.suppressionWindowSize : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["windowSize"] = state ? state.windowSize : undefined; resourceInputs["windowSizeMillis"] = state ? state.windowSizeMillis : undefined; } else { const args = argsOrState; if ((!args || args.description === undefined) && !opts.urn) { throw new Error("Missing required property 'description'"); } if ((!args || args.enabled === undefined) && !opts.urn) { throw new Error("Missing required property 'enabled'"); } if ((!args || args.entitySelectors === undefined) && !opts.urn) { throw new Error("Missing required property 'entitySelectors'"); } if ((!args || args.expressionsAndLimits === undefined) && !opts.urn) { throw new Error("Missing required property 'expressionsAndLimits'"); } if ((!args || args.severity === undefined) && !opts.urn) { throw new Error("Missing required property 'severity'"); } if ((!args || args.windowSize === undefined) && !opts.urn) { throw new Error("Missing required property 'windowSize'"); } resourceInputs["description"] = args ? args.description : undefined; resourceInputs["enabled"] = args ? args.enabled : undefined; resourceInputs["entitySelectors"] = args ? args.entitySelectors : undefined; resourceInputs["expressionsAndLimits"] = args ? args.expressionsAndLimits : undefined; resourceInputs["groupByFields"] = args ? args.groupByFields : undefined; resourceInputs["isPrototype"] = args ? args.isPrototype : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["ordered"] = args ? args.ordered : undefined; resourceInputs["severity"] = args ? args.severity : undefined; resourceInputs["summaryExpression"] = args ? args.summaryExpression : undefined; resourceInputs["suppressionWindowSize"] = args ? args.suppressionWindowSize : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["windowSize"] = args ? args.windowSize : undefined; resourceInputs["windowSizeMillis"] = args ? args.windowSizeMillis : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(CseChainRule.__pulumiType, name, resourceInputs, opts); } } exports.CseChainRule = CseChainRule; /** @internal */ CseChainRule.__pulumiType = 'sumologic:index/cseChainRule:CseChainRule'; //# sourceMappingURL=cseChainRule.js.map