Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.aws.cloudwatch.kotlin
import com.pulumi.aws.cloudwatch.CompositeAlarmArgs.builder
import com.pulumi.aws.cloudwatch.kotlin.inputs.CompositeAlarmActionsSuppressorArgs
import com.pulumi.aws.cloudwatch.kotlin.inputs.CompositeAlarmActionsSuppressorArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName
/**
* Provides a CloudWatch Composite Alarm resource.
* > **NOTE:** An alarm (composite or metric) cannot be destroyed when there are other composite alarms depending on it. This can lead to a cyclical dependency on update, as the provider will unsuccessfully attempt to destroy alarms before updating the rule. Consider using `depends_on`, references to alarm names, and two-stage updates.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
* const example = new aws.cloudwatch.CompositeAlarm("example", {
* alarmDescription: "This is a composite alarm!",
* alarmName: "example-composite-alarm",
* alarmActions: exampleAwsSnsTopic.arn,
* okActions: exampleAwsSnsTopic.arn,
* alarmRule: `ALARM(${alpha.alarmName}) OR
* ALARM(${bravo.alarmName})
* `,
* actionsSuppressor: {
* alarm: "suppressor-alarm",
* extensionPeriod: 10,
* waitPeriod: 20,
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_aws as aws
* example = aws.cloudwatch.CompositeAlarm("example",
* alarm_description="This is a composite alarm!",
* alarm_name="example-composite-alarm",
* alarm_actions=example_aws_sns_topic["arn"],
* ok_actions=example_aws_sns_topic["arn"],
* alarm_rule=f"""ALARM({alpha["alarmName"]}) OR
* ALARM({bravo["alarmName"]})
* """,
* actions_suppressor={
* "alarm": "suppressor-alarm",
* "extension_period": 10,
* "wait_period": 20,
* })
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Aws = Pulumi.Aws;
* return await Deployment.RunAsync(() =>
* {
* var example = new Aws.CloudWatch.CompositeAlarm("example", new()
* {
* AlarmDescription = "This is a composite alarm!",
* AlarmName = "example-composite-alarm",
* AlarmActions = exampleAwsSnsTopic.Arn,
* OkActions = exampleAwsSnsTopic.Arn,
* AlarmRule = @$"ALARM({alpha.AlarmName}) OR
* ALARM({bravo.AlarmName})
* ",
* ActionsSuppressor = new Aws.CloudWatch.Inputs.CompositeAlarmActionsSuppressorArgs
* {
* Alarm = "suppressor-alarm",
* ExtensionPeriod = 10,
* WaitPeriod = 20,
* },
* });
* });
* ```
* ```go
* package main
* import (
* "fmt"
* "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cloudwatch"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := cloudwatch.NewCompositeAlarm(ctx, "example", &cloudwatch.CompositeAlarmArgs{
* AlarmDescription: pulumi.String("This is a composite alarm!"),
* AlarmName: pulumi.String("example-composite-alarm"),
* AlarmActions: pulumi.Any(exampleAwsSnsTopic.Arn),
* OkActions: pulumi.Any(exampleAwsSnsTopic.Arn),
* AlarmRule: pulumi.Sprintf("ALARM(%v) OR\nALARM(%v)\n", alpha.AlarmName, bravo.AlarmName),
* ActionsSuppressor: &cloudwatch.CompositeAlarmActionsSuppressorArgs{
* Alarm: pulumi.String("suppressor-alarm"),
* ExtensionPeriod: pulumi.Int(10),
* WaitPeriod: pulumi.Int(20),
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.aws.cloudwatch.CompositeAlarm;
* import com.pulumi.aws.cloudwatch.CompositeAlarmArgs;
* import com.pulumi.aws.cloudwatch.inputs.CompositeAlarmActionsSuppressorArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* var example = new CompositeAlarm("example", CompositeAlarmArgs.builder()
* .alarmDescription("This is a composite alarm!")
* .alarmName("example-composite-alarm")
* .alarmActions(exampleAwsSnsTopic.arn())
* .okActions(exampleAwsSnsTopic.arn())
* .alarmRule("""
* ALARM(%s) OR
* ALARM(%s)
* ", alpha.alarmName(),bravo.alarmName()))
* .actionsSuppressor(CompositeAlarmActionsSuppressorArgs.builder()
* .alarm("suppressor-alarm")
* .extensionPeriod(10)
* .waitPeriod(20)
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: aws:cloudwatch:CompositeAlarm
* properties:
* alarmDescription: This is a composite alarm!
* alarmName: example-composite-alarm
* alarmActions: ${exampleAwsSnsTopic.arn}
* okActions: ${exampleAwsSnsTopic.arn}
* alarmRule: |
* ALARM(${alpha.alarmName}) OR
* ALARM(${bravo.alarmName})
* actionsSuppressor:
* alarm: suppressor-alarm
* extensionPeriod: 10
* waitPeriod: 20
* ```
*
* ## Import
* Using `pulumi import`, import a CloudWatch Composite Alarm using the `alarm_name`. For example:
* ```sh
* $ pulumi import aws:cloudwatch/compositeAlarm:CompositeAlarm test my-alarm
* ```
* @property actionsEnabled Indicates whether actions should be executed during any changes to the alarm state of the composite alarm. Defaults to `true`.
* @property actionsSuppressor Actions will be suppressed if the suppressor alarm is in the ALARM state.
* @property alarmActions The set of actions to execute when this alarm transitions to the `ALARM` state from any other state. Each action is specified as an ARN. Up to 5 actions are allowed.
* @property alarmDescription The description for the composite alarm.
* @property alarmName The name for the composite alarm. This name must be unique within the region.
* @property alarmRule An expression that specifies which other alarms are to be evaluated to determine this composite alarm's state. For syntax, see [Creating a Composite Alarm](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Create_Composite_Alarm.html). The maximum length is 10240 characters.
* @property insufficientDataActions The set of actions to execute when this alarm transitions to the `INSUFFICIENT_DATA` state from any other state. Each action is specified as an ARN. Up to 5 actions are allowed.
* @property okActions The set of actions to execute when this alarm transitions to an `OK` state from any other state. Each action is specified as an ARN. Up to 5 actions are allowed.
* @property tags A map of tags to associate with the alarm. Up to 50 tags are allowed. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
*/
public data class CompositeAlarmArgs(
public val actionsEnabled: Output? = null,
public val actionsSuppressor: Output? = null,
public val alarmActions: Output>? = null,
public val alarmDescription: Output? = null,
public val alarmName: Output? = null,
public val alarmRule: Output? = null,
public val insufficientDataActions: Output>? = null,
public val okActions: Output>? = null,
public val tags: Output