Skip to content
v2.278.0

IApplicationListener Interface ​

Properties to reference an existing listener.

Properties ​

connectionsConnectionsconnectionsConnectionsconnectionsConnectionsConnectionsConnectionsConnectionsConnections #
The network connections associated with this resource.
The environment this resource belongs to.
notes

For resources that are created and managed in a Stack (those created by creating new class instances like new Role(), new Bucket(), etc.), this is always the same as the environment of the stack they belong to.

For referenced resources (those obtained from referencing methods like Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be different than the stack they were imported into.

isApplicationListenerbooleanis_application_listenerboolisApplicationListenerBooleanIsApplicationListenerboolIsApplicationListener*bool #
Indicates that this is an ALB listener.

Will always return true, but is necessary to prevent accidental structural equality in TypeScript.

listenerArnstringlistener_arnstrlistenerArnStringListenerArnstringListenerArn*string #
ARN of the listener.
A reference to a Listener resource.
nodeNodenodeNodenodeNodeNodeNodeNodeNode #
The tree node.
stackStackstackStackstackStackStackStackStackStack #
The stack in which this resource is defined.

Methods ​

addAction(id: string, props: AddApplicationActionProps): voiddef add_action(self, id: str, props: AddApplicationActionProps) -> Nonepublic void addAction(String id, AddApplicationActionProps props)public void AddAction(string id, AddApplicationActionProps props)func AddAction(Id *string, Props AddApplicationActionProps) #
Perform the given action on incoming requests.
notes

This allows full control of the default action of the load balancer, including Action chaining, fixed responses and redirect responses. See the ListenerAction class for all options.

It's possible to add routing conditions to the Action added in this way.

It is not possible to add a default action to an imported IApplicationListener. In order to add actions to an imported IApplicationListener a priority must be provided.

addCertificates(id: string, certificates: IListenerCertificate[]): voiddef add_certificates(self, id: str, certificates: typing.List[IListenerCertificate]) -> Nonepublic void addCertificates(String id, List<IListenerCertificate> certificates)public void AddCertificates(string id, IListenerCertificate[] certificates)func AddCertificates(Id *string, Certificates *[]IListenerCertificate) #
Add one or more certificates to this listener.
addTargetGroups(id: string, props: AddApplicationTargetGroupsProps): voiddef add_target_groups(self, id: str, props: AddApplicationTargetGroupsProps) -> Nonepublic void addTargetGroups(String id, AddApplicationTargetGroupsProps props)public void AddTargetGroups(string id, AddApplicationTargetGroupsProps props)func AddTargetGroups(Id *string, Props AddApplicationTargetGroupsProps) #
Load balance incoming requests to the given target groups.

It's possible to add conditions to the TargetGroups added in this way. At least one TargetGroup must be added without conditions.

addTargets(id: string, props: AddApplicationTargetsProps): ApplicationTargetGroupdef add_targets(self, id: str, props: AddApplicationTargetsProps) -> ApplicationTargetGrouppublic ApplicationTargetGroup addTargets(String id, AddApplicationTargetsProps props)public ApplicationTargetGroup AddTargets(string id, AddApplicationTargetsProps props)func AddTargets(Id *string, Props AddApplicationTargetsProps) ApplicationTargetGroup #
Load balance incoming requests to the given load balancing targets.

This method implicitly creates an ApplicationTargetGroup for the targets involved.

It's possible to add conditions to the targets added in this way. At least one set of targets must be added without conditions.

returns

Returns: The newly created target group

applyRemovalPolicy(policy: RemovalPolicy): voiddef apply_removal_policy(self, policy: RemovalPolicy) -> Nonepublic void applyRemovalPolicy(RemovalPolicy policy)public void ApplyRemovalPolicy(RemovalPolicy policy)func ApplyRemovalPolicy(Policy RemovalPolicy) #
Apply the given removal policy to this resource.
notes

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

registerConnectable(connectable: IConnectable, portRange: Port): voiddef register_connectable(self, connectable: IConnectable, port_range: Port) -> Nonepublic void registerConnectable(IConnectable connectable, Port portRange)public void RegisterConnectable(IConnectable connectable, Port portRange)func RegisterConnectable(Connectable IConnectable, PortRange Port) #
Register that a connectable that has been added to this load balancer.

Don't call this directly. It is called by ApplicationTargetGroup.

with(...mixins: IMixin[]): IConstructdef with(self, mixins: IMixin) -> IConstructpublic IConstruct with(IMixin mixins)public IConstruct With(IMixin mixins)func With(Mixins IMixin) IConstruct #
Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited.

1 parameter · returns

Parameters

  • mixinsmixinsmixinsmixinsMixins — The mixins to apply.

Returns: This construct for chaining