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

com.pulumi.awsnative.securityhub.kotlin.ConfigurationPolicy.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.outputs.ConfigurationPolicyPolicy
import com.pulumi.awsnative.securityhub.kotlin.outputs.ConfigurationPolicyPolicy.Companion.toKotlin
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.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map

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

    public var args: ConfigurationPolicyArgs = ConfigurationPolicyArgs()

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

/**
 * The AWS::SecurityHub::ConfigurationPolicy resource represents the Central Configuration Policy in your account.
 */
public class ConfigurationPolicy internal constructor(
    override val javaResource: com.pulumi.awsnative.securityhub.ConfigurationPolicy,
) : KotlinCustomResource(javaResource, ConfigurationPolicyMapper) {
    /**
     * The Amazon Resource Name (ARN) of the configuration policy.
     */
    public val arn: Output
        get() = javaResource.arn().applyValue({ args0 -> args0 })

    /**
     * The universally unique identifier (UUID) of the configuration policy.
     */
    public val awsId: Output
        get() = javaResource.awsId().applyValue({ args0 -> args0 })

    /**
     * An object that defines how AWS Security Hub is configured. It includes whether Security Hub is enabled or disabled, a list of enabled security standards, a list of enabled or disabled security controls, and a list of custom parameter values for specified controls. If you provide a list of security controls that are enabled in the configuration policy, Security Hub disables all other controls (including newly released controls). If you provide a list of security controls that are disabled in the configuration policy, Security Hub enables all other controls (including newly released controls).
     */
    public val configurationPolicy: Output
        get() = javaResource.configurationPolicy().applyValue({ args0 ->
            args0.let({ args0 ->
                toKotlin(args0)
            })
        })

    /**
     * The date and time, in UTC and ISO 8601 format.
     */
    public val createdAt: Output
        get() = javaResource.createdAt().applyValue({ args0 -> args0 })

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

    /**
     * The name of the configuration policy.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * Indicates whether the service that the configuration policy applies to is enabled in the policy.
     */
    public val serviceEnabled: Output
        get() = javaResource.serviceEnabled().applyValue({ args0 -> args0 })

    /**
     * User-defined tags associated with a configuration policy. For more information, see [Tagging AWS Security Hub resources](https://docs.aws.amazon.com/securityhub/latest/userguide/tagging-resources.html) in the *Security Hub user guide* .
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })

    /**
     * The date and time, in UTC and ISO 8601 format.
     */
    public val updatedAt: Output
        get() = javaResource.updatedAt().applyValue({ args0 -> args0 })
}

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

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy