Elastic Load Balancing
API Reference (API Version 2015-12-01)

ModifyListener

Modifies the specified properties of the specified listener.

Any properties that you do not specify retain their current values. However, changing the protocol from HTTPS to HTTP removes the security policy and SSL certificate properties. If you change the protocol from HTTP to HTTPS, you must add the security policy and server certificate.

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

Certificates.member.N

[HTTPS listeners] The default SSL server certificate. You must provide exactly one certificate. Set CertificateArn to the certificate ARN but do not set IsDefault.

To create a certificate list, use AddListenerCertificates.

Type: Array of Certificate objects

Required: No

DefaultActions.member.N

The actions for the default rule.

Type: Array of Action objects

Required: No

ListenerArn

The Amazon Resource Name (ARN) of the listener.

Type: String

Required: Yes

Port

The port for connections from clients to the load balancer.

Type: Integer

Valid Range: Minimum value of 1. Maximum value of 65535.

Required: No

Protocol

The protocol for connections from clients to the load balancer. Application Load Balancers support HTTP and HTTPS and Network Load Balancers support TCP.

Type: String

Valid Values: HTTP | HTTPS | TCP

Required: No

SslPolicy

[HTTPS listeners] The security policy that defines which protocols and ciphers are supported. For more information, see Security Policies in the Application Load Balancers Guide.

Type: String

Required: No

Response Elements

The following element is returned by the service.

Listeners.member.N

Information about the modified listener.

Type: Array of Listener objects

Errors

For information about the errors that are common to all actions, see Common Errors.

CertificateNotFound

The specified certificate does not exist.

HTTP Status Code: 400

DuplicateListener

A listener with the specified port already exists.

HTTP Status Code: 400

IncompatibleProtocols

The specified configuration is not valid with this protocol.

HTTP Status Code: 400

InvalidConfigurationRequest

The requested configuration is not valid.

HTTP Status Code: 400

InvalidLoadBalancerAction

The requested action is not valid.

HTTP Status Code: 400

ListenerNotFound

The specified listener does not exist.

HTTP Status Code: 400

SSLPolicyNotFound

The specified SSL policy does not exist.

HTTP Status Code: 400

TargetGroupAssociationLimit

You've reached the limit on the number of load balancers per target group.

HTTP Status Code: 400

TargetGroupNotFound

The specified target group does not exist.

HTTP Status Code: 400

TooManyActions

You've reached the limit on the number of actions per rule.

HTTP Status Code: 400

TooManyCertificates

You've reached the limit on the number of certificates per load balancer.

HTTP Status Code: 400

TooManyListeners

You've reached the limit on the number of listeners per load balancer.

HTTP Status Code: 400

TooManyRegistrationsForTargetId

You've reached the limit on the number of times a target can be registered with a load balancer.

HTTP Status Code: 400

TooManyTargets

You've reached the limit on the number of targets.

HTTP Status Code: 400

UnsupportedProtocol

The specified protocol is not supported.

HTTP Status Code: 400

Examples

Change the default action

This example changes the default action for the specified listener.

Sample Request

https://elasticloadbalancing.amazonaws.com/?Action=ModifyListener &ListenerArn=arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2 &DefaultActions.member.1.Type=forward &DefaultActions.member.1.TargetGroupArn=arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-new-targets/2453ed029918f21f &Version=2015-12-01 &AUTHPARAMS

Sample Response

<ModifyListenerResponse xmlns="http://elasticloadbalancing.amazonaws.com/doc/2015-12-01/"> <ModifyListenerResult> <Listeners> <member> <LoadBalancerArn>arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188</LoadBalancerArn> <Protocol>HTTP</Protocol> <Port>80</Port> <ListenerArn>arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2</ListenerArn> <DefaultActions> <member> <Type>forward</Type> <TargetGroupArn>arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-new-targets/2453ed029918f21f</TargetGroupArn> </member> </DefaultActions> </member> </Listeners> </ModifyListenerResult> <ResponseMetadata> <RequestId>9759b8df-f462-11e5-8a24-ffe2bf8623ae</RequestId> </ResponseMetadata> </ModifyListenerResponse>

Change the default certificate

This example changes the default certificate for the specified HTTPS listener.

Sample Request

https://elasticloadbalancing.amazonaws.com/?Action=ModifyListener &ListenerArn=arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/0467ef3c8400ae65 &Certificates.member.1.CertificateArn=arn:aws:iam::123456789012:server-certificate/my-new-server-cert &Version=2015-12-01 &AUTHPARAMS

Sample Response

<ModifyListenerResponse xmlns="http://elasticloadbalancing.amazonaws.com/doc/2015-12-01/"> <ModifyListenerResult> <Listeners> <member> <LoadBalancerArn>arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188</LoadBalancerArn> <Protocol>HTTPS</Protocol> <Certificates> <member> <CertificateArn>arn:aws:iam::123456789012:server-certificate/my-new-server-cert</CertificateArn> </member> </Certificates> <Port>443</Port> <SslPolicy>ELBSecurityPolicy-2016-08</SslPolicy> <ListenerArn>arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/0467ef3c8400ae65</ListenerArn> <DefaultActions> <member> <Type>forward</Type> <TargetGroupArn>arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067</TargetGroupArn> </member> </DefaultActions> </member> </Listeners> </ModifyListenerResult> <ResponseMetadata> <RequestId>3f72dcb2-f463-11e5-b95d-3b2c1831fc26</RequestId> </ResponseMetadata> </ModifyListenerResponse>

Change the security policy

This example changes the security policy for the specified HTTPS listener.

Sample Request

https://elasticloadbalancing.amazonaws.com/?Action=ModifyListener &ListenerArn=arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/0467ef3c8400ae65 &SslPolicy=ELBSecurityPolicy-2016-08 &Version=2015-12-01 &AUTHPARAMS

Sample Response

<ModifyListenerResponse xmlns="http://elasticloadbalancing.amazonaws.com/doc/2015-12-01/"> <ModifyListenerResult> <Listeners> <member> <LoadBalancerArn>arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188</LoadBalancerArn> <Protocol>HTTPS</Protocol> <Certificates> <member> <CertificateArn>arn:aws:iam::123456789012:server-certificate/my-server-cert</CertificateArn> </member> </Certificates> <Port>443</Port> <SslPolicy>ELBSecurityPolicy-2016-08</SslPolicy> <ListenerArn>arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/0467ef3c8400ae65</ListenerArn> <DefaultActions> <member> <Type>forward</Type> <TargetGroupArn>arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067</TargetGroupArn> </member> </DefaultActions> </member> </Listeners> </ModifyListenerResult> <ResponseMetadata> <RequestId>3f72dcb2-f463-11e5-b95d-3b2c1831fc26</RequestId> </ResponseMetadata> </ModifyListenerResponse>

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: