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

com.pulumi.aws.cfg.kotlin.inputs.RuleSourceArgs.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: 6.57.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.aws.cfg.kotlin.inputs

import com.pulumi.aws.cfg.inputs.RuleSourceArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiNullFieldException
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 *
 * @property customPolicyDetails Provides the runtime system, policy definition, and whether debug logging is enabled. Required when owner is set to `CUSTOM_POLICY`. See Custom Policy Details Below.
 * @property owner Indicates whether AWS or the customer owns and manages the AWS Config rule. Valid values are `AWS`, `CUSTOM_LAMBDA` or `CUSTOM_POLICY`. For more information about managed rules, see the [AWS Config Managed Rules documentation](https://docs.aws.amazon.com/config/latest/developerguide/evaluate-config_use-managed-rules.html). For more information about custom rules, see the [AWS Config Custom Rules documentation](https://docs.aws.amazon.com/config/latest/developerguide/evaluate-config_develop-rules.html). Custom Lambda Functions require permissions to allow the AWS Config service to invoke them, e.g., via the `aws.lambda.Permission` resource.
 * @property sourceDetails Provides the source and type of the event that causes AWS Config to evaluate your AWS resources. Only valid if `owner` is `CUSTOM_LAMBDA` or `CUSTOM_POLICY`. See Source Detail Below.
 * @property sourceIdentifier For AWS Config managed rules, a predefined identifier, e.g `IAM_PASSWORD_POLICY`. For custom Lambda rules, the identifier is the ARN of the Lambda Function, such as `arn:aws:lambda:us-east-1:123456789012:function:custom_rule_name` or the `arn` attribute of the `aws.lambda.Function` resource.
 */
public data class RuleSourceArgs(
    public val customPolicyDetails: Output? = null,
    public val owner: Output,
    public val sourceDetails: Output>? = null,
    public val sourceIdentifier: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.aws.cfg.inputs.RuleSourceArgs =
        com.pulumi.aws.cfg.inputs.RuleSourceArgs.builder()
            .customPolicyDetails(
                customPolicyDetails?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .owner(owner.applyValue({ args0 -> args0 }))
            .sourceDetails(
                sourceDetails?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .sourceIdentifier(sourceIdentifier?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [RuleSourceArgs].
 */
@PulumiTagMarker
public class RuleSourceArgsBuilder internal constructor() {
    private var customPolicyDetails: Output? = null

    private var owner: Output? = null

    private var sourceDetails: Output>? = null

    private var sourceIdentifier: Output? = null

    /**
     * @param value Provides the runtime system, policy definition, and whether debug logging is enabled. Required when owner is set to `CUSTOM_POLICY`. See Custom Policy Details Below.
     */
    @JvmName("dvcsqbkegyyicisn")
    public suspend fun customPolicyDetails(`value`: Output) {
        this.customPolicyDetails = value
    }

    /**
     * @param value Indicates whether AWS or the customer owns and manages the AWS Config rule. Valid values are `AWS`, `CUSTOM_LAMBDA` or `CUSTOM_POLICY`. For more information about managed rules, see the [AWS Config Managed Rules documentation](https://docs.aws.amazon.com/config/latest/developerguide/evaluate-config_use-managed-rules.html). For more information about custom rules, see the [AWS Config Custom Rules documentation](https://docs.aws.amazon.com/config/latest/developerguide/evaluate-config_develop-rules.html). Custom Lambda Functions require permissions to allow the AWS Config service to invoke them, e.g., via the `aws.lambda.Permission` resource.
     */
    @JvmName("aclifspivvjqcppk")
    public suspend fun owner(`value`: Output) {
        this.owner = value
    }

    /**
     * @param value Provides the source and type of the event that causes AWS Config to evaluate your AWS resources. Only valid if `owner` is `CUSTOM_LAMBDA` or `CUSTOM_POLICY`. See Source Detail Below.
     */
    @JvmName("dwxkqjaxgbijmyki")
    public suspend fun sourceDetails(`value`: Output>) {
        this.sourceDetails = value
    }

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

    /**
     * @param values Provides the source and type of the event that causes AWS Config to evaluate your AWS resources. Only valid if `owner` is `CUSTOM_LAMBDA` or `CUSTOM_POLICY`. See Source Detail Below.
     */
    @JvmName("rhirdsydgqdqiqbm")
    public suspend fun sourceDetails(values: List>) {
        this.sourceDetails = Output.all(values)
    }

    /**
     * @param value For AWS Config managed rules, a predefined identifier, e.g `IAM_PASSWORD_POLICY`. For custom Lambda rules, the identifier is the ARN of the Lambda Function, such as `arn:aws:lambda:us-east-1:123456789012:function:custom_rule_name` or the `arn` attribute of the `aws.lambda.Function` resource.
     */
    @JvmName("ueaailvansbdliqy")
    public suspend fun sourceIdentifier(`value`: Output) {
        this.sourceIdentifier = value
    }

    /**
     * @param value Provides the runtime system, policy definition, and whether debug logging is enabled. Required when owner is set to `CUSTOM_POLICY`. See Custom Policy Details Below.
     */
    @JvmName("xebnkigqkvwvaewe")
    public suspend fun customPolicyDetails(`value`: RuleSourceCustomPolicyDetailsArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.customPolicyDetails = mapped
    }

    /**
     * @param argument Provides the runtime system, policy definition, and whether debug logging is enabled. Required when owner is set to `CUSTOM_POLICY`. See Custom Policy Details Below.
     */
    @JvmName("syxsqsryqbycivsq")
    public suspend fun customPolicyDetails(argument: suspend RuleSourceCustomPolicyDetailsArgsBuilder.() -> Unit) {
        val toBeMapped = RuleSourceCustomPolicyDetailsArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.customPolicyDetails = mapped
    }

    /**
     * @param value Indicates whether AWS or the customer owns and manages the AWS Config rule. Valid values are `AWS`, `CUSTOM_LAMBDA` or `CUSTOM_POLICY`. For more information about managed rules, see the [AWS Config Managed Rules documentation](https://docs.aws.amazon.com/config/latest/developerguide/evaluate-config_use-managed-rules.html). For more information about custom rules, see the [AWS Config Custom Rules documentation](https://docs.aws.amazon.com/config/latest/developerguide/evaluate-config_develop-rules.html). Custom Lambda Functions require permissions to allow the AWS Config service to invoke them, e.g., via the `aws.lambda.Permission` resource.
     */
    @JvmName("wjarveuvwvhviesh")
    public suspend fun owner(`value`: String) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.owner = mapped
    }

    /**
     * @param value Provides the source and type of the event that causes AWS Config to evaluate your AWS resources. Only valid if `owner` is `CUSTOM_LAMBDA` or `CUSTOM_POLICY`. See Source Detail Below.
     */
    @JvmName("woolnfcfyuyjwavt")
    public suspend fun sourceDetails(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sourceDetails = mapped
    }

    /**
     * @param argument Provides the source and type of the event that causes AWS Config to evaluate your AWS resources. Only valid if `owner` is `CUSTOM_LAMBDA` or `CUSTOM_POLICY`. See Source Detail Below.
     */
    @JvmName("gaxqloixfvnwotqh")
    public suspend fun sourceDetails(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            RuleSourceSourceDetailArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.sourceDetails = mapped
    }

    /**
     * @param argument Provides the source and type of the event that causes AWS Config to evaluate your AWS resources. Only valid if `owner` is `CUSTOM_LAMBDA` or `CUSTOM_POLICY`. See Source Detail Below.
     */
    @JvmName("bwwvbpvryjpumgux")
    public suspend fun sourceDetails(vararg argument: suspend RuleSourceSourceDetailArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            RuleSourceSourceDetailArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.sourceDetails = mapped
    }

    /**
     * @param argument Provides the source and type of the event that causes AWS Config to evaluate your AWS resources. Only valid if `owner` is `CUSTOM_LAMBDA` or `CUSTOM_POLICY`. See Source Detail Below.
     */
    @JvmName("hymccphtevuglhuv")
    public suspend fun sourceDetails(argument: suspend RuleSourceSourceDetailArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(RuleSourceSourceDetailArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.sourceDetails = mapped
    }

    /**
     * @param values Provides the source and type of the event that causes AWS Config to evaluate your AWS resources. Only valid if `owner` is `CUSTOM_LAMBDA` or `CUSTOM_POLICY`. See Source Detail Below.
     */
    @JvmName("rpjvixvynsvctqbc")
    public suspend fun sourceDetails(vararg values: RuleSourceSourceDetailArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.sourceDetails = mapped
    }

    /**
     * @param value For AWS Config managed rules, a predefined identifier, e.g `IAM_PASSWORD_POLICY`. For custom Lambda rules, the identifier is the ARN of the Lambda Function, such as `arn:aws:lambda:us-east-1:123456789012:function:custom_rule_name` or the `arn` attribute of the `aws.lambda.Function` resource.
     */
    @JvmName("wlardqpxxvwnuudw")
    public suspend fun sourceIdentifier(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sourceIdentifier = mapped
    }

    internal fun build(): RuleSourceArgs = RuleSourceArgs(
        customPolicyDetails = customPolicyDetails,
        owner = owner ?: throw PulumiNullFieldException("owner"),
        sourceDetails = sourceDetails,
        sourceIdentifier = sourceIdentifier,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy