UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

107 lines 5.07 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.LogAnomalyDetector = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Resource for managing an AWS CloudWatch Logs Log Anomaly Detector. * * ## Example Usage * * ### Basic Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const test: aws.cloudwatch.LogGroup[] = []; * for (const range = {value: 0}; range.value < 2; range.value++) { * test.push(new aws.cloudwatch.LogGroup(`test-${range.value}`, {name: `testing-${range.value}`})); * } * const testLogAnomalyDetector = new aws.cloudwatch.LogAnomalyDetector("test", { * detectorName: "testing", * logGroupArnLists: [test[0].arn], * anomalyVisibilityTime: 7, * evaluationFrequency: "TEN_MIN", * enabled: false, * }); * ``` * * ## Import * * Using `pulumi import`, import CloudWatch Log Anomaly Detector using the `arn`. For example: * * ```sh * $ pulumi import aws:cloudwatch/logAnomalyDetector:LogAnomalyDetector example log_anomaly_detector-arn-12345678 * ``` */ class LogAnomalyDetector extends pulumi.CustomResource { /** * Get an existing LogAnomalyDetector 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 LogAnomalyDetector(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of LogAnomalyDetector. 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'] === LogAnomalyDetector.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["anomalyVisibilityTime"] = state ? state.anomalyVisibilityTime : undefined; resourceInputs["arn"] = state ? state.arn : undefined; resourceInputs["detectorName"] = state ? state.detectorName : undefined; resourceInputs["enabled"] = state ? state.enabled : undefined; resourceInputs["evaluationFrequency"] = state ? state.evaluationFrequency : undefined; resourceInputs["filterPattern"] = state ? state.filterPattern : undefined; resourceInputs["kmsKeyId"] = state ? state.kmsKeyId : undefined; resourceInputs["logGroupArnLists"] = state ? state.logGroupArnLists : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["tagsAll"] = state ? state.tagsAll : undefined; } else { const args = argsOrState; if ((!args || args.enabled === undefined) && !opts.urn) { throw new Error("Missing required property 'enabled'"); } if ((!args || args.logGroupArnLists === undefined) && !opts.urn) { throw new Error("Missing required property 'logGroupArnLists'"); } resourceInputs["anomalyVisibilityTime"] = args ? args.anomalyVisibilityTime : undefined; resourceInputs["detectorName"] = args ? args.detectorName : undefined; resourceInputs["enabled"] = args ? args.enabled : undefined; resourceInputs["evaluationFrequency"] = args ? args.evaluationFrequency : undefined; resourceInputs["filterPattern"] = args ? args.filterPattern : undefined; resourceInputs["kmsKeyId"] = args ? args.kmsKeyId : undefined; resourceInputs["logGroupArnLists"] = args ? args.logGroupArnLists : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["arn"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(LogAnomalyDetector.__pulumiType, name, resourceInputs, opts); } } exports.LogAnomalyDetector = LogAnomalyDetector; /** @internal */ LogAnomalyDetector.__pulumiType = 'aws:cloudwatch/logAnomalyDetector:LogAnomalyDetector'; //# sourceMappingURL=logAnomalyDetector.js.map