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

com.pulumi.awsnative.iot.kotlin.SecurityProfile.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.11.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.awsnative.iot.kotlin

import com.pulumi.awsnative.iot.kotlin.outputs.MetricsExportConfigProperties
import com.pulumi.awsnative.iot.kotlin.outputs.SecurityProfileAlertTarget
import com.pulumi.awsnative.iot.kotlin.outputs.SecurityProfileBehavior
import com.pulumi.awsnative.iot.kotlin.outputs.SecurityProfileMetricToRetain
import com.pulumi.awsnative.kotlin.outputs.Tag
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.List
import kotlin.collections.Map
import com.pulumi.awsnative.iot.kotlin.outputs.MetricsExportConfigProperties.Companion.toKotlin as metricsExportConfigPropertiesToKotlin
import com.pulumi.awsnative.iot.kotlin.outputs.SecurityProfileAlertTarget.Companion.toKotlin as securityProfileAlertTargetToKotlin
import com.pulumi.awsnative.iot.kotlin.outputs.SecurityProfileBehavior.Companion.toKotlin as securityProfileBehaviorToKotlin
import com.pulumi.awsnative.iot.kotlin.outputs.SecurityProfileMetricToRetain.Companion.toKotlin as securityProfileMetricToRetainToKotlin
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin

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

    public var args: SecurityProfileArgs = SecurityProfileArgs()

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

/**
 * A security profile defines a set of expected behaviors for devices in your account.
 */
public class SecurityProfile internal constructor(
    override val javaResource: com.pulumi.awsnative.iot.SecurityProfile,
) : KotlinCustomResource(javaResource, SecurityProfileMapper) {
    /**
     * A list of metrics whose data is retained (stored). By default, data is retained for any metric used in the profile's behaviors, but it is also retained for any metric specified here.
     */
    public val additionalMetricsToRetainV2: Output>?
        get() = javaResource.additionalMetricsToRetainV2().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 ->
                        securityProfileMetricToRetainToKotlin(args0)
                    })
                })
            }).orElse(null)
        })

    /**
     * Specifies the destinations to which alerts are sent.
     */
    public val alertTargets: Output>?
        get() = javaResource.alertTargets().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(
                        args0.value.let({ args0 ->
                            securityProfileAlertTargetToKotlin(args0)
                        }),
                    )
                }).toMap()
            }).orElse(null)
        })

    /**
     * Specifies the behaviors that, when violated by a device (thing), cause an alert.
     */
    public val behaviors: Output>?
        get() = javaResource.behaviors().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> securityProfileBehaviorToKotlin(args0) })
                })
            }).orElse(null)
        })

    /**
     * A structure containing the mqtt topic for metrics export.
     */
    public val metricsExportConfig: Output?
        get() = javaResource.metricsExportConfig().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> metricsExportConfigPropertiesToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * The ARN (Amazon resource name) of the created security profile.
     */
    public val securityProfileArn: Output
        get() = javaResource.securityProfileArn().applyValue({ args0 -> args0 })

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

    /**
     * A unique identifier for the security profile.
     */
    public val securityProfileName: Output?
        get() = javaResource.securityProfileName().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Metadata that can be used to manage the security profile.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> tagToKotlin(args0) })
                })
            }).orElse(null)
        })

    /**
     * A set of target ARNs that the security profile is attached to.
     */
    public val targetArns: Output>?
        get() = javaResource.targetArns().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0
                })
            }).orElse(null)
        })
}

public object SecurityProfileMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.iot.SecurityProfile::class == javaResource::class

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy