Skip to main content

listeners

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

Overview

Namelisteners
TypeResource
DescriptionResource Type definition for AWS::GlobalAccelerator::Listener
Idawscc.globalaccelerator.listeners

Fields

NameDatatypeDescription
listener_arnstringThe Amazon Resource Name (ARN) of the listener.
accelerator_arnstringThe Amazon Resource Name (ARN) of the accelerator.
port_rangesarray
protocolstringThe protocol for the listener.
client_affinitystringClient affinity lets you direct all requests from a user to the same endpoint.
regionstringAWS region.

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

Methods

NameResourceAccessible byRequired Params
create_resourcelistenersINSERTAcceleratorArn, PortRanges, Protocol, 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,
accelerator_arn,
port_ranges,
protocol,
client_affinity
FROM awscc.globalaccelerator.listeners
WHERE
region = 'us-east-1' 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.globalaccelerator.listeners (
AcceleratorArn,
PortRanges,
Protocol,
region
)
SELECT
'{{ accelerator_arn }}',
'{{ port_ranges }}',
'{{ protocol }}',
'{{ 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.globalaccelerator.listeners
SET PatchDocument = string('{{ {
"PortRanges": port_ranges,
"Protocol": protocol,
"ClientAffinity": client_affinity
} | 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.globalaccelerator.listeners
WHERE
Identifier = '{{ listener_arn }}' AND
region = 'us-east-1'
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:

globalaccelerator:CreateListener,
globalaccelerator:DescribeListener,
globalaccelerator:DescribeAccelerator