@pulumi/sumologic
Version:
A Pulumi package for creating and managing sumologic cloud resources.
127 lines • 5.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.CseMatchRule = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Provides a Sumo Logic CSE [Match Rule](https://help.sumologic.com/Cloud_SIEM_Enterprise/CSE_Rules/03_Write_a_Match_Rule).
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as sumologic from "@pulumi/sumologic";
*
* const matchRule = new sumologic.CseMatchRule("match_rule", {
* descriptionExpression: "Signal description",
* enabled: true,
* entitySelectors: [{
* entityType: "_ip",
* expression: "srcDevice_ip",
* }],
* expression: "objectType = \"Network\"",
* isPrototype: false,
* name: "Match Rule Example",
* nameExpression: "Signal name",
* severityMapping: {
* type: "constant",
* "default": 5,
* },
* summaryExpression: "Signal summary",
* tags: ["_mitreAttackTactic:TA0009"],
* suppressionWindowSize: 2100000,
* });
* ```
*
* ## Import
*
* Match Rules can be imported using the field id, e.g.:
*
* hcl
*
* ```sh
* $ pulumi import sumologic:index/cseMatchRule:CseMatchRule match_rule id
* ```
*/
class CseMatchRule extends pulumi.CustomResource {
/**
* Get an existing CseMatchRule 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 CseMatchRule(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of CseMatchRule. 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'] === CseMatchRule.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["descriptionExpression"] = state ? state.descriptionExpression : undefined;
resourceInputs["enabled"] = state ? state.enabled : undefined;
resourceInputs["entitySelectors"] = state ? state.entitySelectors : undefined;
resourceInputs["expression"] = state ? state.expression : undefined;
resourceInputs["isPrototype"] = state ? state.isPrototype : 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;
}
else {
const args = argsOrState;
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.expression === undefined) && !opts.urn) {
throw new Error("Missing required property 'expression'");
}
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'");
}
resourceInputs["descriptionExpression"] = args ? args.descriptionExpression : undefined;
resourceInputs["enabled"] = args ? args.enabled : undefined;
resourceInputs["entitySelectors"] = args ? args.entitySelectors : undefined;
resourceInputs["expression"] = args ? args.expression : undefined;
resourceInputs["isPrototype"] = args ? args.isPrototype : 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;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(CseMatchRule.__pulumiType, name, resourceInputs, opts);
}
}
exports.CseMatchRule = CseMatchRule;
/** @internal */
CseMatchRule.__pulumiType = 'sumologic:index/cseMatchRule:CseMatchRule';
//# sourceMappingURL=cseMatchRule.js.map