interface RuleConditionProperty
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.ElasticLoadBalancingV2.CfnListenerRule.RuleConditionProperty |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awselasticloadbalancingv2#CfnListenerRule_RuleConditionProperty |
Java | software.amazon.awscdk.services.elasticloadbalancingv2.CfnListenerRule.RuleConditionProperty |
Python | aws_cdk.aws_elasticloadbalancingv2.CfnListenerRule.RuleConditionProperty |
TypeScript | aws-cdk-lib » aws_elasticloadbalancingv2 » CfnListenerRule » RuleConditionProperty |
Specifies a condition for a listener rule.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_elasticloadbalancingv2 as elbv2 } from 'aws-cdk-lib';
const ruleConditionProperty: elbv2.CfnListenerRule.RuleConditionProperty = {
field: 'field',
hostHeaderConfig: {
values: ['values'],
},
httpHeaderConfig: {
httpHeaderName: 'httpHeaderName',
values: ['values'],
},
httpRequestMethodConfig: {
values: ['values'],
},
pathPatternConfig: {
values: ['values'],
},
queryStringConfig: {
values: [{
key: 'key',
value: 'value',
}],
},
sourceIpConfig: {
values: ['values'],
},
values: ['values'],
};
Properties
Name | Type | Description |
---|---|---|
field? | string | The field in the HTTP request. The following are the possible values:. |
host | IResolvable | Host | Information for a host header condition. |
http | IResolvable | Http | Information for an HTTP header condition. |
http | IResolvable | Http | Information for an HTTP method condition. |
path | IResolvable | Path | Information for a path pattern condition. |
query | IResolvable | Query | Information for a query string condition. |
source | IResolvable | Source | Information for a source IP condition. |
values? | string[] | The condition value. |
field?
Type:
string
(optional)
The field in the HTTP request. The following are the possible values:.
http-header
http-request-method
host-header
path-pattern
query-string
source-ip
hostHeaderConfig?
Type:
IResolvable
|
Host
(optional)
Information for a host header condition.
Specify only when Field
is host-header
.
httpHeaderConfig?
Type:
IResolvable
|
Http
(optional)
Information for an HTTP header condition.
Specify only when Field
is http-header
.
httpRequestMethodConfig?
Type:
IResolvable
|
Http
(optional)
Information for an HTTP method condition.
Specify only when Field
is http-request-method
.
pathPatternConfig?
Type:
IResolvable
|
Path
(optional)
Information for a path pattern condition.
Specify only when Field
is path-pattern
.
queryStringConfig?
Type:
IResolvable
|
Query
(optional)
Information for a query string condition.
Specify only when Field
is query-string
.
sourceIpConfig?
Type:
IResolvable
|
Source
(optional)
Information for a source IP condition.
Specify only when Field
is source-ip
.
values?
Type:
string[]
(optional)
The condition value.
Specify only when Field
is host-header
or path-pattern
. Alternatively, to specify multiple host names or multiple path patterns, use HostHeaderConfig
or PathPatternConfig
.
If Field
is host-header
and you're not using HostHeaderConfig
, you can specify a single host name (for example, my.example.com). A host name is case insensitive, can be up to 128 characters in length, and can contain any of the following characters.
- A-Z, a-z, 0-9
- .
- (matches 0 or more characters)
- ? (matches exactly 1 character)
If Field
is path-pattern
and you're not using PathPatternConfig
, you can specify a single path pattern (for example, /img/*). A path pattern is case-sensitive, can be up to 128 characters in length, and can contain any of the following characters.
- A-Z, a-z, 0-9
- _ - . $ / ~ " ' @ : +
- & (using &)
- (matches 0 or more characters)
- ? (matches exactly 1 character)