All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.awsnative.iotevents.kotlin.AlarmModel.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 1.24.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.awsnative.iotevents.kotlin

import com.pulumi.awsnative.iotevents.kotlin.outputs.AlarmModelAlarmCapabilities
import com.pulumi.awsnative.iotevents.kotlin.outputs.AlarmModelAlarmEventActions
import com.pulumi.awsnative.iotevents.kotlin.outputs.AlarmModelAlarmRule
import com.pulumi.awsnative.kotlin.outputs.Tag
import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import com.pulumi.awsnative.iotevents.kotlin.outputs.AlarmModelAlarmCapabilities.Companion.toKotlin as alarmModelAlarmCapabilitiesToKotlin
import com.pulumi.awsnative.iotevents.kotlin.outputs.AlarmModelAlarmEventActions.Companion.toKotlin as alarmModelAlarmEventActionsToKotlin
import com.pulumi.awsnative.iotevents.kotlin.outputs.AlarmModelAlarmRule.Companion.toKotlin as alarmModelAlarmRuleToKotlin
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin

/**
 * Builder for [AlarmModel].
 */
@PulumiTagMarker
public class AlarmModelResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: AlarmModelArgs = AlarmModelArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend AlarmModelArgsBuilder.() -> Unit) {
        val builder = AlarmModelArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): AlarmModel {
        val builtJavaResource = com.pulumi.awsnative.iotevents.AlarmModel(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return AlarmModel(builtJavaResource)
    }
}

/**
 * The AWS::IoTEvents::AlarmModel resource creates a alarm model. AWS IoT Events alarms help you monitor your data for changes. The data can be metrics that you measure for your equipment and processes. You can create alarms that send notifications when a threshold is breached. Alarms help you detect issues, streamline maintenance, and optimize performance of your equipment and processes.
 * Alarms are instances of alarm models. The alarm model specifies what to detect, when to send notifications, who gets notified, and more. You can also specify one or more supported actions that occur when the alarm state changes. AWS IoT Events routes input attributes derived from your data to the appropriate alarms. If the data that you're monitoring is outside the specified range, the alarm is invoked. You can also acknowledge the alarms or set them to the snooze mode.
 */
public class AlarmModel internal constructor(
    override val javaResource: com.pulumi.awsnative.iotevents.AlarmModel,
) : KotlinCustomResource(javaResource, AlarmModelMapper) {
    /**
     * Contains the configuration information of alarm state changes.
     */
    public val alarmCapabilities: Output?
        get() = javaResource.alarmCapabilities().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> alarmModelAlarmCapabilitiesToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * Contains information about one or more alarm actions.
     */
    public val alarmEventActions: Output?
        get() = javaResource.alarmEventActions().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> alarmModelAlarmEventActionsToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * A brief description of the alarm model.
     */
    public val alarmModelDescription: Output?
        get() = javaResource.alarmModelDescription().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The name of the alarm model.
     */
    public val alarmModelName: Output?
        get() = javaResource.alarmModelName().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Defines when your alarm is invoked.
     */
    public val alarmRule: Output
        get() = javaResource.alarmRule().applyValue({ args0 ->
            args0.let({ args0 ->
                alarmModelAlarmRuleToKotlin(args0)
            })
        })

    /**
     * The value used to identify a alarm instance. When a device or system sends input, a new alarm instance with a unique key value is created. AWS IoT Events can continue to route input to its corresponding alarm instance based on this identifying information.
     * This parameter uses a JSON-path expression to select the attribute-value pair in the message payload that is used for identification. To route the message to the correct alarm instance, the device must send a message payload that contains the same attribute-value.
     */
    public val key: Output?
        get() = javaResource.key().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * The ARN of the role that grants permission to AWS IoT Events to perform its operations.
     */
    public val roleArn: Output
        get() = javaResource.roleArn().applyValue({ args0 -> args0 })

    /**
     * A non-negative integer that reflects the severity level of the alarm.
     */
    public val severity: Output?
        get() = javaResource.severity().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * An array of key-value pairs to apply to this resource.
     * For more information, see [Tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html).
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> tagToKotlin(args0) })
                })
            }).orElse(null)
        })
}

public object AlarmModelMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.iotevents.AlarmModel::class == javaResource::class

    override fun map(javaResource: Resource): AlarmModel = AlarmModel(
        javaResource as
            com.pulumi.awsnative.iotevents.AlarmModel,
    )
}

/**
 * @see [AlarmModel].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [AlarmModel].
 */
public suspend fun alarmModel(name: String, block: suspend AlarmModelResourceBuilder.() -> Unit): AlarmModel {
    val builder = AlarmModelResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [AlarmModel].
 * @param name The _unique_ name of the resulting resource.
 */
public fun alarmModel(name: String): AlarmModel {
    val builder = AlarmModelResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy