class ListenerCondition
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.ElasticLoadBalancingV2.ListenerCondition |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awselasticloadbalancingv2#ListenerCondition |
Java | software.amazon.awscdk.services.elasticloadbalancingv2.ListenerCondition |
Python | aws_cdk.aws_elasticloadbalancingv2.ListenerCondition |
TypeScript (source) | aws-cdk-lib » aws_elasticloadbalancingv2 » ListenerCondition |
ListenerCondition providers definition.
Example
declare const listener: elbv2.ApplicationListener;
declare const asg: autoscaling.AutoScalingGroup;
listener.addTargets('Example.Com Fleet', {
priority: 10,
conditions: [
elbv2.ListenerCondition.hostHeaders(['example.com']),
elbv2.ListenerCondition.pathPatterns(['/ok', '/path']),
],
port: 8080,
targets: [asg]
});
Initializer
new ListenerCondition()
Methods
Name | Description |
---|---|
render | Render the raw Cfn listener rule condition object. |
static host | Create a host-header listener rule condition. |
static http | Create a http-header listener rule condition. |
static http | Create a http-request-method listener rule condition. |
static path | Create a path-pattern listener rule condition. |
static query | Create a query-string listener rule condition. |
static source | Create a source-ip listener rule condition. |
RawCondition()
renderpublic renderRawCondition(): any
Returns
any
Render the raw Cfn listener rule condition object.
Headers(values)
static hostpublic static hostHeaders(values: string[]): ListenerCondition
Parameters
- values
string[]
— Hosts for host headers.
Returns
Create a host-header listener rule condition.
Header(name, values)
static httppublic static httpHeader(name: string, values: string[]): ListenerCondition
Parameters
- name
string
— HTTP header name. - values
string[]
— HTTP header values.
Returns
Create a http-header listener rule condition.
RequestMethods(values)
static httppublic static httpRequestMethods(values: string[]): ListenerCondition
Parameters
- values
string[]
— HTTP request methods.
Returns
Create a http-request-method listener rule condition.
Patterns(values)
static pathpublic static pathPatterns(values: string[]): ListenerCondition
Parameters
- values
string[]
— Path patterns.
Returns
Create a path-pattern listener rule condition.
Strings(values)
static querypublic static queryStrings(values: QueryStringCondition[]): ListenerCondition
Parameters
- values
Query
String Condition []
— Query string key/value pairs.
Returns
Create a query-string listener rule condition.
Ips(values)
static sourcepublic static sourceIps(values: string[]): ListenerCondition
Parameters
- values
string[]
— Source ips.
Returns
Create a source-ip listener rule condition.