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.
Request Parameters
For information about the parameters that are common to all actions, see Common Parameters.
- AlpnPolicy.member.N
-
[TLS listeners] The name of the Application-Layer Protocol Negotiation (ALPN) policy. You can specify one policy name. The following are the possible values:
-
HTTP1Only
-
HTTP2Only
-
HTTP2Optional
-
HTTP2Preferred
-
None
For more information, see ALPN policies in the Network Load Balancers Guide.
Type: Array of strings
Required: No
-
- Certificates.member.N
-
[HTTPS and TLS listeners] The default certificate for the listener. You must provide exactly one certificate. Set
CertificateArn
to the certificate ARN but do not setIsDefault
.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
- MutualAuthentication
-
The mutual authentication configuration information.
Type: MutualAuthenticationAttributes object
Required: No
- Port
-
The port for connections from clients to the load balancer. You cannot specify a port for a Gateway 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 the HTTP and HTTPS protocols. Network Load Balancers support the TCP, TLS, UDP, and TCP_UDP protocols. You can’t change the protocol to UDP or TCP_UDP if dual-stack mode is enabled. You cannot specify a protocol for a Gateway Load Balancer.
Type: String
Valid Values:
HTTP | HTTPS | TCP | TLS | UDP | TCP_UDP | GENEVE
Required: No
- SslPolicy
-
[HTTPS and TLS listeners] The security policy that defines which protocols and ciphers are supported.
For more information, see Security policies in the Application Load Balancers Guide or Security policies in the Network 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.
- ALPNPolicyNotFound
-
The specified ALPN policy is not supported.
HTTP Status Code: 400
- 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
- TooManyUniqueTargetGroupsPerLoadBalancer
-
You've reached the limit on the number of unique target groups per load balancer across all listeners. If a target group is used by multiple actions for a load balancer, it is counted as only one use.
HTTP Status Code: 400
- TrustStoreNotFound
-
The specified trust store does not exist.
HTTP Status Code: 400
- TrustStoreNotReady
-
The specified trust store is not active.
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 Amazon SDKs, see the following: