UNPKG

@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)

110 lines 5.97 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.Alarm = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * The ``AWS::CloudWatch::Alarm`` type specifies an alarm and associates it with the specified metric or metric math expression. * When this operation creates an alarm, the alarm state is immediately set to ``INSUFFICIENT_DATA``. The alarm is then evaluated and its state is set appropriately. Any actions associated with the new state are then executed. * When you update an existing alarm, its state is left unchanged, but the update completely overwrites the previous configuration of the alarm. */ class Alarm extends pulumi.CustomResource { /** * Get an existing Alarm 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 Alarm(name, undefined, { ...opts, id: id }); } /** * Returns true if the given object is an instance of Alarm. 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'] === Alarm.__pulumiType; } /** * Create a Alarm 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?.evaluationPeriods === undefined && !opts.urn) { throw new Error("Missing required property 'evaluationPeriods'"); } resourceInputs["actionsEnabled"] = args?.actionsEnabled; resourceInputs["alarmActions"] = args?.alarmActions; resourceInputs["alarmDescription"] = args?.alarmDescription; resourceInputs["alarmName"] = args?.alarmName; resourceInputs["comparisonOperator"] = args?.comparisonOperator; resourceInputs["datapointsToAlarm"] = args?.datapointsToAlarm; resourceInputs["dimensions"] = args?.dimensions; resourceInputs["evaluateLowSampleCountPercentile"] = args?.evaluateLowSampleCountPercentile; resourceInputs["evaluationPeriods"] = args?.evaluationPeriods; resourceInputs["extendedStatistic"] = args?.extendedStatistic; resourceInputs["insufficientDataActions"] = args?.insufficientDataActions; resourceInputs["metricName"] = args?.metricName; resourceInputs["metrics"] = args?.metrics; resourceInputs["namespace"] = args?.namespace; resourceInputs["okActions"] = args?.okActions; resourceInputs["period"] = args?.period; resourceInputs["statistic"] = args?.statistic; resourceInputs["tags"] = args?.tags; resourceInputs["threshold"] = args?.threshold; resourceInputs["thresholdMetricId"] = args?.thresholdMetricId; resourceInputs["treatMissingData"] = args?.treatMissingData; resourceInputs["unit"] = args?.unit; resourceInputs["arn"] = undefined /*out*/; } else { 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["datapointsToAlarm"] = undefined /*out*/; resourceInputs["dimensions"] = undefined /*out*/; resourceInputs["evaluateLowSampleCountPercentile"] = undefined /*out*/; resourceInputs["evaluationPeriods"] = undefined /*out*/; resourceInputs["extendedStatistic"] = undefined /*out*/; resourceInputs["insufficientDataActions"] = undefined /*out*/; resourceInputs["metricName"] = undefined /*out*/; resourceInputs["metrics"] = undefined /*out*/; resourceInputs["namespace"] = undefined /*out*/; resourceInputs["okActions"] = undefined /*out*/; resourceInputs["period"] = undefined /*out*/; resourceInputs["statistic"] = undefined /*out*/; resourceInputs["tags"] = undefined /*out*/; resourceInputs["threshold"] = undefined /*out*/; resourceInputs["thresholdMetricId"] = undefined /*out*/; resourceInputs["treatMissingData"] = undefined /*out*/; resourceInputs["unit"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const replaceOnChanges = { replaceOnChanges: ["alarmName"] }; opts = pulumi.mergeOptions(opts, replaceOnChanges); super(Alarm.__pulumiType, name, resourceInputs, opts); } } exports.Alarm = Alarm; /** @internal */ Alarm.__pulumiType = 'aws-native:cloudwatch:Alarm'; //# sourceMappingURL=alarm.js.map