@pulumi/sumologic
Version:
A Pulumi package for creating and managing sumologic cloud resources.
112 lines • 4.88 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.DataForwardingRule = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Provider to manage [Sumologic Data Forwarding Rule](https://help.sumologic.com/docs/manage/data-forwarding/amazon-s3-bucket/#forward-datato-s3)
*
* ## Example Usage
*
* For Partitions
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as sumologic from "@pulumi/sumologic";
*
* const testPartition = new sumologic.Partition("test_partition", {
* name: "testing_rule_partitions",
* routingExpression: "_sourcecategory=abc/Terraform",
* isCompliant: false,
* retentionPeriod: 30,
* analyticsTier: "flex",
* });
* const exampleDataForwardingRule = new sumologic.DataForwardingRule("example_data_forwarding_rule", {
* indexId: testPartition.id,
* destinationId: "00000000000732AA",
* enabled: true,
* fileFormat: "test/{index}/{day}/{hour}/{minute}",
* payloadSchema: "builtInFields",
* format: "json",
* });
* ```
* For Scheduled Views
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as sumologic from "@pulumi/sumologic";
*
* const failedConnections = new sumologic.ScheduledView("failed_connections", {
* indexName: "failed_connections",
* query: "_sourceCategory=fire | count",
* startTime: "2024-09-01T00:00:00Z",
* retentionPeriod: 1,
* });
* const testRuleSv = new sumologic.DataForwardingRule("test_rule_sv", {
* indexId: failedConnections.indexId,
* destinationId: testDestination.id,
* enabled: false,
* fileFormat: "test/{index}",
* payloadSchema: "raw",
* format: "text",
* });
* ```
*/
class DataForwardingRule extends pulumi.CustomResource {
/**
* Get an existing DataForwardingRule 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 DataForwardingRule(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of DataForwardingRule. 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'] === DataForwardingRule.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["destinationId"] = state ? state.destinationId : undefined;
resourceInputs["enabled"] = state ? state.enabled : undefined;
resourceInputs["fileFormat"] = state ? state.fileFormat : undefined;
resourceInputs["format"] = state ? state.format : undefined;
resourceInputs["indexId"] = state ? state.indexId : undefined;
resourceInputs["payloadSchema"] = state ? state.payloadSchema : undefined;
}
else {
const args = argsOrState;
if ((!args || args.destinationId === undefined) && !opts.urn) {
throw new Error("Missing required property 'destinationId'");
}
if ((!args || args.indexId === undefined) && !opts.urn) {
throw new Error("Missing required property 'indexId'");
}
resourceInputs["destinationId"] = args ? args.destinationId : undefined;
resourceInputs["enabled"] = args ? args.enabled : undefined;
resourceInputs["fileFormat"] = args ? args.fileFormat : undefined;
resourceInputs["format"] = args ? args.format : undefined;
resourceInputs["indexId"] = args ? args.indexId : undefined;
resourceInputs["payloadSchema"] = args ? args.payloadSchema : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(DataForwardingRule.__pulumiType, name, resourceInputs, opts);
}
}
exports.DataForwardingRule = DataForwardingRule;
/** @internal */
DataForwardingRule.__pulumiType = 'sumologic:index/dataForwardingRule:DataForwardingRule';
//# sourceMappingURL=dataForwardingRule.js.map