UNPKG

@pulumi/sumologic

Version:

A Pulumi package for creating and managing sumologic cloud resources.

218 lines 10 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.PollingSource = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * !> **WARNING:** This data source is deprecated and will be removed in the next major version. * * Provides a Sumologic Polling source. This source is used to import data from various AWS products, eg. AWS S3 buckets, Cloudwatch Metrics etc. * * __IMPORTANT:__ The AWS credentials are 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 tagfilters = [ * { * type: "TagFilters", * namespace: "All", * tags: ["k3=v3"], * }, * { * type: "TagFilters", * namespace: "AWS/Route53", * tags: ["k1=v1"], * }, * { * type: "TagFilters", * namespace: "AWS/S3", * tags: ["k2=v2"], * }, * ]; * const collector = new sumologic.Collector("collector", { * name: "my-collector", * description: "Just testing this", * }); * const s3Audit = new sumologic.PollingSource("s3_audit", { * name: "Amazon S3 Audit", * description: "My description", * category: "aws/s3audit", * contentType: "AwsS3AuditBucket", * scanInterval: 300000, * paused: false, * collectorId: collector.id, * filters: [{ * name: "Exclude Comments", * filterType: "Exclude", * regexp: "#.*", * }], * authentication: { * type: "S3BucketAuthentication", * accessKey: "someKey", * secretKey: "******", * }, * path: { * type: "S3BucketPathExpression", * bucketName: "Bucket1", * pathExpression: "*", * }, * }); * const cwMetrics = new sumologic.PollingSource("cw_metrics", { * name: "CloudWatch Metrics", * description: "My description", * category: "aws/cw", * contentType: "AwsCloudWatch", * scanInterval: 300000, * paused: false, * collectorId: collector.id, * authentication: { * type: "AWSRoleBasedAuthentication", * roleArn: "arn:aws:iam::604066827510:role/cw-role-SumoRole-4AOLS73TGKYI", * }, * path: { * tagFilters: tagfilters.map((v, k) => ({key: k, value: v})).map(entry => ({ * type: entry.value.type, * namespace: entry.value.namespace, * tags: entry.value.tags, * })), * type: "CloudWatchPath", * limitToRegions: ["us-west-2"], * limitToNamespaces: [ * "AWS/Route53", * "AWS/S3", * "customNamespace", * ], * }, * }); * ``` * * ## Import * * Polling sources can be imported using the collector and source IDs (`collector/source`), e.g.: * * hcl * * ```sh * $ pulumi import sumologic:index/pollingSource:PollingSource 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/pollingSource:PollingSource test my-test-collector/my-test-source * ``` * * [1]: https://help.sumologic.com/Send_Data/Sources/03Use_JSON_to_Configure_Sources/JSON_Parameters_for_Hosted_Sources */ class PollingSource extends pulumi.CustomResource { /** * Get an existing PollingSource 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 PollingSource(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of PollingSource. 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'] === PollingSource.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["authentication"] = state ? state.authentication : undefined; 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["multilineProcessingEnabled"] = state ? state.multilineProcessingEnabled : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["path"] = state ? state.path : undefined; resourceInputs["paused"] = state ? state.paused : undefined; resourceInputs["scanInterval"] = state ? state.scanInterval : 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.authentication === undefined) && !opts.urn) { throw new Error("Missing required property 'authentication'"); } if ((!args || args.collectorId === undefined) && !opts.urn) { throw new Error("Missing required property 'collectorId'"); } if ((!args || args.contentType === undefined) && !opts.urn) { throw new Error("Missing required property 'contentType'"); } if ((!args || args.path === undefined) && !opts.urn) { throw new Error("Missing required property 'path'"); } if ((!args || args.paused === undefined) && !opts.urn) { throw new Error("Missing required property 'paused'"); } if ((!args || args.scanInterval === undefined) && !opts.urn) { throw new Error("Missing required property 'scanInterval'"); } resourceInputs["authentication"] = args ? args.authentication : undefined; 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["multilineProcessingEnabled"] = args ? args.multilineProcessingEnabled : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["path"] = args ? args.path : undefined; resourceInputs["paused"] = args ? args.paused : undefined; resourceInputs["scanInterval"] = args ? args.scanInterval : undefined; resourceInputs["timezone"] = args ? args.timezone : undefined; resourceInputs["useAutolineMatching"] = args ? args.useAutolineMatching : undefined; resourceInputs["url"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(PollingSource.__pulumiType, name, resourceInputs, opts); } } exports.PollingSource = PollingSource; /** @internal */ PollingSource.__pulumiType = 'sumologic:index/pollingSource:PollingSource'; //# sourceMappingURL=pollingSource.js.map