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

com.pulumi.nomad.kotlin.NomadProvider.kt Maven / Gradle / Ivy

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

package com.pulumi.nomad.kotlin

import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinProviderResource
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.nomad.Provider
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit

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

    public var args: ProviderArgs = ProviderArgs()

    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 ProviderArgsBuilder.() -> Unit) {
        val builder = ProviderArgsBuilder()
        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(): NomadProvider {
        val builtJavaResource = Provider(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return NomadProvider(builtJavaResource)
    }
}

/**
 * The provider type for the nomad package. By default, resources use package-wide configuration
 * settings, however an explicit `Provider` instance may be created and passed during resource
 * construction to achieve fine-grained programmatic control over provider settings. See the
 * [documentation](https://www.pulumi.com/docs/reference/programming-model/#providers) for more information.
 */
public class NomadProvider internal constructor(
    override val javaResource: Provider,
) : KotlinProviderResource(javaResource, NomadProviderMapper) {
    /**
     * URL of the root of the target Nomad agent.
     */
    public val address: Output
        get() = javaResource.address().applyValue({ args0 -> args0 })

    /**
     * A path to a PEM-encoded certificate authority used to verify the remote agent's certificate.
     */
    public val caFile: Output?
        get() = javaResource.caFile().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * PEM-encoded certificate authority used to verify the remote agent's certificate.
     */
    public val caPem: Output?
        get() = javaResource.caPem().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * A path to a PEM-encoded certificate provided to the remote agent; requires use of key_file or key_pem.
     */
    public val certFile: Output?
        get() = javaResource.certFile().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * PEM-encoded certificate provided to the remote agent; requires use of key_file or key_pem.
     */
    public val certPem: Output?
        get() = javaResource.certPem().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * Consul token to validate Consul Connect Service Identity policies specified in the job file.
     */
    public val consulToken: Output?
        get() = javaResource.consulToken().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * HTTP basic auth configuration.
     */
    public val httpAuth: Output?
        get() = javaResource.httpAuth().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * A path to a PEM-encoded private key, required if cert_file or cert_pem is specified.
     */
    public val keyFile: Output?
        get() = javaResource.keyFile().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * PEM-encoded private key, required if cert_file or cert_pem is specified.
     */
    public val keyPem: Output?
        get() = javaResource.keyPem().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * Region of the target Nomad agent.
     */
    public val region: Output?
        get() = javaResource.region().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * ACL token secret for API requests.
     */
    public val secretId: Output?
        get() = javaResource.secretId().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * Vault token if policies are specified in the job file.
     */
    public val vaultToken: Output?
        get() = javaResource.vaultToken().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })
}

public object NomadProviderMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        Provider::class == javaResource::class

    override fun map(javaResource: Resource): NomadProvider = NomadProvider(javaResource as Provider)
}

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy