modifyListener

Replaces the specified properties of the specified listener. Any properties that you do not specify remain unchanged.

Changing the protocol from HTTPS to HTTP, or from TLS to TCP, removes the security policy and default certificate properties. If you change the protocol from HTTP to HTTPS, or from TCP to TLS, you must add the security policy and default certificate properties.

To add an item to a list, remove an item from a list, or update an item in a list, you must provide the entire list. For example, to add an action, specify a list with the current actions plus the new action.

Samples

import aws.sdk.kotlin.services.elasticloadbalancingv2.model.Action
import aws.sdk.kotlin.services.elasticloadbalancingv2.model.ActionTypeEnum
import aws.sdk.kotlin.services.elasticloadbalancingv2.model.Certificate

fun main() { 
   //sampleStart 
   // This example changes the default action for the specified listener.
val resp = elasticLoadBalancingV2Client.modifyListener {
    listenerArn = "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2"
    defaultActions = listOf<Action>(
        Action {
            type = ActionTypeEnum.fromValue("forward")
            targetGroupArn = "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-new-targets/2453ed029918f21f"
        }            
    )
} 
   //sampleEnd
}
import aws.sdk.kotlin.services.elasticloadbalancingv2.model.Action
import aws.sdk.kotlin.services.elasticloadbalancingv2.model.ActionTypeEnum
import aws.sdk.kotlin.services.elasticloadbalancingv2.model.Certificate

fun main() { 
   //sampleStart 
   // This example changes the server certificate for the specified HTTPS listener.
val resp = elasticLoadBalancingV2Client.modifyListener {
    listenerArn = "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/0467ef3c8400ae65"
    certificates = listOf<Certificate>(
        Certificate {
            certificateArn = "arn:aws:iam::123456789012:server-certificate/my-new-server-cert"
        }            
    )
} 
   //sampleEnd
}