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

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

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

package com.pulumi.nomad.kotlin

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.nomad.kotlin.outputs.CsiVolumeRegistrationCapability
import com.pulumi.nomad.kotlin.outputs.CsiVolumeRegistrationMountOptions
import com.pulumi.nomad.kotlin.outputs.CsiVolumeRegistrationTopology
import com.pulumi.nomad.kotlin.outputs.CsiVolumeRegistrationTopologyRequest
import com.pulumi.resources.Resource
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.nomad.kotlin.outputs.CsiVolumeRegistrationCapability.Companion.toKotlin as csiVolumeRegistrationCapabilityToKotlin
import com.pulumi.nomad.kotlin.outputs.CsiVolumeRegistrationMountOptions.Companion.toKotlin as csiVolumeRegistrationMountOptionsToKotlin
import com.pulumi.nomad.kotlin.outputs.CsiVolumeRegistrationTopology.Companion.toKotlin as csiVolumeRegistrationTopologyToKotlin
import com.pulumi.nomad.kotlin.outputs.CsiVolumeRegistrationTopologyRequest.Companion.toKotlin as csiVolumeRegistrationTopologyRequestToKotlin

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

    public var args: CsiVolumeRegistrationArgs = CsiVolumeRegistrationArgs()

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

public class CsiVolumeRegistration internal constructor(
    override val javaResource: com.pulumi.nomad.CsiVolumeRegistration,
) : KotlinCustomResource(javaResource, CsiVolumeRegistrationMapper) {
    /**
     * `(``Capability``: )` - Options for validating the capability of a volume.
     */
    public val capabilities: Output>?
        get() = javaResource.capabilities().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> csiVolumeRegistrationCapabilityToKotlin(args0) })
                })
            }).orElse(null)
        })

    public val capacity: Output
        get() = javaResource.capacity().applyValue({ args0 -> args0 })

    /**
     * `(string: )` - Option to signal a maximum volume size. This may not be supported by all storage providers.
     */
    public val capacityMax: Output?
        get() = javaResource.capacityMax().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    public val capacityMaxBytes: Output
        get() = javaResource.capacityMaxBytes().applyValue({ args0 -> args0 })

    /**
     * `(string: )` - Option to signal a minimum volume size. This may not be supported by all storage providers.
     */
    public val capacityMin: Output?
        get() = javaResource.capacityMin().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    public val capacityMinBytes: Output
        get() = javaResource.capacityMinBytes().applyValue({ args0 -> args0 })

    /**
     * `(map[string]string: )` - An optional key-value map of strings passed directly to the CSI plugin to validate the volume.
     */
    public val context: Output>?
        get() = javaResource.context().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })

    public val controllerRequired: Output
        get() = javaResource.controllerRequired().applyValue({ args0 -> args0 })

    public val controllersExpected: Output
        get() = javaResource.controllersExpected().applyValue({ args0 -> args0 })

    public val controllersHealthy: Output
        get() = javaResource.controllersHealthy().applyValue({ args0 -> args0 })

    /**
     * `(boolean: true)` - If true, the volume will be deregistered on destroy.
     */
    public val deregisterOnDestroy: Output?
        get() = javaResource.deregisterOnDestroy().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * `(string: )` - The ID of the physical volume from the storage provider.
     */
    public val externalId: Output
        get() = javaResource.externalId().applyValue({ args0 -> args0 })

    /**
     * `(block: )` Options for mounting `block-device` volumes without a pre-formatted file system.
     */
    public val mountOptions: Output?
        get() = javaResource.mountOptions().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    csiVolumeRegistrationMountOptionsToKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * `(string: )` - The display name for the volume.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * `(string: "default")` - The namespace in which to register the volume.
     */
    public val namespace: Output?
        get() = javaResource.namespace().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    public val nodesExpected: Output
        get() = javaResource.nodesExpected().applyValue({ args0 -> args0 })

    public val nodesHealthy: Output
        get() = javaResource.nodesHealthy().applyValue({ args0 -> args0 })

    /**
     * `(map[string]string: )` - An optional key-value map of strings passed directly to the CSI plugin to configure the volume.
     */
    public val parameters: Output>?
        get() = javaResource.parameters().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })

    /**
     * `(string: )` - The ID of the Nomad plugin for registering this volume.
     */
    public val pluginId: Output
        get() = javaResource.pluginId().applyValue({ args0 -> args0 })

    public val pluginProvider: Output
        get() = javaResource.pluginProvider().applyValue({ args0 -> args0 })

    public val pluginProviderVersion: Output
        get() = javaResource.pluginProviderVersion().applyValue({ args0 -> args0 })

    public val schedulable: Output
        get() = javaResource.schedulable().applyValue({ args0 -> args0 })

    /**
     * `(map[string]string: )` - An optional key-value map of strings used as credentials for publishing and unpublishing volumes.
     */
    public val secrets: Output>?
        get() = javaResource.secrets().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })

    public val topologies: Output>
        get() = javaResource.topologies().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    csiVolumeRegistrationTopologyToKotlin(args0)
                })
            })
        })

    /**
     * `(``TopologyRequest``: )` - Specify locations (region, zone, rack, etc.) where the provisioned volume is accessible from.
     */
    public val topologyRequest: Output?
        get() = javaResource.topologyRequest().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> csiVolumeRegistrationTopologyRequestToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * `(string: )` - The unique ID of the volume.
     */
    public val volumeId: Output
        get() = javaResource.volumeId().applyValue({ args0 -> args0 })
}

public object CsiVolumeRegistrationMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.nomad.CsiVolumeRegistration::class == javaResource::class

    override fun map(javaResource: Resource): CsiVolumeRegistration =
        CsiVolumeRegistration(javaResource as com.pulumi.nomad.CsiVolumeRegistration)
}

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy