Listeners for your VPC Lattice service
Before you start using your VPC Lattice service, you must add a listener. A listener is a process that checks for connection requests, using the protocol and port that you configure. The rules that you define for a listener determine how the service routes requests to its registered targets.
Contents
Listener configuration
Listeners support the following protocols and ports:
-
Protocols: HTTP, HTTPS, TLS
-
Ports: 1-65535
If the listener protocol is HTTPS, VPC Lattice will provision and manage a TLS certificate that is associated with the VPC Lattice generated FQDN. VPC Lattice supports TLS on HTTP/1.1 and HTTP/2. When you configure a service with an HTTPS listener, VPC Lattice will automatically determine the HTTP protocol using Application-Layer Protocol Negotiation (ALPN). If ALPN is absent, VPC Lattice defaults to HTTP/1.1. For more information, see HTTPS listeners.
VPC Lattice can listen on HTTP, HTTPS, HTTP/1.1, and HTTP/2 and communicate to targets in any of these protocols and versions. We do not require that the listener and target group protocols match. VPC Lattice manages the entire process of upgrading and downgrading between protocols and versions. For more information, see Protocol version.
You can create a TLS listener to ensure that your application decrypts the encrypted traffic instead of VPC Lattice. For more information, see TLS listeners.
VPC Lattice does not support WebSockets.
Create a listener
You can create listeners for your VPC Lattice service. When you create a listener, you must specify a name, a default action, and protocol. A listener comes with a default rule. You can also create additional rules for your listener.
To create a listener using the console
To create a listener using the AWS CLI
Use the create-listener and create-rule commands.
Update a listener
After you create a listener, you can replace the target group for the default action. You can also add a target group to the default action and assign weights to the target groups. You can't update the listener name, listener protocol, or listener port.
To update a listener using the console
Open the Amazon VPC console at https://console.aws.amazon.com/vpc/
. -
In the navigation pane, under VPC Lattice, choose Services.
-
Select the name of the service to open its details page.
-
On the Routing tab, choose Edit listener.
-
For Default action, you can update the target group or the weight as needed.
-
To add additional target groups, choose Add action and then choose a target group and specify its weight.
-
You can also add, edit, or delete listener rules. For more information, see Listener rules.
-
Review your updates, and choose Save changes.
To update the default action for a listener using the AWS CLI
Use the update-listener command.
Delete a listener
You can delete a listener at any time. When you delete a listener, all its rules are automatically deleted.
To delete a listener using the console
Open the Amazon VPC console at https://console.aws.amazon.com/vpc/
. -
In the navigation pane, under VPC Lattice, choose Services.
-
Select the name of the service to open its details page.
-
On the Routing tab, choose Delete listener.
-
When prompted for confirmation, enter
confirm
and then choose Delete.
To delete a listener using the AWS CLI
Use the delete-listener command.