AWS Fundamentals Logo
AWS Fundamentals
L1 ConstructAWS::VpcLattice::Listener

CfnListener

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. For more information, see [Listeners](https://docs.aws.amazon.com/vpc-lattice/latest/ug/listeners.html) in the *Amazon VPC Lattice User Guide* .

Import

import { CfnListener } from 'aws-cdk-lib/aws-vpclattice';

Or use the module namespace:

import * as vpclattice from 'aws-cdk-lib/aws-vpclattice';
// vpclattice.CfnListener

Properties

Configuration passed to the constructor as CfnListenerProps.

defaultActionRequired
IResolvable | DefaultActionProperty

The action for the default rule. Each listener has a default rule. The default rule is used if no other rules match.

protocolRequired
string

The listener protocol.

nameOptional
string

The name of the listener. A listener name must be unique within a service. The valid characters are a-z, 0-9, and hyphens (-). You can't use a hyphen as the first or last character, or immediately after another hyphen. If you don't specify a name, CloudFormation generates one. However, if you specify a name, and later want to replace the resource, you must specify a new name.

portOptional
number

The listener port. You can specify a value from 1 to 65535. For HTTP, the default is 80. For HTTPS, the default is 443.

serviceIdentifierOptional
string

The ID or ARN of the service.

tagsOptional
CfnTag[]

The tags for the listener.

CloudFormation Resource

This L1 construct maps directly to the following CloudFormation resource type.

Learn AWS the Practical Way

Our bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.

Subscribe to Newsletter