@pulumi/aws-native
Version:
The Pulumi AWS Cloud Control Provider enables you to build, deploy, and manage [any AWS resource that's supported by the AWS Cloud Control API](https://github.com/pulumi/pulumi-aws-native/blob/master/provider/cmd/pulumi-gen-aws-native/supported-types.txt)
103 lines • 5.4 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.LogAlarm = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Resource Type definition for AWS::CloudWatch::LogAlarm. A LogAlarm evaluates scheduled query results from CloudWatch Logs and triggers actions when thresholds are breached.
*/
class LogAlarm extends pulumi.CustomResource {
/**
* Get an existing LogAlarm 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 opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, opts) {
return new LogAlarm(name, undefined, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of LogAlarm. 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'] === LogAlarm.__pulumiType;
}
/**
* Create a LogAlarm resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name, args, opts) {
let resourceInputs = {};
opts = opts || {};
if (!opts.id) {
if (args?.comparisonOperator === undefined && !opts.urn) {
throw new Error("Missing required property 'comparisonOperator'");
}
if (args?.queryResultsToAlarm === undefined && !opts.urn) {
throw new Error("Missing required property 'queryResultsToAlarm'");
}
if (args?.queryResultsToEvaluate === undefined && !opts.urn) {
throw new Error("Missing required property 'queryResultsToEvaluate'");
}
if (args?.scheduledQueryConfiguration === undefined && !opts.urn) {
throw new Error("Missing required property 'scheduledQueryConfiguration'");
}
if (args?.threshold === undefined && !opts.urn) {
throw new Error("Missing required property 'threshold'");
}
resourceInputs["actionLogLineCount"] = args?.actionLogLineCount;
resourceInputs["actionLogLineRoleArn"] = args?.actionLogLineRoleArn;
resourceInputs["actionsEnabled"] = args?.actionsEnabled;
resourceInputs["alarmActions"] = args?.alarmActions;
resourceInputs["alarmDescription"] = args?.alarmDescription;
resourceInputs["alarmName"] = args?.alarmName;
resourceInputs["comparisonOperator"] = args?.comparisonOperator;
resourceInputs["insufficientDataActions"] = args?.insufficientDataActions;
resourceInputs["okActions"] = args?.okActions;
resourceInputs["queryResultsToAlarm"] = args?.queryResultsToAlarm;
resourceInputs["queryResultsToEvaluate"] = args?.queryResultsToEvaluate;
resourceInputs["scheduledQueryConfiguration"] = args?.scheduledQueryConfiguration;
resourceInputs["tags"] = args?.tags;
resourceInputs["threshold"] = args?.threshold;
resourceInputs["treatMissingData"] = args?.treatMissingData;
resourceInputs["arn"] = undefined /*out*/;
}
else {
resourceInputs["actionLogLineCount"] = undefined /*out*/;
resourceInputs["actionLogLineRoleArn"] = undefined /*out*/;
resourceInputs["actionsEnabled"] = undefined /*out*/;
resourceInputs["alarmActions"] = undefined /*out*/;
resourceInputs["alarmDescription"] = undefined /*out*/;
resourceInputs["alarmName"] = undefined /*out*/;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["comparisonOperator"] = undefined /*out*/;
resourceInputs["insufficientDataActions"] = undefined /*out*/;
resourceInputs["okActions"] = undefined /*out*/;
resourceInputs["queryResultsToAlarm"] = undefined /*out*/;
resourceInputs["queryResultsToEvaluate"] = undefined /*out*/;
resourceInputs["scheduledQueryConfiguration"] = undefined /*out*/;
resourceInputs["tags"] = undefined /*out*/;
resourceInputs["threshold"] = undefined /*out*/;
resourceInputs["treatMissingData"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const replaceOnChanges = { replaceOnChanges: ["alarmName"] };
opts = pulumi.mergeOptions(opts, replaceOnChanges);
super(LogAlarm.__pulumiType, name, resourceInputs, opts);
}
}
exports.LogAlarm = LogAlarm;
/** @internal */
LogAlarm.__pulumiType = 'aws-native:cloudwatch:LogAlarm';
//# sourceMappingURL=logAlarm.js.map