interface IApplicationListener
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.ElasticLoadBalancingV2.IApplicationListener |
Java | software.amazon.awscdk.services.elasticloadbalancingv2.IApplicationListener |
Python | aws_cdk.aws_elasticloadbalancingv2.IApplicationListener |
TypeScript (source) | @aws-cdk/aws-elasticloadbalancingv2 » IApplicationListener |
Implemented by
Application
Obtainable from
Application
.fromApplicationListenerAttributes()
, Application
.fromLookup()
Properties to reference an existing listener.
Properties
Name | Type | Description |
---|---|---|
connections | Connections | The network connections associated with this resource. |
env | Resource | The environment this resource belongs to. |
listener | string | ARN of the listener. |
node | Construct | The construct tree node for this construct. |
stack | Stack | The stack in which this resource is defined. |
connections
Type:
Connections
The network connections associated with this resource.
env
Type:
Resource
The environment this resource belongs to.
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
listenerArn
Type:
string
ARN of the listener.
node
Type:
Construct
The construct tree node for this construct.
stack
Type:
Stack
The stack in which this resource is defined.
Methods
Name | Description |
---|---|
add | Perform the given action on incoming requests. |
add | Add one or more certificates to this listener. |
add | Add one or more certificates to this listener. |
add | Load balance incoming requests to the given target groups. |
add | Load balance incoming requests to the given load balancing targets. |
apply | Apply the given removal policy to this resource. |
register | Register that a connectable that has been added to this load balancer. |
Action(id, props)
addpublic addAction(id: string, props: AddApplicationActionProps): void
Parameters
- id
string
- props
Add
Application Action Props
Perform the given action on incoming requests.
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.
CertificateArns(id, arns)
addpublic addCertificateArns(id: string, arns: string[]): void
⚠️ Deprecated: use addCertificates()
Parameters
- id
string
- arns
string[]
Add one or more certificates to this listener.
Certificates(id, certificates)
addpublic addCertificates(id: string, certificates: IListenerCertificate[]): void
Parameters
- id
string
- certificates
IListener
Certificate []
Add one or more certificates to this listener.
TargetGroups(id, props)
addpublic addTargetGroups(id: string, props: AddApplicationTargetGroupsProps): void
Parameters
- id
string
- props
Add
Application Target Groups Props
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.
Targets(id, props)
addpublic addTargets(id: string, props: AddApplicationTargetsProps): ApplicationTargetGroup
Parameters
- id
string
- props
Add
Application Targets Props
Returns
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.
RemovalPolicy(policy)
applypublic applyRemovalPolicy(policy: RemovalPolicy): void
Parameters
- policy
Removal
Policy
Apply the given removal policy to this resource.
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
).
Connectable(connectable, portRange)
registerpublic registerConnectable(connectable: IConnectable, portRange: Port): void
Parameters
- 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.