@pulumi/sumologic
Version:
A Pulumi package for creating and managing sumologic cloud resources.
141 lines • 6.92 kB
JavaScript
;
// *** 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.CseThresholdRule = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Provides a Sumo Logic CSE [Threshold Rule](https://help.sumologic.com/Cloud_SIEM_Enterprise/CSE_Rules/05_Write_a_Threshold_Rule).
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as sumologic from "@pulumi/sumologic";
*
* const thresholdRule = new sumologic.CseThresholdRule("threshold_rule", {
* countDistinct: true,
* countField: "dstDevice_hostname",
* description: "Signal description",
* enabled: true,
* entitySelectors: [{
* entityType: "_ip",
* expression: "srcDevice_ip",
* }],
* expression: "objectType = \"Network\"",
* groupByFields: ["dstDevice_hostname"],
* isPrototype: false,
* limit: 1000,
* name: "Threshold Rule Example",
* severity: 5,
* summaryExpression: "Signal summary",
* tags: ["_mitreAttackTactic:TA0009"],
* windowSize: "T30M",
* suppressionWindowSize: 2100000,
* });
* ```
*
* ## Import
*
* Threshold Rules can be imported using the field id, e.g.:
*
* hcl
*
* ```sh
* $ pulumi import sumologic:index/cseThresholdRule:CseThresholdRule threshold_rule id
* ```
*/
class CseThresholdRule extends pulumi.CustomResource {
/**
* Get an existing CseThresholdRule 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 CseThresholdRule(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of CseThresholdRule. 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'] === CseThresholdRule.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["countDistinct"] = state ? state.countDistinct : undefined;
resourceInputs["countField"] = state ? state.countField : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["enabled"] = state ? state.enabled : undefined;
resourceInputs["entitySelectors"] = state ? state.entitySelectors : undefined;
resourceInputs["expression"] = state ? state.expression : undefined;
resourceInputs["groupByFields"] = state ? state.groupByFields : undefined;
resourceInputs["isPrototype"] = state ? state.isPrototype : undefined;
resourceInputs["limit"] = state ? state.limit : undefined;
resourceInputs["name"] = state ? state.name : 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.expression === undefined) && !opts.urn) {
throw new Error("Missing required property 'expression'");
}
if ((!args || args.limit === undefined) && !opts.urn) {
throw new Error("Missing required property 'limit'");
}
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["countDistinct"] = args ? args.countDistinct : undefined;
resourceInputs["countField"] = args ? args.countField : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["enabled"] = args ? args.enabled : undefined;
resourceInputs["entitySelectors"] = args ? args.entitySelectors : undefined;
resourceInputs["expression"] = args ? args.expression : undefined;
resourceInputs["groupByFields"] = args ? args.groupByFields : undefined;
resourceInputs["isPrototype"] = args ? args.isPrototype : undefined;
resourceInputs["limit"] = args ? args.limit : undefined;
resourceInputs["name"] = args ? args.name : 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(CseThresholdRule.__pulumiType, name, resourceInputs, opts);
}
}
exports.CseThresholdRule = CseThresholdRule;
/** @internal */
CseThresholdRule.__pulumiType = 'sumologic:index/cseThresholdRule:CseThresholdRule';
//# sourceMappingURL=cseThresholdRule.js.map