@pulumi/sumologic
Version:
A Pulumi package for creating and managing sumologic cloud resources.
142 lines • 7.38 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.LocalFileSource = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Provides a [Sumologic Local File Source](https://help.sumologic.com/docs/send-data/installed-collectors/sources/local-file-source/).
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as sumologic from "@pulumi/sumologic";
*
* const installedCollector = new sumologic.InstalledCollector("installed_collector", {
* name: "test-collector",
* category: "macos/test",
* ephemeral: true,
* });
* const local = new sumologic.LocalFileSource("local", {
* name: "localfile-mac",
* description: "test",
* category: "test",
* collectorId: installedCollector.id,
* pathExpression: "/Applications/Sumo Logic Collector/logs/*.log.*",
* });
* ```
*
* ## Import
*
* Local file sources can be imported using the collector and source IDs, e.g.:
*
* hcl
*
* ```sh
* $ pulumi import sumologic:index/localFileSource:LocalFileSource test 123/456
* ```
*
* Local file sources can also be imported using the collector name and source name, e.g.:
*
* hcl
*
* ```sh
* $ pulumi import sumologic:index/localFileSource:LocalFileSource test my-test-collector/my-test-source
* ```
*
* [1]: https://help.sumologic.com/docs/send-data/installed-collectors/sources/local-file-source/
*
* [2]: https://help.sumologic.com/Manage/Fields
*
* [3]: https://help.sumologic.com/docs/send-data/installed-collectors/sources/local-file-source/#supported-encoding-for-local-file-sources
*/
class LocalFileSource extends pulumi.CustomResource {
/**
* Get an existing LocalFileSource 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 LocalFileSource(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of LocalFileSource. 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'] === LocalFileSource.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["automaticDateParsing"] = state ? state.automaticDateParsing : undefined;
resourceInputs["category"] = state ? state.category : undefined;
resourceInputs["collectorId"] = state ? state.collectorId : undefined;
resourceInputs["contentType"] = state ? state.contentType : undefined;
resourceInputs["cutoffRelativeTime"] = state ? state.cutoffRelativeTime : undefined;
resourceInputs["cutoffTimestamp"] = state ? state.cutoffTimestamp : undefined;
resourceInputs["defaultDateFormats"] = state ? state.defaultDateFormats : undefined;
resourceInputs["denyLists"] = state ? state.denyLists : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["encoding"] = state ? state.encoding : undefined;
resourceInputs["fields"] = state ? state.fields : undefined;
resourceInputs["filters"] = state ? state.filters : undefined;
resourceInputs["forceTimezone"] = state ? state.forceTimezone : undefined;
resourceInputs["hashAlgorithm"] = state ? state.hashAlgorithm : undefined;
resourceInputs["hostName"] = state ? state.hostName : undefined;
resourceInputs["manualPrefixRegexp"] = state ? state.manualPrefixRegexp : undefined;
resourceInputs["multilineProcessingEnabled"] = state ? state.multilineProcessingEnabled : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["pathExpression"] = state ? state.pathExpression : undefined;
resourceInputs["timezone"] = state ? state.timezone : undefined;
resourceInputs["useAutolineMatching"] = state ? state.useAutolineMatching : undefined;
}
else {
const args = argsOrState;
if ((!args || args.collectorId === undefined) && !opts.urn) {
throw new Error("Missing required property 'collectorId'");
}
if ((!args || args.pathExpression === undefined) && !opts.urn) {
throw new Error("Missing required property 'pathExpression'");
}
resourceInputs["automaticDateParsing"] = args ? args.automaticDateParsing : undefined;
resourceInputs["category"] = args ? args.category : undefined;
resourceInputs["collectorId"] = args ? args.collectorId : undefined;
resourceInputs["contentType"] = args ? args.contentType : undefined;
resourceInputs["cutoffRelativeTime"] = args ? args.cutoffRelativeTime : undefined;
resourceInputs["cutoffTimestamp"] = args ? args.cutoffTimestamp : undefined;
resourceInputs["defaultDateFormats"] = args ? args.defaultDateFormats : undefined;
resourceInputs["denyLists"] = args ? args.denyLists : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["encoding"] = args ? args.encoding : undefined;
resourceInputs["fields"] = args ? args.fields : undefined;
resourceInputs["filters"] = args ? args.filters : undefined;
resourceInputs["forceTimezone"] = args ? args.forceTimezone : undefined;
resourceInputs["hashAlgorithm"] = args ? args.hashAlgorithm : undefined;
resourceInputs["hostName"] = args ? args.hostName : undefined;
resourceInputs["manualPrefixRegexp"] = args ? args.manualPrefixRegexp : undefined;
resourceInputs["multilineProcessingEnabled"] = args ? args.multilineProcessingEnabled : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["pathExpression"] = args ? args.pathExpression : undefined;
resourceInputs["timezone"] = args ? args.timezone : undefined;
resourceInputs["useAutolineMatching"] = args ? args.useAutolineMatching : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(LocalFileSource.__pulumiType, name, resourceInputs, opts);
}
}
exports.LocalFileSource = LocalFileSource;
/** @internal */
LocalFileSource.__pulumiType = 'sumologic:index/localFileSource:LocalFileSource';
//# sourceMappingURL=localFileSource.js.map