UNPKG

@pulumi/sumologic

Version:

A Pulumi package for creating and managing sumologic cloud resources.

167 lines 8.55 kB
"use strict"; // *** 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.HttpSource = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Provides a [Sumologic HTTP source](https://help.sumologic.com/docs/send-data/hosted-collectors/http-source/logs-metrics), [Sumologic HTTP Traces source](https://help.sumologic.com/docs/apm/traces/get-started-transaction-tracing/http-traces-source/), [Sumologic Kinesis Log source](https://help.sumologic.com/docs/send-data/hosted-collectors/amazon-aws/aws-kinesis-firehose-logs-source/), [Sumologic HTTP_OTLP_source][4] and [Sumologic RUM source](https://help.sumologic.com/docs/apm/real-user-monitoring/#step-1-create-a-rum-http-traces-source). To start using Traces contact your Sumo account representative to activate. * * __IMPORTANT:__ The endpoint is stored in plain-text in the state. This is a potential security issue. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as sumologic from "@pulumi/sumologic"; * * const collector = new sumologic.Collector("collector", { * name: "my-collector", * description: "Just testing this", * }); * const httpSource = new sumologic.HttpSource("http_source", { * name: "HTTP", * description: "My description", * category: "my/source/category", * collectorId: collector.id, * filters: [{ * name: "Test Exclude Debug", * filterType: "Exclude", * regexp: ".*DEBUG.*", * }], * }); * const httpTracesSource = new sumologic.HttpSource("http_traces_source", { * name: "HTTP Traces", * description: "My description", * category: "my/source/category", * collectorId: collector.id, * contentType: "Zipkin", * }); * const kinesisLog = new sumologic.HttpSource("kinesisLog", { * name: "demo-name", * description: "demo-desc", * category: "demo-category", * contentType: "KinesisLog", * collectorId: test.id, * }); * const httpOtlpSource = new sumologic.HttpSource("http_otlp_source", { * name: "HTTP OTLP", * description: "My description", * category: "my/source/category", * contentType: "Otlp", * collectorId: test.id, * }); * ``` * * ## Import * * HTTP sources can be imported using the collector and source IDs (`collector/source`), e.g.: * * hcl * * ```sh * $ pulumi import sumologic:index/httpSource:HttpSource test 123/456 * ``` * * HTTP sources can be imported using the collector name and source name (`collectorName/sourceName`), e.g.: * * hcl * * ```sh * $ pulumi import sumologic:index/httpSource:HttpSource test my-test-collector/my-test-source * ``` * * [1]: https://help.sumologic.com/docs/send-data/hosted-collectors/http-source/logs-metrics * * [2]: https://help.sumologic.com/docs/apm/traces/get-started-transaction-tracing/http-traces-source/ * * [3]: https://help.sumologic.com/docs/send-data/hosted-collectors/amazon-aws/aws-kinesis-firehose-logs-source/ * * [4]: https://help.sumologic.com/docs/send-data/hosted-collectors/http-source/otlp/ * * [5]: https://help.sumologic.com/docs/apm/real-user-monitoring/#step-1-create-a-rum-http-traces-source */ class HttpSource extends pulumi.CustomResource { /** * Get an existing HttpSource 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 HttpSource(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of HttpSource. 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'] === HttpSource.__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["description"] = state ? state.description : 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["messagePerRequest"] = state ? state.messagePerRequest : undefined; resourceInputs["multilineProcessingEnabled"] = state ? state.multilineProcessingEnabled : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["timezone"] = state ? state.timezone : undefined; resourceInputs["url"] = state ? state.url : 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'"); } 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["description"] = args ? args.description : 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["messagePerRequest"] = args ? args.messagePerRequest : undefined; resourceInputs["multilineProcessingEnabled"] = args ? args.multilineProcessingEnabled : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["timezone"] = args ? args.timezone : undefined; resourceInputs["useAutolineMatching"] = args ? args.useAutolineMatching : undefined; resourceInputs["url"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(HttpSource.__pulumiType, name, resourceInputs, opts); } } exports.HttpSource = HttpSource; /** @internal */ HttpSource.__pulumiType = 'sumologic:index/httpSource:HttpSource'; //# sourceMappingURL=httpSource.js.map