UNPKG

@pulumi/sumologic

Version:

A Pulumi package for creating and managing sumologic cloud resources.

157 lines 8.03 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.CseAggregationRule = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Provides a Sumo Logic CSE [Aggregation Rule](https://help.sumologic.com/Cloud_SIEM_Enterprise/CSE_Rules/09_Write_an_Aggregation_Rule). * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as sumologic from "@pulumi/sumologic"; * * const aggregationRule = new sumologic.CseAggregationRule("aggregation_rule", { * aggregationFunctions: [{ * name: "distinct_eventid_count", * "function": "count_distinct", * arguments: ["metadata_deviceEventId"], * }], * descriptionExpression: "Signal description", * enabled: true, * entitySelectors: [{ * entityType: "_ip", * expression: "srcDevice_ip", * }], * groupByEntity: true, * groupByFields: ["dstDevice_hostname"], * matchExpression: "objectType = \"Network\"", * isPrototype: false, * name: "Aggregation Rule Example", * nameExpression: "Signal name", * severityMapping: { * type: "constant", * "default": 5, * }, * summaryExpression: "Signal summary", * tags: ["_mitreAttackTactic:TA0009"], * triggerExpression: "distinct_eventid_count > 5", * windowSize: "T30M", * suppressionWindowSize: 2100000, * }); * ``` * * ## Import * * Aggregation Rules can be imported using the field id, e.g.: * * hcl * * ```sh * $ pulumi import sumologic:index/cseAggregationRule:CseAggregationRule aggregation_rule id * ``` */ class CseAggregationRule extends pulumi.CustomResource { /** * Get an existing CseAggregationRule 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 CseAggregationRule(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of CseAggregationRule. 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'] === CseAggregationRule.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["aggregationFunctions"] = state ? state.aggregationFunctions : undefined; resourceInputs["descriptionExpression"] = state ? state.descriptionExpression : undefined; resourceInputs["enabled"] = state ? state.enabled : undefined; resourceInputs["entitySelectors"] = state ? state.entitySelectors : undefined; resourceInputs["groupByEntity"] = state ? state.groupByEntity : undefined; resourceInputs["groupByFields"] = state ? state.groupByFields : undefined; resourceInputs["isPrototype"] = state ? state.isPrototype : undefined; resourceInputs["matchExpression"] = state ? state.matchExpression : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["nameExpression"] = state ? state.nameExpression : undefined; resourceInputs["severityMapping"] = state ? state.severityMapping : undefined; resourceInputs["summaryExpression"] = state ? state.summaryExpression : undefined; resourceInputs["suppressionWindowSize"] = state ? state.suppressionWindowSize : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["triggerExpression"] = state ? state.triggerExpression : undefined; resourceInputs["windowSize"] = state ? state.windowSize : undefined; resourceInputs["windowSizeMillis"] = state ? state.windowSizeMillis : undefined; } else { const args = argsOrState; if ((!args || args.aggregationFunctions === undefined) && !opts.urn) { throw new Error("Missing required property 'aggregationFunctions'"); } if ((!args || args.descriptionExpression === undefined) && !opts.urn) { throw new Error("Missing required property 'descriptionExpression'"); } 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.matchExpression === undefined) && !opts.urn) { throw new Error("Missing required property 'matchExpression'"); } if ((!args || args.nameExpression === undefined) && !opts.urn) { throw new Error("Missing required property 'nameExpression'"); } if ((!args || args.severityMapping === undefined) && !opts.urn) { throw new Error("Missing required property 'severityMapping'"); } if ((!args || args.triggerExpression === undefined) && !opts.urn) { throw new Error("Missing required property 'triggerExpression'"); } if ((!args || args.windowSize === undefined) && !opts.urn) { throw new Error("Missing required property 'windowSize'"); } resourceInputs["aggregationFunctions"] = args ? args.aggregationFunctions : undefined; resourceInputs["descriptionExpression"] = args ? args.descriptionExpression : undefined; resourceInputs["enabled"] = args ? args.enabled : undefined; resourceInputs["entitySelectors"] = args ? args.entitySelectors : undefined; resourceInputs["groupByEntity"] = args ? args.groupByEntity : undefined; resourceInputs["groupByFields"] = args ? args.groupByFields : undefined; resourceInputs["isPrototype"] = args ? args.isPrototype : undefined; resourceInputs["matchExpression"] = args ? args.matchExpression : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["nameExpression"] = args ? args.nameExpression : undefined; resourceInputs["severityMapping"] = args ? args.severityMapping : undefined; resourceInputs["summaryExpression"] = args ? args.summaryExpression : undefined; resourceInputs["suppressionWindowSize"] = args ? args.suppressionWindowSize : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["triggerExpression"] = args ? args.triggerExpression : undefined; resourceInputs["windowSize"] = args ? args.windowSize : undefined; resourceInputs["windowSizeMillis"] = args ? args.windowSizeMillis : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(CseAggregationRule.__pulumiType, name, resourceInputs, opts); } } exports.CseAggregationRule = CseAggregationRule; /** @internal */ CseAggregationRule.__pulumiType = 'sumologic:index/cseAggregationRule:CseAggregationRule'; //# sourceMappingURL=cseAggregationRule.js.map