@pulumi/sumologic
Version:
A Pulumi package for creating and managing sumologic cloud resources.
99 lines • 4.06 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.FieldExtractionRule = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Provides a [Sumologic Field Extraction Rule](https://help.sumologic.com/Manage/Field-Extractions).
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as sumologic from "@pulumi/sumologic";
*
* const fieldExtractionRule = new sumologic.FieldExtractionRule("fieldExtractionRule", {
* name: "exampleFieldExtractionRule",
* scope: "_sourceHost=127.0.0.1",
* parseExpression: "csv _raw extract 1 as f1",
* enabled: true,
* });
* ```
*
* ## Attributes reference
*
* The following attributes are exported:
*
* - `id` - Unique identifier for the field extraction rule.
*
* ## Import
*
* Extraction Rules can be imported using the extraction rule id, e.g.:
*
* hcl
*
* ```sh
* $ pulumi import sumologic:index/fieldExtractionRule:FieldExtractionRule fieldExtractionRule id
* ```
*
* [1]: https://help.sumologic.com/Manage/Field-Extractions
*/
class FieldExtractionRule extends pulumi.CustomResource {
/**
* Get an existing FieldExtractionRule 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 FieldExtractionRule(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of FieldExtractionRule. 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'] === FieldExtractionRule.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["enabled"] = state ? state.enabled : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["parseExpression"] = state ? state.parseExpression : undefined;
resourceInputs["scope"] = state ? state.scope : undefined;
}
else {
const args = argsOrState;
if ((!args || args.enabled === undefined) && !opts.urn) {
throw new Error("Missing required property 'enabled'");
}
if ((!args || args.parseExpression === undefined) && !opts.urn) {
throw new Error("Missing required property 'parseExpression'");
}
if ((!args || args.scope === undefined) && !opts.urn) {
throw new Error("Missing required property 'scope'");
}
resourceInputs["enabled"] = args ? args.enabled : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["parseExpression"] = args ? args.parseExpression : undefined;
resourceInputs["scope"] = args ? args.scope : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(FieldExtractionRule.__pulumiType, name, resourceInputs, opts);
}
}
exports.FieldExtractionRule = FieldExtractionRule;
/** @internal */
FieldExtractionRule.__pulumiType = 'sumologic:index/fieldExtractionRule:FieldExtractionRule';
//# sourceMappingURL=fieldExtractionRule.js.map