Skip to main content

listeners

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

Overview

Namelisteners
TypeResource
DescriptionCreates a listener for a service. Before you start using your Amazon VPC Lattice service, you must add one or more listeners. A listener is a process that checks for connection requests to your services.
Idawscc.vpclattice.listeners

Fields

NameDatatypeDescription
arnstring
default_actionobject
idstring
namestring
portinteger
protocolstring
service_arnstring
service_idstring
service_identifierstring
tagsarray
regionstringAWS region.

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

Methods

NameResourceAccessible byRequired Params
create_resourcelistenersINSERTDefaultAction, 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,
arn,
default_action,
id,
name,
port,
protocol,
service_arn,
service_id,
service_identifier,
tags
FROM awscc.vpclattice.listeners
WHERE
region = '{{ region }}' AND
Identifier = '{{ arn }}';

INSERT example

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

/*+ create */
INSERT INTO awscc.vpclattice.listeners (
DefaultAction,
Protocol,
region
)
SELECT
'{{ default_action }}',
'{{ 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.vpclattice.listeners
SET PatchDocument = string('{{ {
"DefaultAction": default_action,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ arn }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.vpclattice.listeners
WHERE
Identifier = '{{ 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:

vpc-lattice:CreateListener,
vpc-lattice:TagResource,
vpc-lattice:GetListener,
vpc-lattice:ListTagsForResource