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

com.pulumi.awsnative.ecs.kotlin.inputs.TaskDefinitionVolumeArgs.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.ecs.kotlin.inputs

import com.pulumi.awsnative.ecs.inputs.TaskDefinitionVolumeArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.jvm.JvmName

/**
 * The data volume configuration for tasks launched using this task definition. Specifying a volume configuration in a task definition is optional. The volume configuration may contain multiple volumes but only one volume configured at launch is supported. Each volume defined in the volume configuration may only specify a ``name`` and one of either ``configuredAtLaunch``, ``dockerVolumeConfiguration``, ``efsVolumeConfiguration``, ``fsxWindowsFileServerVolumeConfiguration``, or ``host``. If an empty volume configuration is specified, by default Amazon ECS uses a host volume. For more information, see [Using data volumes in tasks](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_data_volumes.html).
 * @property configuredAtLaunch Indicates whether the volume should be configured at launch time. This is used to create Amazon EBS volumes for standalone tasks or tasks created as part of a service. Each task definition revision may only have one volume configured at launch in the volume configuration.
 *  To configure a volume at launch time, use this task definition revision and specify a ``volumeConfigurations`` object when calling the ``CreateService``, ``UpdateService``, ``RunTask`` or ``StartTask`` APIs.
 * @property dockerVolumeConfiguration This parameter is specified when you use Docker volumes.
 *  Windows containers only support the use of the ``local`` driver. To use bind mounts, specify the ``host`` parameter instead.
 *   Docker volumes aren't supported by tasks run on FARGATElong.
 * @property efsVolumeConfiguration This parameter is specified when you use an Amazon Elastic File System file system for task storage.
 * @property fSxWindowsFileServerVolumeConfiguration This parameter is specified when you use Amazon FSx for Windows File Server file system for task storage.
 * @property host This parameter is specified when you use bind mount host volumes. The contents of the ``host`` parameter determine whether your bind mount host volume persists on the host container instance and where it's stored. If the ``host`` parameter is empty, then the Docker daemon assigns a host path for your data volume. However, the data isn't guaranteed to persist after the containers that are associated with it stop running.
 *  Windows containers can mount whole directories on the same drive as ``$env:ProgramData``. Windows containers can't mount directories on a different drive, and mount point can't be across drives. For example, you can mount ``C:\my\path:C:\my\path`` and ``D:\:D:\``, but not ``D:\my\path:C:\my\path`` or ``D:\:C:\my\path``.
 * @property name The name of the volume. Up to 255 letters (uppercase and lowercase), numbers, underscores, and hyphens are allowed.
 *  When using a volume configured at launch, the ``name`` is required and must also be specified as the volume name in the ``ServiceVolumeConfiguration`` or ``TaskVolumeConfiguration`` parameter when creating your service or standalone task.
 *  For all other types of volumes, this name is referenced in the ``sourceVolume`` parameter of the ``mountPoints`` object in the container definition.
 *  When a volume is using the ``efsVolumeConfiguration``, the name is required.
 */
public data class TaskDefinitionVolumeArgs(
    public val configuredAtLaunch: Output? = null,
    public val dockerVolumeConfiguration: Output? = null,
    public val efsVolumeConfiguration: Output? = null,
    public val fSxWindowsFileServerVolumeConfiguration: Output? = null,
    public val host: Output? = null,
    public val name: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.awsnative.ecs.inputs.TaskDefinitionVolumeArgs =
        com.pulumi.awsnative.ecs.inputs.TaskDefinitionVolumeArgs.builder()
            .configuredAtLaunch(configuredAtLaunch?.applyValue({ args0 -> args0 }))
            .dockerVolumeConfiguration(
                dockerVolumeConfiguration?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .efsVolumeConfiguration(
                efsVolumeConfiguration?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .fSxWindowsFileServerVolumeConfiguration(
                fSxWindowsFileServerVolumeConfiguration?.applyValue({ args0 ->
                    args0.let({ args0 -> args0.toJava() })
                }),
            )
            .host(host?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .name(name?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [TaskDefinitionVolumeArgs].
 */
@PulumiTagMarker
public class TaskDefinitionVolumeArgsBuilder internal constructor() {
    private var configuredAtLaunch: Output? = null

    private var dockerVolumeConfiguration: Output? = null

    private var efsVolumeConfiguration: Output? = null

    private var fSxWindowsFileServerVolumeConfiguration:
        Output? = null

    private var host: Output? = null

    private var name: Output? = null

    /**
     * @param value Indicates whether the volume should be configured at launch time. This is used to create Amazon EBS volumes for standalone tasks or tasks created as part of a service. Each task definition revision may only have one volume configured at launch in the volume configuration.
     *  To configure a volume at launch time, use this task definition revision and specify a ``volumeConfigurations`` object when calling the ``CreateService``, ``UpdateService``, ``RunTask`` or ``StartTask`` APIs.
     */
    @JvmName("tpnrmxwprlevwfwj")
    public suspend fun configuredAtLaunch(`value`: Output) {
        this.configuredAtLaunch = value
    }

    /**
     * @param value This parameter is specified when you use Docker volumes.
     *  Windows containers only support the use of the ``local`` driver. To use bind mounts, specify the ``host`` parameter instead.
     *   Docker volumes aren't supported by tasks run on FARGATElong.
     */
    @JvmName("ylnwrhdblyhqfbdi")
    public suspend fun dockerVolumeConfiguration(`value`: Output) {
        this.dockerVolumeConfiguration = value
    }

    /**
     * @param value This parameter is specified when you use an Amazon Elastic File System file system for task storage.
     */
    @JvmName("lntvnpgtjwdrwqvq")
    public suspend fun efsVolumeConfiguration(`value`: Output) {
        this.efsVolumeConfiguration = value
    }

    /**
     * @param value This parameter is specified when you use Amazon FSx for Windows File Server file system for task storage.
     */
    @JvmName("tfosbaxtcvhjleex")
    public suspend fun fSxWindowsFileServerVolumeConfiguration(`value`: Output) {
        this.fSxWindowsFileServerVolumeConfiguration = value
    }

    /**
     * @param value This parameter is specified when you use bind mount host volumes. The contents of the ``host`` parameter determine whether your bind mount host volume persists on the host container instance and where it's stored. If the ``host`` parameter is empty, then the Docker daemon assigns a host path for your data volume. However, the data isn't guaranteed to persist after the containers that are associated with it stop running.
     *  Windows containers can mount whole directories on the same drive as ``$env:ProgramData``. Windows containers can't mount directories on a different drive, and mount point can't be across drives. For example, you can mount ``C:\my\path:C:\my\path`` and ``D:\:D:\``, but not ``D:\my\path:C:\my\path`` or ``D:\:C:\my\path``.
     */
    @JvmName("xpgjpnuaalfjkssn")
    public suspend fun host(`value`: Output) {
        this.host = value
    }

    /**
     * @param value The name of the volume. Up to 255 letters (uppercase and lowercase), numbers, underscores, and hyphens are allowed.
     *  When using a volume configured at launch, the ``name`` is required and must also be specified as the volume name in the ``ServiceVolumeConfiguration`` or ``TaskVolumeConfiguration`` parameter when creating your service or standalone task.
     *  For all other types of volumes, this name is referenced in the ``sourceVolume`` parameter of the ``mountPoints`` object in the container definition.
     *  When a volume is using the ``efsVolumeConfiguration``, the name is required.
     */
    @JvmName("qwibtuhvpiwchixa")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value Indicates whether the volume should be configured at launch time. This is used to create Amazon EBS volumes for standalone tasks or tasks created as part of a service. Each task definition revision may only have one volume configured at launch in the volume configuration.
     *  To configure a volume at launch time, use this task definition revision and specify a ``volumeConfigurations`` object when calling the ``CreateService``, ``UpdateService``, ``RunTask`` or ``StartTask`` APIs.
     */
    @JvmName("kxberdvwlpjpgxqh")
    public suspend fun configuredAtLaunch(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.configuredAtLaunch = mapped
    }

    /**
     * @param value This parameter is specified when you use Docker volumes.
     *  Windows containers only support the use of the ``local`` driver. To use bind mounts, specify the ``host`` parameter instead.
     *   Docker volumes aren't supported by tasks run on FARGATElong.
     */
    @JvmName("wytfbampimpidmqg")
    public suspend fun dockerVolumeConfiguration(`value`: TaskDefinitionDockerVolumeConfigurationArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.dockerVolumeConfiguration = mapped
    }

    /**
     * @param argument This parameter is specified when you use Docker volumes.
     *  Windows containers only support the use of the ``local`` driver. To use bind mounts, specify the ``host`` parameter instead.
     *   Docker volumes aren't supported by tasks run on FARGATElong.
     */
    @JvmName("sdudtajgqfcwprbr")
    public suspend fun dockerVolumeConfiguration(argument: suspend TaskDefinitionDockerVolumeConfigurationArgsBuilder.() -> Unit) {
        val toBeMapped = TaskDefinitionDockerVolumeConfigurationArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.dockerVolumeConfiguration = mapped
    }

    /**
     * @param value This parameter is specified when you use an Amazon Elastic File System file system for task storage.
     */
    @JvmName("uxxjohnfumeqwcrx")
    public suspend fun efsVolumeConfiguration(`value`: TaskDefinitionEfsVolumeConfigurationArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.efsVolumeConfiguration = mapped
    }

    /**
     * @param argument This parameter is specified when you use an Amazon Elastic File System file system for task storage.
     */
    @JvmName("jcnsrmkqpvaejili")
    public suspend fun efsVolumeConfiguration(argument: suspend TaskDefinitionEfsVolumeConfigurationArgsBuilder.() -> Unit) {
        val toBeMapped = TaskDefinitionEfsVolumeConfigurationArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.efsVolumeConfiguration = mapped
    }

    /**
     * @param value This parameter is specified when you use Amazon FSx for Windows File Server file system for task storage.
     */
    @JvmName("woigralleuituhme")
    public suspend fun fSxWindowsFileServerVolumeConfiguration(`value`: TaskDefinitionFSxWindowsFileServerVolumeConfigurationArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.fSxWindowsFileServerVolumeConfiguration = mapped
    }

    /**
     * @param argument This parameter is specified when you use Amazon FSx for Windows File Server file system for task storage.
     */
    @JvmName("epsokfffdpxghddo")
    public suspend fun fSxWindowsFileServerVolumeConfiguration(argument: suspend TaskDefinitionFSxWindowsFileServerVolumeConfigurationArgsBuilder.() -> Unit) {
        val toBeMapped =
            TaskDefinitionFSxWindowsFileServerVolumeConfigurationArgsBuilder().applySuspend {
                argument()
            }.build()
        val mapped = of(toBeMapped)
        this.fSxWindowsFileServerVolumeConfiguration = mapped
    }

    /**
     * @param value This parameter is specified when you use bind mount host volumes. The contents of the ``host`` parameter determine whether your bind mount host volume persists on the host container instance and where it's stored. If the ``host`` parameter is empty, then the Docker daemon assigns a host path for your data volume. However, the data isn't guaranteed to persist after the containers that are associated with it stop running.
     *  Windows containers can mount whole directories on the same drive as ``$env:ProgramData``. Windows containers can't mount directories on a different drive, and mount point can't be across drives. For example, you can mount ``C:\my\path:C:\my\path`` and ``D:\:D:\``, but not ``D:\my\path:C:\my\path`` or ``D:\:C:\my\path``.
     */
    @JvmName("epxeayttrsxbjjmt")
    public suspend fun host(`value`: TaskDefinitionHostVolumePropertiesArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.host = mapped
    }

    /**
     * @param argument This parameter is specified when you use bind mount host volumes. The contents of the ``host`` parameter determine whether your bind mount host volume persists on the host container instance and where it's stored. If the ``host`` parameter is empty, then the Docker daemon assigns a host path for your data volume. However, the data isn't guaranteed to persist after the containers that are associated with it stop running.
     *  Windows containers can mount whole directories on the same drive as ``$env:ProgramData``. Windows containers can't mount directories on a different drive, and mount point can't be across drives. For example, you can mount ``C:\my\path:C:\my\path`` and ``D:\:D:\``, but not ``D:\my\path:C:\my\path`` or ``D:\:C:\my\path``.
     */
    @JvmName("sghncfbidliledgg")
    public suspend fun host(argument: suspend TaskDefinitionHostVolumePropertiesArgsBuilder.() -> Unit) {
        val toBeMapped = TaskDefinitionHostVolumePropertiesArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.host = mapped
    }

    /**
     * @param value The name of the volume. Up to 255 letters (uppercase and lowercase), numbers, underscores, and hyphens are allowed.
     *  When using a volume configured at launch, the ``name`` is required and must also be specified as the volume name in the ``ServiceVolumeConfiguration`` or ``TaskVolumeConfiguration`` parameter when creating your service or standalone task.
     *  For all other types of volumes, this name is referenced in the ``sourceVolume`` parameter of the ``mountPoints`` object in the container definition.
     *  When a volume is using the ``efsVolumeConfiguration``, the name is required.
     */
    @JvmName("ekbtjtnndkxhmnrs")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    internal fun build(): TaskDefinitionVolumeArgs = TaskDefinitionVolumeArgs(
        configuredAtLaunch = configuredAtLaunch,
        dockerVolumeConfiguration = dockerVolumeConfiguration,
        efsVolumeConfiguration = efsVolumeConfiguration,
        fSxWindowsFileServerVolumeConfiguration = fSxWindowsFileServerVolumeConfiguration,
        host = host,
        name = name,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy