Skip to main content

listeners

Creates, updates, deletes or gets a listener resource or lists listeners in a region

Overview

Namelisteners
TypeResource
DescriptionSpecifies a listener for an Application Load Balancer, Network Load Balancer, or Gateway Load Balancer.
Idaws.elasticloadbalancingv2.listeners

Fields

NameDatatypeDescription
listener_arnstring
mutual_authenticationobjectThe mutual authentication configuration information.
alpn_policyarray[TLS listener] The name of the Application-Layer Protocol Negotiation (ALPN) policy.
ssl_policystring[HTTPS and TLS listeners] The security policy that defines which protocols and ciphers are supported.
Updating the security policy can result in interruptions if the load balancer is handling a high volume of traffic.
For more information, see [Security policies](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/create-https-listener.html#describe-ssl-policies) in the *Application Load Balancers Guide* and [Security policies](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/create-tls-listener.html#describe-ssl-policies) in the *Network Load Balancers Guide*.
load_balancer_arnstringThe Amazon Resource Name (ARN) of the load balancer.
default_actionsarrayThe actions for the default rule. You cannot define a condition for a default rule.
To create additional rules for an Application Load Balancer, use [AWS::ElasticLoadBalancingV2::ListenerRule](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancingv2-listenerrule.html).
portintegerThe port on which the load balancer is listening. You cannot specify a port for a Gateway Load Balancer.
certificatesarrayThe default SSL server certificate for a secure listener. You must provide exactly one certificate if the listener protocol is HTTPS or TLS.
To create a certificate list for a secure listener, use [AWS::ElasticLoadBalancingV2::ListenerCertificate](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancingv2-listenercertificate.html).
protocolstringThe protocol for connections from clients to the load balancer. For Application Load Balancers, the supported protocols are HTTP and HTTPS. For Network Load Balancers, the supported protocols are TCP, TLS, UDP, and TCP_UDP. You can’t specify the UDP or TCP_UDP protocol if dual-stack mode is enabled. You cannot specify a protocol for a Gateway Load Balancer.
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTLoadBalancerArn, DefaultActions, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all listeners in a region.

SELECT
region,
listener_arn,
mutual_authentication,
alpn_policy,
ssl_policy,
load_balancer_arn,
default_actions,
port,
certificates,
protocol
FROM aws.elasticloadbalancingv2.listeners
WHERE region = 'us-east-1';

Gets all properties from an individual listener.

SELECT
region,
listener_arn,
mutual_authentication,
alpn_policy,
ssl_policy,
load_balancer_arn,
default_actions,
port,
certificates,
protocol
FROM aws.elasticloadbalancingv2.listeners
WHERE region = 'us-east-1' AND data__Identifier = '<ListenerArn>';

INSERT example

Use the following StackQL query and manifest file to create a new listener resource, using stack-deploy.

/*+ create */
INSERT INTO aws.elasticloadbalancingv2.listeners (
LoadBalancerArn,
DefaultActions,
region
)
SELECT
'{{ LoadBalancerArn }}',
'{{ DefaultActions }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.elasticloadbalancingv2.listeners
WHERE data__Identifier = '<ListenerArn>'
AND region = 'us-east-1';

Permissions

To operate on the listeners resource, the following permissions are required:

Read

elasticloadbalancing:DescribeListeners

Create

elasticloadbalancing:CreateListener,
elasticloadbalancing:DescribeListeners,
cognito-idp:DescribeUserPoolClient

Update

elasticloadbalancing:ModifyListener,
elasticloadbalancing:DescribeListeners,
cognito-idp:DescribeUserPoolClient

List

elasticloadbalancing:DescribeListeners

Delete

elasticloadbalancing:DeleteListener,
elasticloadbalancing:DescribeListeners