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

com.pulumi.nomad.kotlin.CsiVolume.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.CsiVolumeCapability
import com.pulumi.nomad.kotlin.outputs.CsiVolumeMountOptions
import com.pulumi.nomad.kotlin.outputs.CsiVolumeTopology
import com.pulumi.nomad.kotlin.outputs.CsiVolumeTopologyRequest
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.CsiVolumeCapability.Companion.toKotlin as csiVolumeCapabilityToKotlin
import com.pulumi.nomad.kotlin.outputs.CsiVolumeMountOptions.Companion.toKotlin as csiVolumeMountOptionsToKotlin
import com.pulumi.nomad.kotlin.outputs.CsiVolumeTopology.Companion.toKotlin as csiVolumeTopologyToKotlin
import com.pulumi.nomad.kotlin.outputs.CsiVolumeTopologyRequest.Companion.toKotlin as csiVolumeTopologyRequestToKotlin

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

    public var args: CsiVolumeArgs = CsiVolumeArgs()

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

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

    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 })

    /**
     * `(string: )` - The external ID of an existing volume to restore. If ommited, the volume will be created from scratch. Conflicts with `snapshot_id`.
     */
    public val cloneId: Output?
        get() = javaResource.cloneId().applyValue({ args0 -> args0.map({ args0 -> args0 }).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 })

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

    /**
     * `(block: optional)` 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 ->
                    csiVolumeMountOptionsToKotlin(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: optional)` 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: optional)` 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)
        })

    /**
     * `(string: )` - The external ID of a snapshot to restore. If ommited, the volume will be created from scratch. Conflicts with `clone_id`.
     */
    public val snapshotId: Output?
        get() = javaResource.snapshotId().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    public val topologies: Output>
        get() = javaResource.topologies().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    csiVolumeTopologyToKotlin(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 -> csiVolumeTopologyRequestToKotlin(args0) })
            }).orElse(null)
        })

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

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

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy