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

com.pulumi.aws.globalaccelerator.kotlin.EndpointGroupArgs.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: 6.57.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.aws.globalaccelerator.kotlin

import com.pulumi.aws.globalaccelerator.EndpointGroupArgs.builder
import com.pulumi.aws.globalaccelerator.kotlin.inputs.EndpointGroupEndpointConfigurationArgs
import com.pulumi.aws.globalaccelerator.kotlin.inputs.EndpointGroupEndpointConfigurationArgsBuilder
import com.pulumi.aws.globalaccelerator.kotlin.inputs.EndpointGroupPortOverrideArgs
import com.pulumi.aws.globalaccelerator.kotlin.inputs.EndpointGroupPortOverrideArgsBuilder
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.Double
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * Provides a Global Accelerator endpoint group.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 * const example = new aws.globalaccelerator.EndpointGroup("example", {
 *     listenerArn: exampleAwsGlobalacceleratorListener.id,
 *     endpointConfigurations: [{
 *         endpointId: exampleAwsLb.arn,
 *         weight: 100,
 *     }],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_aws as aws
 * example = aws.globalaccelerator.EndpointGroup("example",
 *     listener_arn=example_aws_globalaccelerator_listener["id"],
 *     endpoint_configurations=[{
 *         "endpoint_id": example_aws_lb["arn"],
 *         "weight": 100,
 *     }])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Aws = Pulumi.Aws;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Aws.GlobalAccelerator.EndpointGroup("example", new()
 *     {
 *         ListenerArn = exampleAwsGlobalacceleratorListener.Id,
 *         EndpointConfigurations = new[]
 *         {
 *             new Aws.GlobalAccelerator.Inputs.EndpointGroupEndpointConfigurationArgs
 *             {
 *                 EndpointId = exampleAwsLb.Arn,
 *                 Weight = 100,
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/globalaccelerator"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := globalaccelerator.NewEndpointGroup(ctx, "example", &globalaccelerator.EndpointGroupArgs{
 * 			ListenerArn: pulumi.Any(exampleAwsGlobalacceleratorListener.Id),
 * 			EndpointConfigurations: globalaccelerator.EndpointGroupEndpointConfigurationArray{
 * 				&globalaccelerator.EndpointGroupEndpointConfigurationArgs{
 * 					EndpointId: pulumi.Any(exampleAwsLb.Arn),
 * 					Weight:     pulumi.Int(100),
 * 				},
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.aws.globalaccelerator.EndpointGroup;
 * import com.pulumi.aws.globalaccelerator.EndpointGroupArgs;
 * import com.pulumi.aws.globalaccelerator.inputs.EndpointGroupEndpointConfigurationArgs;
 * import java.util.List;
 * import java.util.ArrayList;
 * import java.util.Map;
 * import java.io.File;
 * import java.nio.file.Files;
 * import java.nio.file.Paths;
 * public class App {
 *     public static void main(String[] args) {
 *         Pulumi.run(App::stack);
 *     }
 *     public static void stack(Context ctx) {
 *         var example = new EndpointGroup("example", EndpointGroupArgs.builder()
 *             .listenerArn(exampleAwsGlobalacceleratorListener.id())
 *             .endpointConfigurations(EndpointGroupEndpointConfigurationArgs.builder()
 *                 .endpointId(exampleAwsLb.arn())
 *                 .weight(100)
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: aws:globalaccelerator:EndpointGroup
 *     properties:
 *       listenerArn: ${exampleAwsGlobalacceleratorListener.id}
 *       endpointConfigurations:
 *         - endpointId: ${exampleAwsLb.arn}
 *           weight: 100
 * ```
 * 
 * ## Import
 * Using `pulumi import`, import Global Accelerator endpoint groups using the `id`. For example:
 * ```sh
 * $ pulumi import aws:globalaccelerator/endpointGroup:EndpointGroup example arn:aws:globalaccelerator::111111111111:accelerator/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/listener/xxxxxxx/endpoint-group/xxxxxxxx
 * ```
 * @property endpointConfigurations The list of endpoint objects. Fields documented below.
 * @property endpointGroupRegion The name of the AWS Region where the endpoint group is located.
 * @property healthCheckIntervalSeconds The time—10 seconds or 30 seconds—between each health check for an endpoint. The default value is 30.
 * @property healthCheckPath If the protocol is HTTP/S, then this specifies the path that is the destination for health check targets. The default value is slash (`/`). the provider will only perform drift detection of its value when present in a configuration.
 * @property healthCheckPort The port that AWS Global Accelerator uses to check the health of endpoints that are part of this endpoint group. The default port is the listener port that this endpoint group is associated with. If listener port is a list of ports, Global Accelerator uses the first port in the list.
 * the provider will only perform drift detection of its value when present in a configuration.
 * @property healthCheckProtocol The protocol that AWS Global Accelerator uses to check the health of endpoints that are part of this endpoint group. The default value is TCP.
 * @property listenerArn The Amazon Resource Name (ARN) of the listener.
 * @property portOverrides Override specific listener ports used to route traffic to endpoints that are part of this endpoint group. Fields documented below.
 * @property thresholdCount The number of consecutive health checks required to set the state of a healthy endpoint to unhealthy, or to set an unhealthy endpoint to healthy. The default value is 3.
 * @property trafficDialPercentage The percentage of traffic to send to an AWS Region. Additional traffic is distributed to other endpoint groups for this listener. The default value is 100.
 */
public data class EndpointGroupArgs(
    public val endpointConfigurations: Output>? = null,
    public val endpointGroupRegion: Output? = null,
    public val healthCheckIntervalSeconds: Output? = null,
    public val healthCheckPath: Output? = null,
    public val healthCheckPort: Output? = null,
    public val healthCheckProtocol: Output? = null,
    public val listenerArn: Output? = null,
    public val portOverrides: Output>? = null,
    public val thresholdCount: Output? = null,
    public val trafficDialPercentage: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.aws.globalaccelerator.EndpointGroupArgs =
        com.pulumi.aws.globalaccelerator.EndpointGroupArgs.builder()
            .endpointConfigurations(
                endpointConfigurations?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .endpointGroupRegion(endpointGroupRegion?.applyValue({ args0 -> args0 }))
            .healthCheckIntervalSeconds(healthCheckIntervalSeconds?.applyValue({ args0 -> args0 }))
            .healthCheckPath(healthCheckPath?.applyValue({ args0 -> args0 }))
            .healthCheckPort(healthCheckPort?.applyValue({ args0 -> args0 }))
            .healthCheckProtocol(healthCheckProtocol?.applyValue({ args0 -> args0 }))
            .listenerArn(listenerArn?.applyValue({ args0 -> args0 }))
            .portOverrides(
                portOverrides?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .thresholdCount(thresholdCount?.applyValue({ args0 -> args0 }))
            .trafficDialPercentage(trafficDialPercentage?.applyValue({ args0 -> args0 })).build()
}

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

    private var endpointGroupRegion: Output? = null

    private var healthCheckIntervalSeconds: Output? = null

    private var healthCheckPath: Output? = null

    private var healthCheckPort: Output? = null

    private var healthCheckProtocol: Output? = null

    private var listenerArn: Output? = null

    private var portOverrides: Output>? = null

    private var thresholdCount: Output? = null

    private var trafficDialPercentage: Output? = null

    /**
     * @param value The list of endpoint objects. Fields documented below.
     */
    @JvmName("qrviwbesquanokvt")
    public suspend fun endpointConfigurations(`value`: Output>) {
        this.endpointConfigurations = value
    }

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

    /**
     * @param values The list of endpoint objects. Fields documented below.
     */
    @JvmName("vhpnlbchavaqabmj")
    public suspend fun endpointConfigurations(values: List>) {
        this.endpointConfigurations = Output.all(values)
    }

    /**
     * @param value The name of the AWS Region where the endpoint group is located.
     */
    @JvmName("jmbapkvfsqnljsfy")
    public suspend fun endpointGroupRegion(`value`: Output) {
        this.endpointGroupRegion = value
    }

    /**
     * @param value The time—10 seconds or 30 seconds—between each health check for an endpoint. The default value is 30.
     */
    @JvmName("fyxqrpjtgdaouwhu")
    public suspend fun healthCheckIntervalSeconds(`value`: Output) {
        this.healthCheckIntervalSeconds = value
    }

    /**
     * @param value If the protocol is HTTP/S, then this specifies the path that is the destination for health check targets. The default value is slash (`/`). the provider will only perform drift detection of its value when present in a configuration.
     */
    @JvmName("irjruwugvsngibsw")
    public suspend fun healthCheckPath(`value`: Output) {
        this.healthCheckPath = value
    }

    /**
     * @param value The port that AWS Global Accelerator uses to check the health of endpoints that are part of this endpoint group. The default port is the listener port that this endpoint group is associated with. If listener port is a list of ports, Global Accelerator uses the first port in the list.
     * the provider will only perform drift detection of its value when present in a configuration.
     */
    @JvmName("xjrgidvunmexhljh")
    public suspend fun healthCheckPort(`value`: Output) {
        this.healthCheckPort = value
    }

    /**
     * @param value The protocol that AWS Global Accelerator uses to check the health of endpoints that are part of this endpoint group. The default value is TCP.
     */
    @JvmName("iihdvkhgvnwlgoyx")
    public suspend fun healthCheckProtocol(`value`: Output) {
        this.healthCheckProtocol = value
    }

    /**
     * @param value The Amazon Resource Name (ARN) of the listener.
     */
    @JvmName("ytdwycfglduquhpd")
    public suspend fun listenerArn(`value`: Output) {
        this.listenerArn = value
    }

    /**
     * @param value Override specific listener ports used to route traffic to endpoints that are part of this endpoint group. Fields documented below.
     */
    @JvmName("aexhpmgspcgkfeug")
    public suspend fun portOverrides(`value`: Output>) {
        this.portOverrides = value
    }

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

    /**
     * @param values Override specific listener ports used to route traffic to endpoints that are part of this endpoint group. Fields documented below.
     */
    @JvmName("gcqmqoishhnkaesn")
    public suspend fun portOverrides(values: List>) {
        this.portOverrides = Output.all(values)
    }

    /**
     * @param value The number of consecutive health checks required to set the state of a healthy endpoint to unhealthy, or to set an unhealthy endpoint to healthy. The default value is 3.
     */
    @JvmName("iyvhkqyinlmjuqcp")
    public suspend fun thresholdCount(`value`: Output) {
        this.thresholdCount = value
    }

    /**
     * @param value The percentage of traffic to send to an AWS Region. Additional traffic is distributed to other endpoint groups for this listener. The default value is 100.
     */
    @JvmName("uimibsqvtlseimia")
    public suspend fun trafficDialPercentage(`value`: Output) {
        this.trafficDialPercentage = value
    }

    /**
     * @param value The list of endpoint objects. Fields documented below.
     */
    @JvmName("uwwytgdllnfphnqn")
    public suspend fun endpointConfigurations(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.endpointConfigurations = mapped
    }

    /**
     * @param argument The list of endpoint objects. Fields documented below.
     */
    @JvmName("jbtattextyjkcdos")
    public suspend fun endpointConfigurations(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            EndpointGroupEndpointConfigurationArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.endpointConfigurations = mapped
    }

    /**
     * @param argument The list of endpoint objects. Fields documented below.
     */
    @JvmName("mgkctokwvrnhriyg")
    public suspend fun endpointConfigurations(vararg argument: suspend EndpointGroupEndpointConfigurationArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            EndpointGroupEndpointConfigurationArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.endpointConfigurations = mapped
    }

    /**
     * @param argument The list of endpoint objects. Fields documented below.
     */
    @JvmName("nwdlpurmfuiupubd")
    public suspend fun endpointConfigurations(argument: suspend EndpointGroupEndpointConfigurationArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            EndpointGroupEndpointConfigurationArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.endpointConfigurations = mapped
    }

    /**
     * @param values The list of endpoint objects. Fields documented below.
     */
    @JvmName("erwuloaeicbpvvor")
    public suspend fun endpointConfigurations(vararg values: EndpointGroupEndpointConfigurationArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.endpointConfigurations = mapped
    }

    /**
     * @param value The name of the AWS Region where the endpoint group is located.
     */
    @JvmName("ldaitiexhtiborkw")
    public suspend fun endpointGroupRegion(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.endpointGroupRegion = mapped
    }

    /**
     * @param value The time—10 seconds or 30 seconds—between each health check for an endpoint. The default value is 30.
     */
    @JvmName("icnawhirtdbyvsgp")
    public suspend fun healthCheckIntervalSeconds(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.healthCheckIntervalSeconds = mapped
    }

    /**
     * @param value If the protocol is HTTP/S, then this specifies the path that is the destination for health check targets. The default value is slash (`/`). the provider will only perform drift detection of its value when present in a configuration.
     */
    @JvmName("djqvybcdxkshrocc")
    public suspend fun healthCheckPath(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.healthCheckPath = mapped
    }

    /**
     * @param value The port that AWS Global Accelerator uses to check the health of endpoints that are part of this endpoint group. The default port is the listener port that this endpoint group is associated with. If listener port is a list of ports, Global Accelerator uses the first port in the list.
     * the provider will only perform drift detection of its value when present in a configuration.
     */
    @JvmName("rrxnsnauvvqxfdul")
    public suspend fun healthCheckPort(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.healthCheckPort = mapped
    }

    /**
     * @param value The protocol that AWS Global Accelerator uses to check the health of endpoints that are part of this endpoint group. The default value is TCP.
     */
    @JvmName("muhhjlkbdalmcbju")
    public suspend fun healthCheckProtocol(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.healthCheckProtocol = mapped
    }

    /**
     * @param value The Amazon Resource Name (ARN) of the listener.
     */
    @JvmName("yuynfqykwgyujyqr")
    public suspend fun listenerArn(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.listenerArn = mapped
    }

    /**
     * @param value Override specific listener ports used to route traffic to endpoints that are part of this endpoint group. Fields documented below.
     */
    @JvmName("oianmpnxobitwluy")
    public suspend fun portOverrides(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.portOverrides = mapped
    }

    /**
     * @param argument Override specific listener ports used to route traffic to endpoints that are part of this endpoint group. Fields documented below.
     */
    @JvmName("wxryrmmnqjlcvaec")
    public suspend fun portOverrides(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            EndpointGroupPortOverrideArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.portOverrides = mapped
    }

    /**
     * @param argument Override specific listener ports used to route traffic to endpoints that are part of this endpoint group. Fields documented below.
     */
    @JvmName("ybwscdkqoiqgfbom")
    public suspend fun portOverrides(vararg argument: suspend EndpointGroupPortOverrideArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            EndpointGroupPortOverrideArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.portOverrides = mapped
    }

    /**
     * @param argument Override specific listener ports used to route traffic to endpoints that are part of this endpoint group. Fields documented below.
     */
    @JvmName("qkvnfmgtvgwkrybt")
    public suspend fun portOverrides(argument: suspend EndpointGroupPortOverrideArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            EndpointGroupPortOverrideArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.portOverrides = mapped
    }

    /**
     * @param values Override specific listener ports used to route traffic to endpoints that are part of this endpoint group. Fields documented below.
     */
    @JvmName("qvbbqxfgefrjatgy")
    public suspend fun portOverrides(vararg values: EndpointGroupPortOverrideArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.portOverrides = mapped
    }

    /**
     * @param value The number of consecutive health checks required to set the state of a healthy endpoint to unhealthy, or to set an unhealthy endpoint to healthy. The default value is 3.
     */
    @JvmName("poghapyvyobmimmr")
    public suspend fun thresholdCount(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.thresholdCount = mapped
    }

    /**
     * @param value The percentage of traffic to send to an AWS Region. Additional traffic is distributed to other endpoint groups for this listener. The default value is 100.
     */
    @JvmName("cqxumrulxsicxdda")
    public suspend fun trafficDialPercentage(`value`: Double?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.trafficDialPercentage = mapped
    }

    internal fun build(): EndpointGroupArgs = EndpointGroupArgs(
        endpointConfigurations = endpointConfigurations,
        endpointGroupRegion = endpointGroupRegion,
        healthCheckIntervalSeconds = healthCheckIntervalSeconds,
        healthCheckPath = healthCheckPath,
        healthCheckPort = healthCheckPort,
        healthCheckProtocol = healthCheckProtocol,
        listenerArn = listenerArn,
        portOverrides = portOverrides,
        thresholdCount = thresholdCount,
        trafficDialPercentage = trafficDialPercentage,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy