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

com.pulumi.awsnative.ecs.kotlin.inputs.ServiceConnectServiceArgs.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.ServiceConnectServiceArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiNullFieldException
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * The Service Connect service object configuration. For more information, see [Service Connect](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect.html) in the *Amazon Elastic Container Service Developer Guide*.
 * @property clientAliases The list of client aliases for this Service Connect service. You use these to assign names that can be used by client applications. The maximum number of client aliases that you can have in this list is 1.
 *  Each alias ("endpoint") is a fully-qualified name and port number that other Amazon ECS tasks ("clients") can use to connect to this service.
 *  Each name and port mapping must be unique within the namespace.
 *  For each ``ServiceConnectService``, you must provide at least one ``clientAlias`` with one ``port``.
 * @property discoveryName The ``discoveryName`` is the name of the new CMAP service that Amazon ECS creates for this Amazon ECS service. This must be unique within the CMAP namespace. The name can contain up to 64 characters. The name can include lowercase letters, numbers, underscores (_), and hyphens (-). The name can't start with a hyphen.
 *  If the ``discoveryName`` isn't specified, the port mapping name from the task definition is used in ``portName.namespace``.
 * @property ingressPortOverride The port number for the Service Connect proxy to listen on.
 *  Use the value of this field to bypass the proxy for traffic on the port number specified in the named ``portMapping`` in the task definition of this application, and then use it in your VPC security groups to allow traffic into the proxy for this Amazon ECS service.
 *  In ``awsvpc`` mode and Fargate, the default value is the container port number. The container port number is in the ``portMapping`` in the task definition. In bridge mode, the default value is the ephemeral port of the Service Connect proxy.
 * @property portName The ``portName`` must match the name of one of the ``portMappings`` from all the containers in the task definition of this Amazon ECS service.
 * @property timeout A reference to an object that represents the configured timeouts for Service Connect.
 * @property tls A reference to an object that represents a Transport Layer Security (TLS) configuration.
 */
public data class ServiceConnectServiceArgs(
    public val clientAliases: Output>? = null,
    public val discoveryName: Output? = null,
    public val ingressPortOverride: Output? = null,
    public val portName: Output,
    public val timeout: Output? = null,
    public val tls: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.awsnative.ecs.inputs.ServiceConnectServiceArgs =
        com.pulumi.awsnative.ecs.inputs.ServiceConnectServiceArgs.builder()
            .clientAliases(
                clientAliases?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .discoveryName(discoveryName?.applyValue({ args0 -> args0 }))
            .ingressPortOverride(ingressPortOverride?.applyValue({ args0 -> args0 }))
            .portName(portName.applyValue({ args0 -> args0 }))
            .timeout(timeout?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .tls(tls?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) })).build()
}

/**
 * Builder for [ServiceConnectServiceArgs].
 */
@PulumiTagMarker
public class ServiceConnectServiceArgsBuilder internal constructor() {
    private var clientAliases: Output>? = null

    private var discoveryName: Output? = null

    private var ingressPortOverride: Output? = null

    private var portName: Output? = null

    private var timeout: Output? = null

    private var tls: Output? = null

    /**
     * @param value The list of client aliases for this Service Connect service. You use these to assign names that can be used by client applications. The maximum number of client aliases that you can have in this list is 1.
     *  Each alias ("endpoint") is a fully-qualified name and port number that other Amazon ECS tasks ("clients") can use to connect to this service.
     *  Each name and port mapping must be unique within the namespace.
     *  For each ``ServiceConnectService``, you must provide at least one ``clientAlias`` with one ``port``.
     */
    @JvmName("pkjtfrswkwhrfsrk")
    public suspend fun clientAliases(`value`: Output>) {
        this.clientAliases = value
    }

    @JvmName("iypcbvnfhgasfkcf")
    public suspend fun clientAliases(vararg values: Output) {
        this.clientAliases = Output.all(values.asList())
    }

    /**
     * @param values The list of client aliases for this Service Connect service. You use these to assign names that can be used by client applications. The maximum number of client aliases that you can have in this list is 1.
     *  Each alias ("endpoint") is a fully-qualified name and port number that other Amazon ECS tasks ("clients") can use to connect to this service.
     *  Each name and port mapping must be unique within the namespace.
     *  For each ``ServiceConnectService``, you must provide at least one ``clientAlias`` with one ``port``.
     */
    @JvmName("wgpdmbtyxnafplbd")
    public suspend fun clientAliases(values: List>) {
        this.clientAliases = Output.all(values)
    }

    /**
     * @param value The ``discoveryName`` is the name of the new CMAP service that Amazon ECS creates for this Amazon ECS service. This must be unique within the CMAP namespace. The name can contain up to 64 characters. The name can include lowercase letters, numbers, underscores (_), and hyphens (-). The name can't start with a hyphen.
     *  If the ``discoveryName`` isn't specified, the port mapping name from the task definition is used in ``portName.namespace``.
     */
    @JvmName("ratqqvqfylgoqqae")
    public suspend fun discoveryName(`value`: Output) {
        this.discoveryName = value
    }

    /**
     * @param value The port number for the Service Connect proxy to listen on.
     *  Use the value of this field to bypass the proxy for traffic on the port number specified in the named ``portMapping`` in the task definition of this application, and then use it in your VPC security groups to allow traffic into the proxy for this Amazon ECS service.
     *  In ``awsvpc`` mode and Fargate, the default value is the container port number. The container port number is in the ``portMapping`` in the task definition. In bridge mode, the default value is the ephemeral port of the Service Connect proxy.
     */
    @JvmName("jmybtstufguonhgs")
    public suspend fun ingressPortOverride(`value`: Output) {
        this.ingressPortOverride = value
    }

    /**
     * @param value The ``portName`` must match the name of one of the ``portMappings`` from all the containers in the task definition of this Amazon ECS service.
     */
    @JvmName("ahthajdebevhofdm")
    public suspend fun portName(`value`: Output) {
        this.portName = value
    }

    /**
     * @param value A reference to an object that represents the configured timeouts for Service Connect.
     */
    @JvmName("mrpiqkpacnfwdqmp")
    public suspend fun timeout(`value`: Output) {
        this.timeout = value
    }

    /**
     * @param value A reference to an object that represents a Transport Layer Security (TLS) configuration.
     */
    @JvmName("ggqecwiyrxfiajww")
    public suspend fun tls(`value`: Output) {
        this.tls = value
    }

    /**
     * @param value The list of client aliases for this Service Connect service. You use these to assign names that can be used by client applications. The maximum number of client aliases that you can have in this list is 1.
     *  Each alias ("endpoint") is a fully-qualified name and port number that other Amazon ECS tasks ("clients") can use to connect to this service.
     *  Each name and port mapping must be unique within the namespace.
     *  For each ``ServiceConnectService``, you must provide at least one ``clientAlias`` with one ``port``.
     */
    @JvmName("mxrwjvbygcntwhxs")
    public suspend fun clientAliases(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.clientAliases = mapped
    }

    /**
     * @param argument The list of client aliases for this Service Connect service. You use these to assign names that can be used by client applications. The maximum number of client aliases that you can have in this list is 1.
     *  Each alias ("endpoint") is a fully-qualified name and port number that other Amazon ECS tasks ("clients") can use to connect to this service.
     *  Each name and port mapping must be unique within the namespace.
     *  For each ``ServiceConnectService``, you must provide at least one ``clientAlias`` with one ``port``.
     */
    @JvmName("rohxplttfvknepkg")
    public suspend fun clientAliases(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            ServiceConnectClientAliasArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.clientAliases = mapped
    }

    /**
     * @param argument The list of client aliases for this Service Connect service. You use these to assign names that can be used by client applications. The maximum number of client aliases that you can have in this list is 1.
     *  Each alias ("endpoint") is a fully-qualified name and port number that other Amazon ECS tasks ("clients") can use to connect to this service.
     *  Each name and port mapping must be unique within the namespace.
     *  For each ``ServiceConnectService``, you must provide at least one ``clientAlias`` with one ``port``.
     */
    @JvmName("xudpxpoujqmxftxf")
    public suspend fun clientAliases(vararg argument: suspend ServiceConnectClientAliasArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            ServiceConnectClientAliasArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.clientAliases = mapped
    }

    /**
     * @param argument The list of client aliases for this Service Connect service. You use these to assign names that can be used by client applications. The maximum number of client aliases that you can have in this list is 1.
     *  Each alias ("endpoint") is a fully-qualified name and port number that other Amazon ECS tasks ("clients") can use to connect to this service.
     *  Each name and port mapping must be unique within the namespace.
     *  For each ``ServiceConnectService``, you must provide at least one ``clientAlias`` with one ``port``.
     */
    @JvmName("yecxbxiqnaqsxogi")
    public suspend fun clientAliases(argument: suspend ServiceConnectClientAliasArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            ServiceConnectClientAliasArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.clientAliases = mapped
    }

    /**
     * @param values The list of client aliases for this Service Connect service. You use these to assign names that can be used by client applications. The maximum number of client aliases that you can have in this list is 1.
     *  Each alias ("endpoint") is a fully-qualified name and port number that other Amazon ECS tasks ("clients") can use to connect to this service.
     *  Each name and port mapping must be unique within the namespace.
     *  For each ``ServiceConnectService``, you must provide at least one ``clientAlias`` with one ``port``.
     */
    @JvmName("nldjepfuhldlycan")
    public suspend fun clientAliases(vararg values: ServiceConnectClientAliasArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.clientAliases = mapped
    }

    /**
     * @param value The ``discoveryName`` is the name of the new CMAP service that Amazon ECS creates for this Amazon ECS service. This must be unique within the CMAP namespace. The name can contain up to 64 characters. The name can include lowercase letters, numbers, underscores (_), and hyphens (-). The name can't start with a hyphen.
     *  If the ``discoveryName`` isn't specified, the port mapping name from the task definition is used in ``portName.namespace``.
     */
    @JvmName("rorxinghaywjhpqw")
    public suspend fun discoveryName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.discoveryName = mapped
    }

    /**
     * @param value The port number for the Service Connect proxy to listen on.
     *  Use the value of this field to bypass the proxy for traffic on the port number specified in the named ``portMapping`` in the task definition of this application, and then use it in your VPC security groups to allow traffic into the proxy for this Amazon ECS service.
     *  In ``awsvpc`` mode and Fargate, the default value is the container port number. The container port number is in the ``portMapping`` in the task definition. In bridge mode, the default value is the ephemeral port of the Service Connect proxy.
     */
    @JvmName("tjmediytleagkhar")
    public suspend fun ingressPortOverride(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.ingressPortOverride = mapped
    }

    /**
     * @param value The ``portName`` must match the name of one of the ``portMappings`` from all the containers in the task definition of this Amazon ECS service.
     */
    @JvmName("mxbbwjuepwnqokwo")
    public suspend fun portName(`value`: String) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.portName = mapped
    }

    /**
     * @param value A reference to an object that represents the configured timeouts for Service Connect.
     */
    @JvmName("kvenjbirvypdrgfm")
    public suspend fun timeout(`value`: ServiceTimeoutConfigurationArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.timeout = mapped
    }

    /**
     * @param argument A reference to an object that represents the configured timeouts for Service Connect.
     */
    @JvmName("dwdytcjfpsstwuax")
    public suspend fun timeout(argument: suspend ServiceTimeoutConfigurationArgsBuilder.() -> Unit) {
        val toBeMapped = ServiceTimeoutConfigurationArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.timeout = mapped
    }

    /**
     * @param value A reference to an object that represents a Transport Layer Security (TLS) configuration.
     */
    @JvmName("tehafgoajowdkpbr")
    public suspend fun tls(`value`: ServiceConnectTlsConfigurationArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tls = mapped
    }

    /**
     * @param argument A reference to an object that represents a Transport Layer Security (TLS) configuration.
     */
    @JvmName("anvjknycckngiupc")
    public suspend fun tls(argument: suspend ServiceConnectTlsConfigurationArgsBuilder.() -> Unit) {
        val toBeMapped = ServiceConnectTlsConfigurationArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.tls = mapped
    }

    internal fun build(): ServiceConnectServiceArgs = ServiceConnectServiceArgs(
        clientAliases = clientAliases,
        discoveryName = discoveryName,
        ingressPortOverride = ingressPortOverride,
        portName = portName ?: throw PulumiNullFieldException("portName"),
        timeout = timeout,
        tls = tls,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy