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

com.pulumi.kubernetes.helm.v3.kotlin.Release.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: 4.18.2.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.kubernetes.helm.v3.kotlin

import com.pulumi.asset.AssetOrArchive
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.kubernetes.helm.v3.kotlin.outputs.ReleaseStatus
import com.pulumi.kubernetes.helm.v3.kotlin.outputs.RepositoryOpts
import com.pulumi.resources.Resource
import kotlin.Any
import kotlin.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import com.pulumi.kubernetes.helm.v3.kotlin.outputs.ReleaseStatus.Companion.toKotlin as releaseStatusToKotlin
import com.pulumi.kubernetes.helm.v3.kotlin.outputs.RepositoryOpts.Companion.toKotlin as repositoryOptsToKotlin

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

    public var args: ReleaseArgs = ReleaseArgs()

    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 ReleaseArgsBuilder.() -> Unit) {
        val builder = ReleaseArgsBuilder()
        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(): Release {
        val builtJavaResource = com.pulumi.kubernetes.helm.v3.Release(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return Release(builtJavaResource)
    }
}

/**
 * A `Release` is an instance of a chart running in a Kubernetes cluster. A `Chart` is a Helm package. It contains all the
 * resource definitions necessary to run an application, tool, or service inside a Kubernetes cluster.
 * This resource models a Helm Release as if it were created by the Helm CLI. The underlying implementation embeds Helm as
 * a library to perform the orchestration of the resources. As a result, the full spectrum of Helm features are supported
 * natively.
 * You may also want to consider the `Chart` resource as an alternative method for managing helm charts. For more information about the trade-offs between these options see: [Choosing the right Helm resource for your use case](https://www.pulumi.com/registry/packages/kubernetes/how-to-guides/choosing-the-right-helm-resource-for-your-use-case)
 * ## Example Usage
 * ### Local Chart Directory
 * No Java example available.
 * ### Remote Chart
 * No Java example available.
 * ### Set Chart Values
 * No Java example available.
 * ### Deploy Chart into Namespace
 * No Java example available.
 * ### Depend on a Chart resource
 * No Java example available.
 * ### Specify Helm Chart Values in File and Code
 * No Java example available.
 * ### Query Kubernetes Resource Installed By Helm Chart
 * No Java example available.
 * ## Import
 * An existing Helm Release resource can be imported using its `type token`, `name` and identifier, e.g.
 * ```sh
 * $ pulumi import kubernetes:helm.sh/v3:Release myRelease /
 * ```
 */
public class Release internal constructor(
    override val javaResource: com.pulumi.kubernetes.helm.v3.Release,
) : KotlinCustomResource(javaResource, ReleaseMapper) {
    /**
     * Whether to allow Null values in helm chart configs.
     */
    public val allowNullValues: Output?
        get() = javaResource.allowNullValues().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * If set, installation process purges chart on fail. `skipAwait` will be disabled automatically if atomic is used.
     */
    public val atomic: Output?
        get() = javaResource.atomic().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * Chart name to be installed. A path may be used.
     */
    public val chart: Output
        get() = javaResource.chart().applyValue({ args0 -> args0 })

    /**
     * Allow deletion of new resources created in this upgrade when upgrade fails.
     */
    public val cleanupOnFail: Output?
        get() = javaResource.cleanupOnFail().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Create the namespace if it does not exist.
     */
    public val createNamespace: Output?
        get() = javaResource.createNamespace().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Run helm dependency update before installing the chart.
     */
    public val dependencyUpdate: Output?
        get() = javaResource.dependencyUpdate().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Add a custom description
     */
    public val description: Output?
        get() = javaResource.description().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Use chart development versions, too. Equivalent to version '>0.0.0-0'. If `version` is set, this is ignored.
     */
    public val devel: Output?
        get() = javaResource.devel().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * Prevent CRD hooks from running, but run other hooks.  See helm install --no-crd-hook
     */
    public val disableCRDHooks: Output?
        get() = javaResource.disableCRDHooks().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * If set, the installation process will not validate rendered templates against the Kubernetes OpenAPI Schema
     */
    public val disableOpenapiValidation: Output?
        get() = javaResource.disableOpenapiValidation().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Prevent hooks from running.
     */
    public val disableWebhooks: Output?
        get() = javaResource.disableWebhooks().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Force resource update through delete/recreate if needed.
     */
    public val forceUpdate: Output?
        get() = javaResource.forceUpdate().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Location of public keys used for verification. Used only if `verify` is true
     */
    public val keyring: Output?
        get() = javaResource.keyring().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * Run helm lint when planning.
     */
    public val lint: Output?
        get() = javaResource.lint().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * The rendered manifests as JSON. Not yet supported.
     */
    public val manifest: Output>?
        get() = javaResource.manifest().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })

    /**
     * Limit the maximum number of revisions saved per release. Use 0 for no limit.
     */
    public val maxHistory: Output?
        get() = javaResource.maxHistory().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Release name.
     */
    public val name: Output?
        get() = javaResource.name().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * Namespace to install the release into.
     */
    public val namespace: Output?
        get() = javaResource.namespace().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * Postrender command to run.
     */
    public val postrender: Output?
        get() = javaResource.postrender().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Perform pods restart during upgrade/rollback.
     */
    public val recreatePods: Output?
        get() = javaResource.recreatePods().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * If set, render subchart notes along with the parent.
     */
    public val renderSubchartNotes: Output?
        get() = javaResource.renderSubchartNotes().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Re-use the given name, even if that name is already used. This is unsafe in production
     */
    public val replace: Output?
        get() = javaResource.replace().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * Specification defining the Helm chart repository to use.
     */
    public val repositoryOpts: Output?
        get() = javaResource.repositoryOpts().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> repositoryOptsToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * When upgrading, reset the values to the ones built into the chart.
     */
    public val resetValues: Output?
        get() = javaResource.resetValues().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Names of resources created by the release grouped by "kind/version".
     */
    public val resourceNames: Output>>?
        get() = javaResource.resourceNames().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(
                        args0.value.map({ args0 ->
                            args0
                        }),
                    )
                }).toMap()
            }).orElse(null)
        })

    /**
     * When upgrading, reuse the last release's values and merge in any overrides. If 'resetValues' is specified, this is ignored
     */
    public val reuseValues: Output?
        get() = javaResource.reuseValues().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * By default, the provider waits until all resources are in a ready state before marking the release as successful. Setting this to true will skip such await logic.
     */
    public val skipAwait: Output?
        get() = javaResource.skipAwait().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * If set, no CRDs will be installed. By default, CRDs are installed if not already present.
     */
    public val skipCrds: Output?
        get() = javaResource.skipCrds().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * Status of the deployed release.
     */
    public val status: Output
        get() = javaResource.status().applyValue({ args0 ->
            args0.let({ args0 ->
                releaseStatusToKotlin(args0)
            })
        })

    /**
     * Time in seconds to wait for any individual kubernetes operation.
     */
    public val timeout: Output?
        get() = javaResource.timeout().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * List of assets (raw yaml files). Content is read and merged with values (with values taking precedence).
     */
    public val valueYamlFiles: Output>?
        get() = javaResource.valueYamlFiles().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 -> args0 })
            }).orElse(null)
        })

    /**
     * Custom values set for the release.
     */
    public val values: Output>?
        get() = javaResource.values().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })

    /**
     * Verify the package before installing it.
     */
    public val verify: Output?
        get() = javaResource.verify().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * Specify the exact chart version to install. If this is not specified, the latest version is installed.
     */
    public val version: Output?
        get() = javaResource.version().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * Will wait until all Jobs have been completed before marking the release as successful. This is ignored if `skipAwait` is enabled.
     */
    public val waitForJobs: Output?
        get() = javaResource.waitForJobs().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })
}

public object ReleaseMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.kubernetes.helm.v3.Release::class == javaResource::class

    override fun map(javaResource: Resource): Release = Release(
        javaResource as
            com.pulumi.kubernetes.helm.v3.Release,
    )
}

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy