listeners
Creates, updates, deletes or gets a listener resource or lists listeners in a region
Overview
| Name | listeners |
| Type | Resource |
| Description | Specifies a listener for an Application Load Balancer, Network Load Balancer, or Gateway Load Balancer. |
| Id | awscc.elasticloadbalancingv2.listeners |
Fields
| Name | Datatype | Description |
|---|---|---|
listener_arn | string | |
mutual_authentication | object | The mutual authentication configuration information. |
listener_attributes | array | The listener attributes. Attributes that you do not modify retain their current values. |
alpn_policy | array | [TLS listener] The name of the Application-Layer Protocol Negotiation (ALPN) policy. |
ssl_policy | string | [HTTPS and TLS listeners] The security policy that defines which protocols and ciphers are supported. For more information, see [Security policies](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/describe-ssl-policies.html) in the *Application Load Balancers Guide* and [Security policies](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/describe-ssl-policies.html) in the *Network Load Balancers Guide*.<br />[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_arn | string | The Amazon Resource Name (ARN) of the load balancer. |
default_actions | array | The 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 [AWS::ElasticLoadBalancingV2::ListenerRule](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancingv2-listenerrule.html). |
port | integer | The port on which the load balancer is listening. You can't specify a port for a Gateway Load Balancer. |
certificates | array | The 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 [AWS::ElasticLoadBalancingV2::ListenerCertificate](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancingv2-listenercertificate.html). |
protocol | string | The 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. |
region | string | AWS region. |
For more information, see AWS::ElasticLoadBalancingV2::Listener.
Methods
| Name | Accessible by | Required Params |
|---|---|---|
create_resource | INSERT | LoadBalancerArn, DefaultActions, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__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.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.elasticloadbalancingv2.listeners (
LoadBalancerArn,
DefaultActions,
region
)
SELECT
'{{ LoadBalancerArn }}',
'{{ DefaultActions }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.elasticloadbalancingv2.listeners (
MutualAuthentication,
ListenerAttributes,
AlpnPolicy,
SslPolicy,
LoadBalancerArn,
DefaultActions,
Port,
Certificates,
Protocol,
region
)
SELECT
'{{ MutualAuthentication }}',
'{{ ListenerAttributes }}',
'{{ AlpnPolicy }}',
'{{ SslPolicy }}',
'{{ LoadBalancerArn }}',
'{{ DefaultActions }}',
'{{ Port }}',
'{{ Certificates }}',
'{{ Protocol }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: listener
props:
- name: MutualAuthentication
value:
IgnoreClientCertificateExpiry: '{{ IgnoreClientCertificateExpiry }}'
Mode: '{{ Mode }}'
TrustStoreArn: '{{ TrustStoreArn }}'
AdvertiseTrustStoreCaNames: '{{ AdvertiseTrustStoreCaNames }}'
- name: ListenerAttributes
value:
- Value: '{{ Value }}'
Key: '{{ Key }}'
- name: AlpnPolicy
value:
- '{{ AlpnPolicy[0] }}'
- name: SslPolicy
value: '{{ SslPolicy }}'
- name: LoadBalancerArn
value: '{{ LoadBalancerArn }}'
- name: DefaultActions
value:
- Order: '{{ Order }}'
TargetGroupArn: '{{ TargetGroupArn }}'
FixedResponseConfig:
ContentType: '{{ ContentType }}'
StatusCode: '{{ StatusCode }}'
MessageBody: '{{ MessageBody }}'
AuthenticateCognitoConfig:
OnUnauthenticatedRequest: '{{ OnUnauthenticatedRequest }}'
UserPoolClientId: '{{ UserPoolClientId }}'
UserPoolDomain: '{{ UserPoolDomain }}'
SessionTimeout: '{{ SessionTimeout }}'
Scope: '{{ Scope }}'
SessionCookieName: '{{ SessionCookieName }}'
UserPoolArn: '{{ UserPoolArn }}'
AuthenticationRequestExtraParams: {}
Type: '{{ Type }}'
RedirectConfig:
Path: '{{ Path }}'
Query: '{{ Query }}'
Port: '{{ Port }}'
Host: '{{ Host }}'
Protocol: '{{ Protocol }}'
StatusCode: '{{ StatusCode }}'
ForwardConfig:
TargetGroupStickinessConfig:
Enabled: '{{ Enabled }}'
DurationSeconds: '{{ DurationSeconds }}'
TargetGroups:
- TargetGroupArn: '{{ TargetGroupArn }}'
Weight: '{{ Weight }}'
AuthenticateOidcConfig:
OnUnauthenticatedRequest: '{{ OnUnauthenticatedRequest }}'
TokenEndpoint: '{{ TokenEndpoint }}'
UseExistingClientSecret: '{{ UseExistingClientSecret }}'
SessionTimeout: '{{ SessionTimeout }}'
Scope: '{{ Scope }}'
Issuer: '{{ Issuer }}'
ClientSecret: '{{ ClientSecret }}'
UserInfoEndpoint: '{{ UserInfoEndpoint }}'
ClientId: '{{ ClientId }}'
AuthorizationEndpoint: '{{ AuthorizationEndpoint }}'
SessionCookieName: '{{ SessionCookieName }}'
AuthenticationRequestExtraParams: {}
- name: Port
value: '{{ Port }}'
- name: Certificates
value:
- CertificateArn: '{{ CertificateArn }}'
- name: Protocol
value: '{{ Protocol }}'
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