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
[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 and Security policies in the Network Load Balancers Guide.[HTTPS listeners] 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_actionsarray
The 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.
portintegerThe port on which the load balancer is listening. You can't specify a port for a Gateway Load Balancer.
certificatesarray
The default SSL server certificate for a secure listener. You must provide exactly one certificate if the listener protocol is HTTPS or TLS.For an HTTPS listener, update requires some interruptions. For a TLS listener, update requires no interruption.
To create a certificate list for a secure listener, use AWS::ElasticLoadBalancingV2::ListenerCertificate.
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 can't specify a protocol for a Gateway Load Balancer.
regionstringAWS region.

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

Methods

NameResourceAccessible byRequired Params
create_resourcelistenersINSERTLoadBalancerArn, DefaultActions, region
delete_resourcelistenersDELETEIdentifier, region
update_resourcelistenersUPDATEIdentifier, PatchDocument, region
list_resourceslisteners_list_onlySELECTregion
get_resourcelistenersSELECTIdentifier, 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 = '{{ region }}' AND
Identifier = '{{ listener_arn }}';

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
'{{ load_balancer_arn }}',
'{{ default_actions }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

UPDATE example

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

/*+ update */
UPDATE awscc.elasticloadbalancingv2.listeners
SET PatchDocument = string('{{ {
"MutualAuthentication": mutual_authentication,
"ListenerAttributes": listener_attributes,
"AlpnPolicy": alpn_policy,
"SslPolicy": ssl_policy,
"DefaultActions": default_actions,
"Port": port,
"Certificates": certificates,
"Protocol": protocol
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ listener_arn }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.elasticloadbalancingv2.listeners
WHERE
Identifier = '{{ listener_arn }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

Additional Parameters

Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:

ParameterDescription
ClientToken
A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.
A client token is valid for 36 hours once used.
After that, a resource request with the same client token is treated as a new request.
If you do not specify a client token, one is generated for inclusion in the request.
RoleArn
The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.
If you do not specify a role, a temporary session is created using your AWS user credentials.
TypeVersionId
For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used.

Permissions

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

elasticloadbalancing:DescribeListeners,
elasticloadbalancing:DescribeListenerAttributes