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

com.pulumi.awsnative.organizations.kotlin.PolicyArgs.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.awsnative.organizations.kotlin

import com.pulumi.awsnative.kotlin.inputs.TagArgs
import com.pulumi.awsnative.kotlin.inputs.TagArgsBuilder
import com.pulumi.awsnative.organizations.PolicyArgs.builder
import com.pulumi.awsnative.organizations.kotlin.enums.PolicyType
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.Any
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * Policies in AWS Organizations enable you to manage different features of the AWS accounts in your organization.  You can use policies when all features are enabled in your organization.
 * @property content The Policy text content. For AWS CloudFormation templates formatted in YAML, you can provide the policy in JSON or YAML format. AWS CloudFormation always converts a YAML policy to JSON format before submitting it.
 * Search the [CloudFormation User Guide](https://docs.aws.amazon.com/cloudformation/) for `AWS::Organizations::Policy` for more information about the expected schema for this property.
 * @property description Human readable description of the policy
 * @property name Name of the Policy
 * @property tags A list of tags that you want to attach to the newly created policy. For each tag in the list, you must specify both a tag key and a value. You can set the value to an empty string, but you can't set it to null.
 * @property targetIds List of unique identifiers (IDs) of the root, OU, or account that you want to attach the policy to
 * @property type The type of policy to create. You can specify one of the following values: AISERVICES_OPT_OUT_POLICY, BACKUP_POLICY, SERVICE_CONTROL_POLICY, TAG_POLICY
 */
public data class PolicyArgs(
    public val content: Output? = null,
    public val description: Output? = null,
    public val name: Output? = null,
    public val tags: Output>? = null,
    public val targetIds: Output>? = null,
    public val type: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.awsnative.organizations.PolicyArgs =
        com.pulumi.awsnative.organizations.PolicyArgs.builder()
            .content(content?.applyValue({ args0 -> args0 }))
            .description(description?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .tags(tags?.applyValue({ args0 -> args0.map({ args0 -> args0.let({ args0 -> args0.toJava() }) }) }))
            .targetIds(targetIds?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .type(type?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) })).build()
}

/**
 * Builder for [PolicyArgs].
 */
@PulumiTagMarker
public class PolicyArgsBuilder internal constructor() {
    private var content: Output? = null

    private var description: Output? = null

    private var name: Output? = null

    private var tags: Output>? = null

    private var targetIds: Output>? = null

    private var type: Output? = null

    /**
     * @param value The Policy text content. For AWS CloudFormation templates formatted in YAML, you can provide the policy in JSON or YAML format. AWS CloudFormation always converts a YAML policy to JSON format before submitting it.
     * Search the [CloudFormation User Guide](https://docs.aws.amazon.com/cloudformation/) for `AWS::Organizations::Policy` for more information about the expected schema for this property.
     */
    @JvmName("bpkexgkhnskyvggn")
    public suspend fun content(`value`: Output) {
        this.content = value
    }

    /**
     * @param value Human readable description of the policy
     */
    @JvmName("jtbxddtxigekcejd")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value Name of the Policy
     */
    @JvmName("jqsqsfcleqiujmau")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value A list of tags that you want to attach to the newly created policy. For each tag in the list, you must specify both a tag key and a value. You can set the value to an empty string, but you can't set it to null.
     */
    @JvmName("sjfhjwmsmpgelmrr")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

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

    /**
     * @param values A list of tags that you want to attach to the newly created policy. For each tag in the list, you must specify both a tag key and a value. You can set the value to an empty string, but you can't set it to null.
     */
    @JvmName("aigxbtcfevlrtlfj")
    public suspend fun tags(values: List>) {
        this.tags = Output.all(values)
    }

    /**
     * @param value List of unique identifiers (IDs) of the root, OU, or account that you want to attach the policy to
     */
    @JvmName("tvluyaxcdeauctub")
    public suspend fun targetIds(`value`: Output>) {
        this.targetIds = value
    }

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

    /**
     * @param values List of unique identifiers (IDs) of the root, OU, or account that you want to attach the policy to
     */
    @JvmName("hgwpdbfhwvqpomwi")
    public suspend fun targetIds(values: List>) {
        this.targetIds = Output.all(values)
    }

    /**
     * @param value The type of policy to create. You can specify one of the following values: AISERVICES_OPT_OUT_POLICY, BACKUP_POLICY, SERVICE_CONTROL_POLICY, TAG_POLICY
     */
    @JvmName("akqwlfwsylnqyscp")
    public suspend fun type(`value`: Output) {
        this.type = value
    }

    /**
     * @param value The Policy text content. For AWS CloudFormation templates formatted in YAML, you can provide the policy in JSON or YAML format. AWS CloudFormation always converts a YAML policy to JSON format before submitting it.
     * Search the [CloudFormation User Guide](https://docs.aws.amazon.com/cloudformation/) for `AWS::Organizations::Policy` for more information about the expected schema for this property.
     */
    @JvmName("covrpwhniyrpsbjn")
    public suspend fun content(`value`: Any?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.content = mapped
    }

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

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

    /**
     * @param value A list of tags that you want to attach to the newly created policy. For each tag in the list, you must specify both a tag key and a value. You can set the value to an empty string, but you can't set it to null.
     */
    @JvmName("ikrneyljnuordmtd")
    public suspend fun tags(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param argument A list of tags that you want to attach to the newly created policy. For each tag in the list, you must specify both a tag key and a value. You can set the value to an empty string, but you can't set it to null.
     */
    @JvmName("jadrfmjtjastcvxq")
    public suspend fun tags(argument: List Unit>) {
        val toBeMapped = argument.toList().map { TagArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.tags = mapped
    }

    /**
     * @param argument A list of tags that you want to attach to the newly created policy. For each tag in the list, you must specify both a tag key and a value. You can set the value to an empty string, but you can't set it to null.
     */
    @JvmName("nlytwjedenjocdoq")
    public suspend fun tags(vararg argument: suspend TagArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map { TagArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.tags = mapped
    }

    /**
     * @param argument A list of tags that you want to attach to the newly created policy. For each tag in the list, you must specify both a tag key and a value. You can set the value to an empty string, but you can't set it to null.
     */
    @JvmName("lsanbcetplbwnbxx")
    public suspend fun tags(argument: suspend TagArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(TagArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.tags = mapped
    }

    /**
     * @param values A list of tags that you want to attach to the newly created policy. For each tag in the list, you must specify both a tag key and a value. You can set the value to an empty string, but you can't set it to null.
     */
    @JvmName("scbenjvpkmjgspga")
    public suspend fun tags(vararg values: TagArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param value List of unique identifiers (IDs) of the root, OU, or account that you want to attach the policy to
     */
    @JvmName("gmpmnnjmvokktetj")
    public suspend fun targetIds(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.targetIds = mapped
    }

    /**
     * @param values List of unique identifiers (IDs) of the root, OU, or account that you want to attach the policy to
     */
    @JvmName("vdysgyagkwinsdfc")
    public suspend fun targetIds(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.targetIds = mapped
    }

    /**
     * @param value The type of policy to create. You can specify one of the following values: AISERVICES_OPT_OUT_POLICY, BACKUP_POLICY, SERVICE_CONTROL_POLICY, TAG_POLICY
     */
    @JvmName("sssagdwytkdnrink")
    public suspend fun type(`value`: PolicyType?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.type = mapped
    }

    internal fun build(): PolicyArgs = PolicyArgs(
        content = content,
        description = description,
        name = name,
        tags = tags,
        targetIds = targetIds,
        type = type,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy