listeners
Creates, updates, deletes or gets a listener
resource or lists listeners
in a region
Overview
Name | listeners |
Type | Resource |
Description | Creates 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. |
Id | aws.vpclattice.listeners |
Fields
Name | Datatype | Description |
---|---|---|
arn | string | |
default_action | object | |
id | string | |
name | string | |
port | integer | |
protocol | string | |
service_arn | string | |
service_id | string | |
service_identifier | string | |
tags | array | |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | DefaultAction, Protocol, 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 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
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.vpclattice.listeners (
DefaultAction,
Protocol,
region
)
SELECT
'{{ DefaultAction }}',
'{{ Protocol }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.vpclattice.listeners (
DefaultAction,
Name,
Port,
Protocol,
ServiceIdentifier,
Tags,
region
)
SELECT
'{{ DefaultAction }}',
'{{ Name }}',
'{{ Port }}',
'{{ Protocol }}',
'{{ ServiceIdentifier }}',
'{{ Tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: listener
props:
- name: DefaultAction
value:
Forward:
TargetGroups:
- TargetGroupIdentifier: '{{ TargetGroupIdentifier }}'
Weight: '{{ Weight }}'
FixedResponse:
StatusCode: '{{ StatusCode }}'
- name: Name
value: '{{ Name }}'
- name: Port
value: '{{ Port }}'
- name: Protocol
value: '{{ Protocol }}'
- name: ServiceIdentifier
value: '{{ ServiceIdentifier }}'
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
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