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.
Idaws.vpclattice.listeners

Fields

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

Methods

NameAccessible byRequired Params
create_resourceINSERTDefaultAction, Protocol, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all listeners in a region.

SELECT
region,
arn,
default_action,
id,
name,
port,
protocol,
service_arn,
service_id,
service_identifier,
tags
FROM aws.vpclattice.listeners
WHERE region = 'us-east-1';

Gets all properties from an individual listener.

SELECT
region,
arn,
default_action,
id,
name,
port,
protocol,
service_arn,
service_id,
service_identifier,
tags
FROM aws.vpclattice.listeners
WHERE region = 'us-east-1' AND data__Identifier = '<Arn>';

INSERT example

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

/*+ create */
INSERT INTO aws.vpclattice.listeners (
DefaultAction,
Protocol,
region
)
SELECT
'{{ DefaultAction }}',
'{{ Protocol }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.vpclattice.listeners
WHERE data__Identifier = '<Arn>'
AND region = 'us-east-1';

Permissions

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

Create

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

Read

vpc-lattice:GetListener,
vpc-lattice:ListTagsForResource

Update

vpc-lattice:UpdateListener,
vpc-lattice:TagResource,
vpc-lattice:UntagResource,
vpc-lattice:GetListener,
vpc-lattice:ListTagsForResource

Delete

vpc-lattice:DeleteListener

List

vpc-lattice:ListListeners