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

com.pulumi.gcp.orgpolicy.kotlin.inputs.PolicySpecRuleArgs.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: 8.12.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.orgpolicy.kotlin.inputs

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.orgpolicy.inputs.PolicySpecRuleArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.jvm.JvmName

/**
 *
 * @property allowAll Setting this to `"TRUE"` means that all values are allowed. This field can be set only in Policies for list constraints.
 * @property condition A condition which determines whether this rule is used in the evaluation of the policy. When set, the `expression` field in the `Expr' must include from 1 to 10 subexpressions, joined by the "||" or "&&" operators. Each subexpression must be of the form "resource.matchTag('/tag_key_short_name, 'tag_value_short_name')". or "resource.matchTagId('tagKeys/key_id', 'tagValues/value_id')". where key_name and value_name are the resource names for Label Keys and Values. These names are available from the Tag Manager Service. An example expression is: "resource.matchTag('123456789/environment, 'prod')". or "resource.matchTagId('tagKeys/123', 'tagValues/456')".
 * @property denyAll Setting this to `"TRUE"` means that all values are denied. This field can be set only in Policies for list constraints.
 * @property enforce If `"TRUE"`, then the `Policy` is enforced. If `"FALSE"`, then any configuration is acceptable. This field can be set only in Policies for boolean constraints.
 * @property values List of values to be used for this PolicyRule. This field can be set only in Policies for list constraints.
 */
public data class PolicySpecRuleArgs(
    public val allowAll: Output? = null,
    public val condition: Output? = null,
    public val denyAll: Output? = null,
    public val enforce: Output? = null,
    public val values: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.orgpolicy.inputs.PolicySpecRuleArgs =
        com.pulumi.gcp.orgpolicy.inputs.PolicySpecRuleArgs.builder()
            .allowAll(allowAll?.applyValue({ args0 -> args0 }))
            .condition(condition?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .denyAll(denyAll?.applyValue({ args0 -> args0 }))
            .enforce(enforce?.applyValue({ args0 -> args0 }))
            .values(values?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) })).build()
}

/**
 * Builder for [PolicySpecRuleArgs].
 */
@PulumiTagMarker
public class PolicySpecRuleArgsBuilder internal constructor() {
    private var allowAll: Output? = null

    private var condition: Output? = null

    private var denyAll: Output? = null

    private var enforce: Output? = null

    private var values: Output? = null

    /**
     * @param value Setting this to `"TRUE"` means that all values are allowed. This field can be set only in Policies for list constraints.
     */
    @JvmName("wlkynclowynbgrsc")
    public suspend fun allowAll(`value`: Output) {
        this.allowAll = value
    }

    /**
     * @param value A condition which determines whether this rule is used in the evaluation of the policy. When set, the `expression` field in the `Expr' must include from 1 to 10 subexpressions, joined by the "||" or "&&" operators. Each subexpression must be of the form "resource.matchTag('/tag_key_short_name, 'tag_value_short_name')". or "resource.matchTagId('tagKeys/key_id', 'tagValues/value_id')". where key_name and value_name are the resource names for Label Keys and Values. These names are available from the Tag Manager Service. An example expression is: "resource.matchTag('123456789/environment, 'prod')". or "resource.matchTagId('tagKeys/123', 'tagValues/456')".
     */
    @JvmName("ocdxphqhibrtsdnc")
    public suspend fun condition(`value`: Output) {
        this.condition = value
    }

    /**
     * @param value Setting this to `"TRUE"` means that all values are denied. This field can be set only in Policies for list constraints.
     */
    @JvmName("sjeyirdnuigkjril")
    public suspend fun denyAll(`value`: Output) {
        this.denyAll = value
    }

    /**
     * @param value If `"TRUE"`, then the `Policy` is enforced. If `"FALSE"`, then any configuration is acceptable. This field can be set only in Policies for boolean constraints.
     */
    @JvmName("oguursfnqcwfxquk")
    public suspend fun enforce(`value`: Output) {
        this.enforce = value
    }

    /**
     * @param value List of values to be used for this PolicyRule. This field can be set only in Policies for list constraints.
     */
    @JvmName("myacoiyqvnkdtnlx")
    public suspend fun values(`value`: Output) {
        this.values = value
    }

    /**
     * @param value Setting this to `"TRUE"` means that all values are allowed. This field can be set only in Policies for list constraints.
     */
    @JvmName("bqnhhqagbevfrmrr")
    public suspend fun allowAll(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.allowAll = mapped
    }

    /**
     * @param value A condition which determines whether this rule is used in the evaluation of the policy. When set, the `expression` field in the `Expr' must include from 1 to 10 subexpressions, joined by the "||" or "&&" operators. Each subexpression must be of the form "resource.matchTag('/tag_key_short_name, 'tag_value_short_name')". or "resource.matchTagId('tagKeys/key_id', 'tagValues/value_id')". where key_name and value_name are the resource names for Label Keys and Values. These names are available from the Tag Manager Service. An example expression is: "resource.matchTag('123456789/environment, 'prod')". or "resource.matchTagId('tagKeys/123', 'tagValues/456')".
     */
    @JvmName("mxkiwpmpwdqhnkeh")
    public suspend fun condition(`value`: PolicySpecRuleConditionArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.condition = mapped
    }

    /**
     * @param argument A condition which determines whether this rule is used in the evaluation of the policy. When set, the `expression` field in the `Expr' must include from 1 to 10 subexpressions, joined by the "||" or "&&" operators. Each subexpression must be of the form "resource.matchTag('/tag_key_short_name, 'tag_value_short_name')". or "resource.matchTagId('tagKeys/key_id', 'tagValues/value_id')". where key_name and value_name are the resource names for Label Keys and Values. These names are available from the Tag Manager Service. An example expression is: "resource.matchTag('123456789/environment, 'prod')". or "resource.matchTagId('tagKeys/123', 'tagValues/456')".
     */
    @JvmName("yjbcwxyegpnvsqsl")
    public suspend fun condition(argument: suspend PolicySpecRuleConditionArgsBuilder.() -> Unit) {
        val toBeMapped = PolicySpecRuleConditionArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.condition = mapped
    }

    /**
     * @param value Setting this to `"TRUE"` means that all values are denied. This field can be set only in Policies for list constraints.
     */
    @JvmName("lvvvbuasgnnsfqcm")
    public suspend fun denyAll(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.denyAll = mapped
    }

    /**
     * @param value If `"TRUE"`, then the `Policy` is enforced. If `"FALSE"`, then any configuration is acceptable. This field can be set only in Policies for boolean constraints.
     */
    @JvmName("eqyuivusjlfmnqal")
    public suspend fun enforce(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.enforce = mapped
    }

    /**
     * @param value List of values to be used for this PolicyRule. This field can be set only in Policies for list constraints.
     */
    @JvmName("fdvhmcqddlrttiet")
    public suspend fun values(`value`: PolicySpecRuleValuesArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.values = mapped
    }

    /**
     * @param argument List of values to be used for this PolicyRule. This field can be set only in Policies for list constraints.
     */
    @JvmName("lliibkyigvgeiiyb")
    public suspend fun values(argument: suspend PolicySpecRuleValuesArgsBuilder.() -> Unit) {
        val toBeMapped = PolicySpecRuleValuesArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.values = mapped
    }

    internal fun build(): PolicySpecRuleArgs = PolicySpecRuleArgs(
        allowAll = allowAll,
        condition = condition,
        denyAll = denyAll,
        enforce = enforce,
        values = values,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy