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.
Idawscc.elasticloadbalancingv2.listeners

Fields

NameDatatypeDescription
listener_arnstring
mutual_authenticationobjectThe mutual authentication configuration information.
listener_attributesarrayThe listener attributes. Attributes that you do not modify retain their current values.
alpn_policyarray[TLS listener] The name of the Application-Layer Protocol Negotiation (ALPN) policy.
ssl_policystring&#91;HTTPS and TLS listeners&#93; The security policy that defines which protocols and ciphers are supported. For more information, see &#91;Security policies&#93;(https://docs.aws.amazon.com/elasticloadbalancing/latest/application/describe-ssl-policies.html) in the &#42;Application Load Balancers Guide&#42; and &#91;Security policies&#93;(https://docs.aws.amazon.com/elasticloadbalancing/latest/network/describe-ssl-policies.html) in the &#42;Network Load Balancers Guide&#42;.<br />&#91;HTTPS listeners&#93; Updating the security policy can result in interruptions if the load balancer is handling a high volume of traffic. To decrease the possibility of an interruption if your load balancer is handling a high volume of traffic, create an additional load balancer or request an LCU reservation.
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.<br />To create additional rules for an Application Load Balancer, use &#91;AWS::ElasticLoadBalancingV2::ListenerRule&#93;(https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancingv2-listenerrule.html).
portintegerThe port on which the load balancer is listening. You can't 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.<br />For an HTTPS listener, update requires some interruptions. For a TLS listener, update requires no interruption.<br />To create a certificate list for a secure listener, use &#91;AWS::ElasticLoadBalancingV2::ListenerCertificate&#93;(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&#95;UDP. You can’t specify the UDP or TCP&#95;UDP protocol if dual-stack mode is enabled. You can't specify a protocol for a Gateway Load Balancer.
regionstringAWS region.

For more information, see AWS::ElasticLoadBalancingV2::Listener.

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 properties from an individual listener.

SELECT
region,
listener_arn,
mutual_authentication,
listener_attributes,
alpn_policy,
ssl_policy,
load_balancer_arn,
default_actions,
port,
certificates,
protocol
FROM awscc.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 awscc.elasticloadbalancingv2.listeners (
LoadBalancerArn,
DefaultActions,
region
)
SELECT
'{{ LoadBalancerArn }}',
'{{ DefaultActions }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM awscc.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,
elasticloadbalancing:DescribeListenerAttributes

Create

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

Update

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

List

elasticloadbalancing:DescribeListeners

Delete

elasticloadbalancing:DeleteListener,
elasticloadbalancing:DescribeListeners