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

com.pulumi.awsnative.securityhub.kotlin.AutomationRule.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.kotlin.enums.AutomationRuleRuleStatus
import com.pulumi.awsnative.securityhub.kotlin.outputs.AutomationRulesAction
import com.pulumi.awsnative.securityhub.kotlin.outputs.AutomationRulesFindingFilters
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 kotlin.collections.Map
import com.pulumi.awsnative.securityhub.kotlin.enums.AutomationRuleRuleStatus.Companion.toKotlin as automationRuleRuleStatusToKotlin
import com.pulumi.awsnative.securityhub.kotlin.outputs.AutomationRulesAction.Companion.toKotlin as automationRulesActionToKotlin
import com.pulumi.awsnative.securityhub.kotlin.outputs.AutomationRulesFindingFilters.Companion.toKotlin as automationRulesFindingFiltersToKotlin

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

    public var args: AutomationRuleArgs = AutomationRuleArgs()

    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 AutomationRuleArgsBuilder.() -> Unit) {
        val builder = AutomationRuleArgsBuilder()
        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(): AutomationRule {
        val builtJavaResource = com.pulumi.awsnative.securityhub.AutomationRule(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return AutomationRule(builtJavaResource)
    }
}

/**
 * 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.
 */
public class AutomationRule internal constructor(
    override val javaResource: com.pulumi.awsnative.securityhub.AutomationRule,
) : KotlinCustomResource(javaResource, AutomationRuleMapper) {
    /**
     * One or more actions to update finding fields if a finding matches the conditions specified in `Criteria` .
     */
    public val actions: Output>?
        get() = javaResource.actions().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> automationRulesActionToKotlin(args0) })
                })
            }).orElse(null)
        })

    /**
     * A timestamp that indicates when the rule was created.
     * Uses the `date-time` format specified in [RFC 3339 section 5.6, Internet Date/Time Format](https://docs.aws.amazon.com/https://tools.ietf.org/html/rfc3339#section-5.6) . The value cannot contain spaces. For example, `2020-03-22T13:22:13.933Z` .
     */
    public val createdAt: Output
        get() = javaResource.createdAt().applyValue({ args0 -> args0 })

    /**
     * The principal that created the rule. For example, `arn:aws:sts::123456789012:assumed-role/Developer-Role/JaneDoe` .
     */
    public val createdBy: Output
        get() = javaResource.createdBy().applyValue({ args0 -> args0 })

    /**
     * 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.
     */
    public val criteria: Output?
        get() = javaResource.criteria().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    automationRulesFindingFiltersToKotlin(args0)
                })
            }).orElse(null)
        })

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

    /**
     * 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.
     */
    public val isTerminal: Output?
        get() = javaResource.isTerminal().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The Amazon Resource Name (ARN) of the automation rule that you create. For example, `arn:aws:securityhub:us-east-1:123456789012:automation-rule/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111` .
     */
    public val ruleArn: Output
        get() = javaResource.ruleArn().applyValue({ args0 -> args0 })

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

    /**
     * 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.
     */
    public val ruleOrder: Output?
        get() = javaResource.ruleOrder().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * 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.
     */
    public val ruleStatus: Output?
        get() = javaResource.ruleStatus().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    automationRuleRuleStatusToKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * User-defined tags associated with an automation rule.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })

    /**
     * A timestamp that indicates when the rule was most recently updated.
     * Uses the `date-time` format specified in [RFC 3339 section 5.6, Internet Date/Time Format](https://docs.aws.amazon.com/https://tools.ietf.org/html/rfc3339#section-5.6) . The value cannot contain spaces. For example, `2020-03-22T13:22:13.933Z` .
     */
    public val updatedAt: Output
        get() = javaResource.updatedAt().applyValue({ args0 -> args0 })
}

public object AutomationRuleMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.securityhub.AutomationRule::class == javaResource::class

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy