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

com.pulumi.azurenative.containerinstance.kotlin.inputs.ContainerArgs.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: 2.82.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azurenative.containerinstance.kotlin.inputs

import com.pulumi.azurenative.containerinstance.inputs.ContainerArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiNullFieldException
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * A container instance.
 * @property command The commands to execute within the container instance in exec form.
 * @property environmentVariables The environment variables to set in the container instance.
 * @property image The name of the image used to create the container instance.
 * @property livenessProbe The liveness probe.
 * @property name The user-provided name of the container instance.
 * @property ports The exposed ports on the container instance.
 * @property readinessProbe The readiness probe.
 * @property resources The resource requirements of the container instance.
 * @property securityContext The container security properties.
 * @property volumeMounts The volume mounts available to the container instance.
 */
public data class ContainerArgs(
    public val command: Output>? = null,
    public val environmentVariables: Output>? = null,
    public val image: Output,
    public val livenessProbe: Output? = null,
    public val name: Output,
    public val ports: Output>? = null,
    public val readinessProbe: Output? = null,
    public val resources: Output,
    public val securityContext: Output? = null,
    public val volumeMounts: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.containerinstance.inputs.ContainerArgs =
        com.pulumi.azurenative.containerinstance.inputs.ContainerArgs.builder()
            .command(command?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .environmentVariables(
                environmentVariables?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .image(image.applyValue({ args0 -> args0 }))
            .livenessProbe(livenessProbe?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .name(name.applyValue({ args0 -> args0 }))
            .ports(ports?.applyValue({ args0 -> args0.map({ args0 -> args0.let({ args0 -> args0.toJava() }) }) }))
            .readinessProbe(readinessProbe?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .resources(resources.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .securityContext(securityContext?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .volumeMounts(
                volumeMounts?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            ).build()
}

/**
 * Builder for [ContainerArgs].
 */
@PulumiTagMarker
public class ContainerArgsBuilder internal constructor() {
    private var command: Output>? = null

    private var environmentVariables: Output>? = null

    private var image: Output? = null

    private var livenessProbe: Output? = null

    private var name: Output? = null

    private var ports: Output>? = null

    private var readinessProbe: Output? = null

    private var resources: Output? = null

    private var securityContext: Output? = null

    private var volumeMounts: Output>? = null

    /**
     * @param value The commands to execute within the container instance in exec form.
     */
    @JvmName("sxudhsthnusdxqka")
    public suspend fun command(`value`: Output>) {
        this.command = value
    }

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

    /**
     * @param values The commands to execute within the container instance in exec form.
     */
    @JvmName("ysmgggecxisipqkq")
    public suspend fun command(values: List>) {
        this.command = Output.all(values)
    }

    /**
     * @param value The environment variables to set in the container instance.
     */
    @JvmName("spetntjinntpmqrx")
    public suspend fun environmentVariables(`value`: Output>) {
        this.environmentVariables = value
    }

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

    /**
     * @param values The environment variables to set in the container instance.
     */
    @JvmName("itqqrnalmdybxkhk")
    public suspend fun environmentVariables(values: List>) {
        this.environmentVariables = Output.all(values)
    }

    /**
     * @param value The name of the image used to create the container instance.
     */
    @JvmName("tnxvcsuganmksrfi")
    public suspend fun image(`value`: Output) {
        this.image = value
    }

    /**
     * @param value The liveness probe.
     */
    @JvmName("ifnmsjtcradfilhx")
    public suspend fun livenessProbe(`value`: Output) {
        this.livenessProbe = value
    }

    /**
     * @param value The user-provided name of the container instance.
     */
    @JvmName("fvkotvnifktsqkfn")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The exposed ports on the container instance.
     */
    @JvmName("tfiwmfukjnbtjtip")
    public suspend fun ports(`value`: Output>) {
        this.ports = value
    }

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

    /**
     * @param values The exposed ports on the container instance.
     */
    @JvmName("ibqptstwmhunfhvc")
    public suspend fun ports(values: List>) {
        this.ports = Output.all(values)
    }

    /**
     * @param value The readiness probe.
     */
    @JvmName("hashduadmwoejfon")
    public suspend fun readinessProbe(`value`: Output) {
        this.readinessProbe = value
    }

    /**
     * @param value The resource requirements of the container instance.
     */
    @JvmName("mcegnoqfyckgmikd")
    public suspend fun resources(`value`: Output) {
        this.resources = value
    }

    /**
     * @param value The container security properties.
     */
    @JvmName("djfrxtwvsgkwysnt")
    public suspend fun securityContext(`value`: Output) {
        this.securityContext = value
    }

    /**
     * @param value The volume mounts available to the container instance.
     */
    @JvmName("scnsyxroypoifval")
    public suspend fun volumeMounts(`value`: Output>) {
        this.volumeMounts = value
    }

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

    /**
     * @param values The volume mounts available to the container instance.
     */
    @JvmName("sdtgxfgkaqcsnmow")
    public suspend fun volumeMounts(values: List>) {
        this.volumeMounts = Output.all(values)
    }

    /**
     * @param value The commands to execute within the container instance in exec form.
     */
    @JvmName("phaqsbrtjugrgeer")
    public suspend fun command(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.command = mapped
    }

    /**
     * @param values The commands to execute within the container instance in exec form.
     */
    @JvmName("sorgqfjxemeccgtf")
    public suspend fun command(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.command = mapped
    }

    /**
     * @param value The environment variables to set in the container instance.
     */
    @JvmName("wnorgvpsvgsbfxyv")
    public suspend fun environmentVariables(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.environmentVariables = mapped
    }

    /**
     * @param argument The environment variables to set in the container instance.
     */
    @JvmName("sofaabvyxgpktfhq")
    public suspend fun environmentVariables(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            EnvironmentVariableArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.environmentVariables = mapped
    }

    /**
     * @param argument The environment variables to set in the container instance.
     */
    @JvmName("wndxisvkmxxmxpun")
    public suspend fun environmentVariables(vararg argument: suspend EnvironmentVariableArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            EnvironmentVariableArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.environmentVariables = mapped
    }

    /**
     * @param argument The environment variables to set in the container instance.
     */
    @JvmName("igbpqtdforqkhqff")
    public suspend fun environmentVariables(argument: suspend EnvironmentVariableArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(EnvironmentVariableArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.environmentVariables = mapped
    }

    /**
     * @param values The environment variables to set in the container instance.
     */
    @JvmName("blbbmieohlnbljgg")
    public suspend fun environmentVariables(vararg values: EnvironmentVariableArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.environmentVariables = mapped
    }

    /**
     * @param value The name of the image used to create the container instance.
     */
    @JvmName("ciaxfovrsycgxsgx")
    public suspend fun image(`value`: String) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.image = mapped
    }

    /**
     * @param value The liveness probe.
     */
    @JvmName("yjcipooivcfixqvj")
    public suspend fun livenessProbe(`value`: ContainerProbeArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.livenessProbe = mapped
    }

    /**
     * @param argument The liveness probe.
     */
    @JvmName("rsrgvecbpxpsosib")
    public suspend fun livenessProbe(argument: suspend ContainerProbeArgsBuilder.() -> Unit) {
        val toBeMapped = ContainerProbeArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.livenessProbe = mapped
    }

    /**
     * @param value The user-provided name of the container instance.
     */
    @JvmName("uxlknxfwfbxulicp")
    public suspend fun name(`value`: String) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The exposed ports on the container instance.
     */
    @JvmName("rvwunludlaxckgog")
    public suspend fun ports(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.ports = mapped
    }

    /**
     * @param argument The exposed ports on the container instance.
     */
    @JvmName("uoakvfxcxfeajpih")
    public suspend fun ports(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            ContainerPortArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.ports = mapped
    }

    /**
     * @param argument The exposed ports on the container instance.
     */
    @JvmName("sxuadrgweqbpvpbq")
    public suspend fun ports(vararg argument: suspend ContainerPortArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            ContainerPortArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.ports = mapped
    }

    /**
     * @param argument The exposed ports on the container instance.
     */
    @JvmName("lumsthaxseraeecu")
    public suspend fun ports(argument: suspend ContainerPortArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(ContainerPortArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.ports = mapped
    }

    /**
     * @param values The exposed ports on the container instance.
     */
    @JvmName("bamgqsnxifvrfdqs")
    public suspend fun ports(vararg values: ContainerPortArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.ports = mapped
    }

    /**
     * @param value The readiness probe.
     */
    @JvmName("bfhpgrjmqjahlbhs")
    public suspend fun readinessProbe(`value`: ContainerProbeArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.readinessProbe = mapped
    }

    /**
     * @param argument The readiness probe.
     */
    @JvmName("ggonuxottmpkhhyw")
    public suspend fun readinessProbe(argument: suspend ContainerProbeArgsBuilder.() -> Unit) {
        val toBeMapped = ContainerProbeArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.readinessProbe = mapped
    }

    /**
     * @param value The resource requirements of the container instance.
     */
    @JvmName("uglqwucdurxvbeeb")
    public suspend fun resources(`value`: ResourceRequirementsArgs) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.resources = mapped
    }

    /**
     * @param argument The resource requirements of the container instance.
     */
    @JvmName("smddqmdypuurbdsl")
    public suspend fun resources(argument: suspend ResourceRequirementsArgsBuilder.() -> Unit) {
        val toBeMapped = ResourceRequirementsArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.resources = mapped
    }

    /**
     * @param value The container security properties.
     */
    @JvmName("vdcrsyxfscbbwoqj")
    public suspend fun securityContext(`value`: SecurityContextDefinitionArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.securityContext = mapped
    }

    /**
     * @param argument The container security properties.
     */
    @JvmName("ctrefxjdjapyjhtp")
    public suspend fun securityContext(argument: suspend SecurityContextDefinitionArgsBuilder.() -> Unit) {
        val toBeMapped = SecurityContextDefinitionArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.securityContext = mapped
    }

    /**
     * @param value The volume mounts available to the container instance.
     */
    @JvmName("nvoovegpwhmbiysd")
    public suspend fun volumeMounts(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.volumeMounts = mapped
    }

    /**
     * @param argument The volume mounts available to the container instance.
     */
    @JvmName("phphahlukhjoiwdf")
    public suspend fun volumeMounts(argument: List Unit>) {
        val toBeMapped = argument.toList().map { VolumeMountArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.volumeMounts = mapped
    }

    /**
     * @param argument The volume mounts available to the container instance.
     */
    @JvmName("jnijthdvudvpijsx")
    public suspend fun volumeMounts(vararg argument: suspend VolumeMountArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map { VolumeMountArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.volumeMounts = mapped
    }

    /**
     * @param argument The volume mounts available to the container instance.
     */
    @JvmName("jbyhexfgpujxdcsr")
    public suspend fun volumeMounts(argument: suspend VolumeMountArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(VolumeMountArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.volumeMounts = mapped
    }

    /**
     * @param values The volume mounts available to the container instance.
     */
    @JvmName("sbsfpcjkmiraoukf")
    public suspend fun volumeMounts(vararg values: VolumeMountArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.volumeMounts = mapped
    }

    internal fun build(): ContainerArgs = ContainerArgs(
        command = command,
        environmentVariables = environmentVariables,
        image = image ?: throw PulumiNullFieldException("image"),
        livenessProbe = livenessProbe,
        name = name ?: throw PulumiNullFieldException("name"),
        ports = ports,
        readinessProbe = readinessProbe,
        resources = resources ?: throw PulumiNullFieldException("resources"),
        securityContext = securityContext,
        volumeMounts = volumeMounts,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy