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

com.pulumi.awsnative.iot.kotlin.CaCertificate.kt Maven / Gradle / Ivy

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

package com.pulumi.awsnative.iot.kotlin

import com.pulumi.awsnative.iot.kotlin.enums.CaCertificateAutoRegistrationStatus
import com.pulumi.awsnative.iot.kotlin.enums.CaCertificateCertificateMode
import com.pulumi.awsnative.iot.kotlin.enums.CaCertificateStatus
import com.pulumi.awsnative.iot.kotlin.outputs.CaCertificateRegistrationConfig
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 com.pulumi.awsnative.iot.kotlin.enums.CaCertificateAutoRegistrationStatus.Companion.toKotlin as caCertificateAutoRegistrationStatusToKotlin
import com.pulumi.awsnative.iot.kotlin.enums.CaCertificateCertificateMode.Companion.toKotlin as caCertificateCertificateModeToKotlin
import com.pulumi.awsnative.iot.kotlin.enums.CaCertificateStatus.Companion.toKotlin as caCertificateStatusToKotlin
import com.pulumi.awsnative.iot.kotlin.outputs.CaCertificateRegistrationConfig.Companion.toKotlin as caCertificateRegistrationConfigToKotlin
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin

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

    public var args: CaCertificateArgs = CaCertificateArgs()

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

/**
 * Registers a CA Certificate in IoT.
 */
public class CaCertificate internal constructor(
    override val javaResource: com.pulumi.awsnative.iot.CaCertificate,
) : KotlinCustomResource(javaResource, CaCertificateMapper) {
    /**
     * Returns the Amazon Resource Name (ARN) for the CA certificate. For example:
     * `{ "Fn::GetAtt": ["MyCACertificate", "Arn"] }`
     * A value similar to the following is returned:
     * `arn:aws:iot:us-east-1:123456789012:cacert/a6be6b84559801927e35a8f901fae08b5971d78d1562e29504ff9663b276a5f5`
     */
    public val arn: Output
        get() = javaResource.arn().applyValue({ args0 -> args0 })

    /**
     * Whether the CA certificate is configured for auto registration of device certificates. Valid values are "ENABLE" and "DISABLE".
     */
    public val autoRegistrationStatus: Output?
        get() = javaResource.autoRegistrationStatus().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> caCertificateAutoRegistrationStatusToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * The CA certificate ID.
     */
    public val awsId: Output
        get() = javaResource.awsId().applyValue({ args0 -> args0 })

    /**
     * The certificate data in PEM format.
     */
    public val caCertificatePem: Output
        get() = javaResource.caCertificatePem().applyValue({ args0 -> args0 })

    /**
     * The mode of the CA.
     * All the device certificates that are registered using this CA will be registered in the same mode as the CA. For more information about certificate mode for device certificates, see [certificate mode](https://docs.aws.amazon.com//iot/latest/apireference/API_CertificateDescription.html#iot-Type-CertificateDescription-certificateMode) .
     * Valid values are "DEFAULT" and "SNI_ONLY".
     */
    public val certificateMode: Output?
        get() = javaResource.certificateMode().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> caCertificateCertificateModeToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * Information about the registration configuration.
     */
    public val registrationConfig: Output?
        get() = javaResource.registrationConfig().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> caCertificateRegistrationConfigToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * If true, removes auto registration.
     */
    public val removeAutoRegistration: Output?
        get() = javaResource.removeAutoRegistration().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The status of the CA certificate.
     * Valid values are "ACTIVE" and "INACTIVE".
     */
    public val status: Output
        get() = javaResource.status().applyValue({ args0 ->
            args0.let({ args0 ->
                caCertificateStatusToKotlin(args0)
            })
        })

    /**
     * An array of key-value pairs to apply to this resource.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> tagToKotlin(args0) })
                })
            }).orElse(null)
        })

    /**
     * The private key verification certificate.
     */
    public val verificationCertificatePem: Output?
        get() = javaResource.verificationCertificatePem().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })
}

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

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy