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

com.pulumi.awsnative.securityhub.kotlin.AutomationRuleArgs.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.securityhub.kotlin

import com.pulumi.awsnative.securityhub.AutomationRuleArgs.builder
import com.pulumi.awsnative.securityhub.kotlin.enums.AutomationRuleRuleStatus
import com.pulumi.awsnative.securityhub.kotlin.inputs.AutomationRulesActionArgs
import com.pulumi.awsnative.securityhub.kotlin.inputs.AutomationRulesActionArgsBuilder
import com.pulumi.awsnative.securityhub.kotlin.inputs.AutomationRulesFindingFiltersArgs
import com.pulumi.awsnative.securityhub.kotlin.inputs.AutomationRulesFindingFiltersArgsBuilder
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.Int
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * The ``AWS::SecurityHub::AutomationRule`` resource specifies an automation rule based on input parameters. For more information, see [Automation rules](https://docs.aws.amazon.com/securityhub/latest/userguide/automation-rules.html) in the *User Guide*.
 * ## Example Usage
 * ### Example
 * No Java example available.
 * ### Example
 * No Java example available.
 * @property actions One or more actions to update finding fields if a finding matches the conditions specified in `Criteria` .
 * @property criteria A set of [Security Finding Format (ASFF)](https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-findings-format.html) finding field attributes and corresponding expected values that ASH uses to filter findings. If a rule is enabled and a finding matches the criteria specified in this parameter, ASH applies the rule action to the finding.
 * @property description A description of the rule.
 * @property isTerminal Specifies whether a rule is the last to be applied with respect to a finding that matches the rule criteria. This is useful when a finding matches the criteria for multiple rules, and each rule has different actions. If a rule is terminal, Security Hub applies the rule action to a finding that matches the rule criteria and doesn't evaluate other rules for the finding. By default, a rule isn't terminal.
 * @property ruleName The name of the rule.
 * @property ruleOrder An integer ranging from 1 to 1000 that represents the order in which the rule action is applied to findings. Security Hub applies rules with lower values for this parameter first.
 * @property ruleStatus Whether the rule is active after it is created. If this parameter is equal to ``ENABLED``, ASH applies the rule to findings and finding updates after the rule is created.
 * @property tags User-defined tags associated with an automation rule.
 */
public data class AutomationRuleArgs(
    public val actions: Output>? = null,
    public val criteria: Output? = null,
    public val description: Output? = null,
    public val isTerminal: Output? = null,
    public val ruleName: Output? = null,
    public val ruleOrder: Output? = null,
    public val ruleStatus: Output? = null,
    public val tags: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.awsnative.securityhub.AutomationRuleArgs =
        com.pulumi.awsnative.securityhub.AutomationRuleArgs.builder()
            .actions(
                actions?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .criteria(criteria?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .description(description?.applyValue({ args0 -> args0 }))
            .isTerminal(isTerminal?.applyValue({ args0 -> args0 }))
            .ruleName(ruleName?.applyValue({ args0 -> args0 }))
            .ruleOrder(ruleOrder?.applyValue({ args0 -> args0 }))
            .ruleStatus(ruleStatus?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .tags(
                tags?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            ).build()
}

/**
 * Builder for [AutomationRuleArgs].
 */
@PulumiTagMarker
public class AutomationRuleArgsBuilder internal constructor() {
    private var actions: Output>? = null

    private var criteria: Output? = null

    private var description: Output? = null

    private var isTerminal: Output? = null

    private var ruleName: Output? = null

    private var ruleOrder: Output? = null

    private var ruleStatus: Output? = null

    private var tags: Output>? = null

    /**
     * @param value One or more actions to update finding fields if a finding matches the conditions specified in `Criteria` .
     */
    @JvmName("mwfvtvlrcwjlgynk")
    public suspend fun actions(`value`: Output>) {
        this.actions = value
    }

    @JvmName("eufhomswijbfotdn")
    public suspend fun actions(vararg values: Output) {
        this.actions = Output.all(values.asList())
    }

    /**
     * @param values One or more actions to update finding fields if a finding matches the conditions specified in `Criteria` .
     */
    @JvmName("sspgttqksvouueec")
    public suspend fun actions(values: List>) {
        this.actions = Output.all(values)
    }

    /**
     * @param value A set of [Security Finding Format (ASFF)](https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-findings-format.html) finding field attributes and corresponding expected values that ASH uses to filter findings. If a rule is enabled and a finding matches the criteria specified in this parameter, ASH applies the rule action to the finding.
     */
    @JvmName("jshclwfwtcayobat")
    public suspend fun criteria(`value`: Output) {
        this.criteria = value
    }

    /**
     * @param value A description of the rule.
     */
    @JvmName("esijtnidmsgpcggj")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value Specifies whether a rule is the last to be applied with respect to a finding that matches the rule criteria. This is useful when a finding matches the criteria for multiple rules, and each rule has different actions. If a rule is terminal, Security Hub applies the rule action to a finding that matches the rule criteria and doesn't evaluate other rules for the finding. By default, a rule isn't terminal.
     */
    @JvmName("kchatgiiotmmecrt")
    public suspend fun isTerminal(`value`: Output) {
        this.isTerminal = value
    }

    /**
     * @param value The name of the rule.
     */
    @JvmName("fvfoonckkmpjscsd")
    public suspend fun ruleName(`value`: Output) {
        this.ruleName = value
    }

    /**
     * @param value An integer ranging from 1 to 1000 that represents the order in which the rule action is applied to findings. Security Hub applies rules with lower values for this parameter first.
     */
    @JvmName("drsjhyqipudqwrob")
    public suspend fun ruleOrder(`value`: Output) {
        this.ruleOrder = value
    }

    /**
     * @param value Whether the rule is active after it is created. If this parameter is equal to ``ENABLED``, ASH applies the rule to findings and finding updates after the rule is created.
     */
    @JvmName("sqshmmtatfhqvyxr")
    public suspend fun ruleStatus(`value`: Output) {
        this.ruleStatus = value
    }

    /**
     * @param value User-defined tags associated with an automation rule.
     */
    @JvmName("nsngblowpxmyhime")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value One or more actions to update finding fields if a finding matches the conditions specified in `Criteria` .
     */
    @JvmName("rkpltrvylqkyxryg")
    public suspend fun actions(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.actions = mapped
    }

    /**
     * @param argument One or more actions to update finding fields if a finding matches the conditions specified in `Criteria` .
     */
    @JvmName("jdbiwoiruffikgqf")
    public suspend fun actions(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            AutomationRulesActionArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.actions = mapped
    }

    /**
     * @param argument One or more actions to update finding fields if a finding matches the conditions specified in `Criteria` .
     */
    @JvmName("ewncuehwubtxwxpi")
    public suspend fun actions(vararg argument: suspend AutomationRulesActionArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            AutomationRulesActionArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.actions = mapped
    }

    /**
     * @param argument One or more actions to update finding fields if a finding matches the conditions specified in `Criteria` .
     */
    @JvmName("aorjtdtnbwutcblh")
    public suspend fun actions(argument: suspend AutomationRulesActionArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(AutomationRulesActionArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.actions = mapped
    }

    /**
     * @param values One or more actions to update finding fields if a finding matches the conditions specified in `Criteria` .
     */
    @JvmName("mrkqyfxdkmmsylcc")
    public suspend fun actions(vararg values: AutomationRulesActionArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.actions = mapped
    }

    /**
     * @param value A set of [Security Finding Format (ASFF)](https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-findings-format.html) finding field attributes and corresponding expected values that ASH uses to filter findings. If a rule is enabled and a finding matches the criteria specified in this parameter, ASH applies the rule action to the finding.
     */
    @JvmName("caavdlcdqpyubewe")
    public suspend fun criteria(`value`: AutomationRulesFindingFiltersArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.criteria = mapped
    }

    /**
     * @param argument A set of [Security Finding Format (ASFF)](https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-findings-format.html) finding field attributes and corresponding expected values that ASH uses to filter findings. If a rule is enabled and a finding matches the criteria specified in this parameter, ASH applies the rule action to the finding.
     */
    @JvmName("wrtypjtybqqbhlso")
    public suspend fun criteria(argument: suspend AutomationRulesFindingFiltersArgsBuilder.() -> Unit) {
        val toBeMapped = AutomationRulesFindingFiltersArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.criteria = mapped
    }

    /**
     * @param value A description of the rule.
     */
    @JvmName("outycpvnlavnfeah")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value Specifies whether a rule is the last to be applied with respect to a finding that matches the rule criteria. This is useful when a finding matches the criteria for multiple rules, and each rule has different actions. If a rule is terminal, Security Hub applies the rule action to a finding that matches the rule criteria and doesn't evaluate other rules for the finding. By default, a rule isn't terminal.
     */
    @JvmName("jograsvrrclbbbnc")
    public suspend fun isTerminal(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.isTerminal = mapped
    }

    /**
     * @param value The name of the rule.
     */
    @JvmName("ysafqdwarmynrwdw")
    public suspend fun ruleName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.ruleName = mapped
    }

    /**
     * @param value An integer ranging from 1 to 1000 that represents the order in which the rule action is applied to findings. Security Hub applies rules with lower values for this parameter first.
     */
    @JvmName("hmarvxmxqskpmhat")
    public suspend fun ruleOrder(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.ruleOrder = mapped
    }

    /**
     * @param value Whether the rule is active after it is created. If this parameter is equal to ``ENABLED``, ASH applies the rule to findings and finding updates after the rule is created.
     */
    @JvmName("ygstqaqukkkjmdwe")
    public suspend fun ruleStatus(`value`: AutomationRuleRuleStatus?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.ruleStatus = mapped
    }

    /**
     * @param value User-defined tags associated with an automation rule.
     */
    @JvmName("yughxvmqhkenlars")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values User-defined tags associated with an automation rule.
     */
    @JvmName("duhlhhfvtxodlvyd")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    internal fun build(): AutomationRuleArgs = AutomationRuleArgs(
        actions = actions,
        criteria = criteria,
        description = description,
        isTerminal = isTerminal,
        ruleName = ruleName,
        ruleOrder = ruleOrder,
        ruleStatus = ruleStatus,
        tags = tags,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy