createTargetGroup

Creates a target group.

For more information, see the following:

This operation is idempotent, which means that it completes at most one time. If you attempt to create multiple target groups with the same settings, each call succeeds.

Samples

import aws.sdk.kotlin.services.elasticloadbalancingv2.model.ProtocolEnum

fun main() { 
   //sampleStart 
   // This example creates a target group that you can use to route traffic to targets using HTTP on port
// 80. This target group uses the default health check configuration.
val resp = elasticLoadBalancingV2Client.createTargetGroup {
    name = "my-targets"
    protocol = ProtocolEnum.fromValue("HTTP")
    port = 80
    vpcId = "vpc-3ac0fb5f"
} 
   //sampleEnd
}