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

com.pulumi.awsnative.codedeploy.kotlin.DeploymentConfig.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.codedeploy.kotlin

import com.pulumi.awsnative.codedeploy.kotlin.outputs.DeploymentConfigMinimumHealthyHosts
import com.pulumi.awsnative.codedeploy.kotlin.outputs.DeploymentConfigTrafficRoutingConfig
import com.pulumi.awsnative.codedeploy.kotlin.outputs.DeploymentConfigZonalConfig
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 com.pulumi.awsnative.codedeploy.kotlin.outputs.DeploymentConfigMinimumHealthyHosts.Companion.toKotlin as deploymentConfigMinimumHealthyHostsToKotlin
import com.pulumi.awsnative.codedeploy.kotlin.outputs.DeploymentConfigTrafficRoutingConfig.Companion.toKotlin as deploymentConfigTrafficRoutingConfigToKotlin
import com.pulumi.awsnative.codedeploy.kotlin.outputs.DeploymentConfigZonalConfig.Companion.toKotlin as deploymentConfigZonalConfigToKotlin

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

    public var args: DeploymentConfigArgs = DeploymentConfigArgs()

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

/**
 * Resource Type definition for AWS::CodeDeploy::DeploymentConfig
 */
public class DeploymentConfig internal constructor(
    override val javaResource: com.pulumi.awsnative.codedeploy.DeploymentConfig,
) : KotlinCustomResource(javaResource, DeploymentConfigMapper) {
    /**
     * The destination platform type for the deployment (Lambda, Server, or ECS).
     */
    public val computePlatform: Output?
        get() = javaResource.computePlatform().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * A name for the deployment configuration. If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the deployment configuration name. For more information, see Name Type.
     */
    public val deploymentConfigName: Output?
        get() = javaResource.deploymentConfigName().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The minimum number of healthy instances that should be available at any time during the deployment. There are two parameters expected in the input: type and value.
     */
    public val minimumHealthyHosts: Output?
        get() = javaResource.minimumHealthyHosts().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> deploymentConfigMinimumHealthyHostsToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * The configuration that specifies how the deployment traffic is routed.
     */
    public val trafficRoutingConfig: Output?
        get() = javaResource.trafficRoutingConfig().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> deploymentConfigTrafficRoutingConfigToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * The zonal deployment config that specifies how the zonal deployment behaves
     */
    public val zonalConfig: Output?
        get() = javaResource.zonalConfig().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    deploymentConfigZonalConfigToKotlin(args0)
                })
            }).orElse(null)
        })
}

public object DeploymentConfigMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.codedeploy.DeploymentConfig::class == javaResource::class

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy