@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
107 lines • 4.65 kB
JavaScript
// *** 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, { ...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?.anomalyVisibilityTime;
resourceInputs["arn"] = state?.arn;
resourceInputs["detectorName"] = state?.detectorName;
resourceInputs["enabled"] = state?.enabled;
resourceInputs["evaluationFrequency"] = state?.evaluationFrequency;
resourceInputs["filterPattern"] = state?.filterPattern;
resourceInputs["kmsKeyId"] = state?.kmsKeyId;
resourceInputs["logGroupArnLists"] = state?.logGroupArnLists;
resourceInputs["region"] = state?.region;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
}
else {
const args = argsOrState;
if (args?.enabled === undefined && !opts.urn) {
throw new Error("Missing required property 'enabled'");
}
if (args?.logGroupArnLists === undefined && !opts.urn) {
throw new Error("Missing required property 'logGroupArnLists'");
}
resourceInputs["anomalyVisibilityTime"] = args?.anomalyVisibilityTime;
resourceInputs["detectorName"] = args?.detectorName;
resourceInputs["enabled"] = args?.enabled;
resourceInputs["evaluationFrequency"] = args?.evaluationFrequency;
resourceInputs["filterPattern"] = args?.filterPattern;
resourceInputs["kmsKeyId"] = args?.kmsKeyId;
resourceInputs["logGroupArnLists"] = args?.logGroupArnLists;
resourceInputs["region"] = args?.region;
resourceInputs["tags"] = args?.tags;
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
;