RuleConditionProperty Struct
Specifies a condition for a listener rule.
| Source | |
|---|---|
| Type last changed |
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: {
regexValues: ['regexValues'],
values: ['values'],
},
httpHeaderConfig: {
httpHeaderName: 'httpHeaderName',
regexValues: ['regexValues'],
values: ['values'],
},
httpRequestMethodConfig: {
values: ['values'],
},
pathPatternConfig: {
regexValues: ['regexValues'],
values: ['values'],
},
queryStringConfig: {
values: [{
key: 'key',
value: 'value',
}],
},
regexValues: ['regexValues'],
sourceIpConfig: {
ipAddressType: 'ipAddressType',
values: ['values'],
},
values: ['values'],
};
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_elasticloadbalancingv2 as elbv2
rule_condition_property = elbv2.CfnListenerRule.RuleConditionProperty(
field="field",
host_header_config=elbv2.CfnListenerRule.HostHeaderConfigProperty(
regex_values=["regexValues"],
values=["values"]
),
http_header_config=elbv2.CfnListenerRule.HttpHeaderConfigProperty(
http_header_name="httpHeaderName",
regex_values=["regexValues"],
values=["values"]
),
http_request_method_config=elbv2.CfnListenerRule.HttpRequestMethodConfigProperty(
values=["values"]
),
path_pattern_config=elbv2.CfnListenerRule.PathPatternConfigProperty(
regex_values=["regexValues"],
values=["values"]
),
query_string_config=elbv2.CfnListenerRule.QueryStringConfigProperty(
values=[elbv2.CfnListenerRule.QueryStringKeyValueProperty(
key="key",
value="value"
)]
),
regex_values=["regexValues"],
source_ip_config=elbv2.CfnListenerRule.SourceIpConfigProperty(
ip_address_type="ipAddressType",
values=["values"]
),
values=["values"]
)
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.elasticloadbalancingv2.*;
RuleConditionProperty ruleConditionProperty = RuleConditionProperty.builder()
.field("field")
.hostHeaderConfig(HostHeaderConfigProperty.builder()
.regexValues(List.of("regexValues"))
.values(List.of("values"))
.build())
.httpHeaderConfig(HttpHeaderConfigProperty.builder()
.httpHeaderName("httpHeaderName")
.regexValues(List.of("regexValues"))
.values(List.of("values"))
.build())
.httpRequestMethodConfig(HttpRequestMethodConfigProperty.builder()
.values(List.of("values"))
.build())
.pathPatternConfig(PathPatternConfigProperty.builder()
.regexValues(List.of("regexValues"))
.values(List.of("values"))
.build())
.queryStringConfig(QueryStringConfigProperty.builder()
.values(List.of(QueryStringKeyValueProperty.builder()
.key("key")
.value("value")
.build()))
.build())
.regexValues(List.of("regexValues"))
.sourceIpConfig(SourceIpConfigProperty.builder()
.ipAddressType("ipAddressType")
.values(List.of("values"))
.build())
.values(List.of("values"))
.build();
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.ElasticLoadBalancingV2;
var ruleConditionProperty = new RuleConditionProperty {
Field = "field",
HostHeaderConfig = new HostHeaderConfigProperty {
RegexValues = new [] { "regexValues" },
Values = new [] { "values" }
},
HttpHeaderConfig = new HttpHeaderConfigProperty {
HttpHeaderName = "httpHeaderName",
RegexValues = new [] { "regexValues" },
Values = new [] { "values" }
},
HttpRequestMethodConfig = new HttpRequestMethodConfigProperty {
Values = new [] { "values" }
},
PathPatternConfig = new PathPatternConfigProperty {
RegexValues = new [] { "regexValues" },
Values = new [] { "values" }
},
QueryStringConfig = new QueryStringConfigProperty {
Values = new [] { new QueryStringKeyValueProperty {
Key = "key",
Value = "value"
} }
},
RegexValues = new [] { "regexValues" },
SourceIpConfig = new SourceIpConfigProperty {
IpAddressType = "ipAddressType",
Values = new [] { "values" }
},
Values = new [] { "values" }
};
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
ruleConditionProperty := &RuleConditionProperty{
Field: jsii.String("field"),
HostHeaderConfig: &HostHeaderConfigProperty{
RegexValues: []*string{
jsii.String("regexValues"),
},
Values: []*string{
jsii.String("values"),
},
},
HttpHeaderConfig: &HttpHeaderConfigProperty{
HttpHeaderName: jsii.String("httpHeaderName"),
RegexValues: []*string{
jsii.String("regexValues"),
},
Values: []*string{
jsii.String("values"),
},
},
HttpRequestMethodConfig: &HttpRequestMethodConfigProperty{
Values: []*string{
jsii.String("values"),
},
},
PathPatternConfig: &PathPatternConfigProperty{
RegexValues: []*string{
jsii.String("regexValues"),
},
Values: []*string{
jsii.String("values"),
},
},
QueryStringConfig: &QueryStringConfigProperty{
Values: []interface{}{
&QueryStringKeyValueProperty{
Key: jsii.String("key"),
Value: jsii.String("value"),
},
},
},
RegexValues: []*string{
jsii.String("regexValues"),
},
SourceIpConfig: &SourceIpConfigProperty{
IpAddressType: jsii.String("ipAddressType"),
Values: []*string{
jsii.String("values"),
},
},
Values: []*string{
jsii.String("values"),
},
}
Properties
http-headerhttp-request-methodhost-headerpath-patternquery-stringsource-ip
hostHeaderConfigoptionalIResolvable | CfnListenerRule.host_header_configoptionaltyping.Union[IResolvable, HostHeaderConfigProperty]hostHeaderConfigoptionalIResolvableHostHeaderConfigoptionalIResolvableHostHeaderConfigoptionalinterface{} #Specify only when Field is host-header .
httpHeaderConfigoptionalIResolvable | CfnListenerRule.http_header_configoptionaltyping.Union[IResolvable, HttpHeaderConfigProperty]httpHeaderConfigoptionalIResolvableHttpHeaderConfigoptionalIResolvableHttpHeaderConfigoptionalinterface{} #Specify only when Field is http-header .
httpRequestMethodConfigoptionalIResolvable | CfnListenerRule.http_request_method_configoptionaltyping.Union[IResolvable, HttpRequestMethodConfigProperty]httpRequestMethodConfigoptionalIResolvableHttpRequestMethodConfigoptionalIResolvableHttpRequestMethodConfigoptionalinterface{} #Specify only when Field is http-request-method .
pathPatternConfigoptionalIResolvable | CfnListenerRule.path_pattern_configoptionaltyping.Union[IResolvable, PathPatternConfigProperty]pathPatternConfigoptionalIResolvablePathPatternConfigoptionalIResolvablePathPatternConfigoptionalinterface{} #Specify only when Field is path-pattern .
queryStringConfigoptionalIResolvable | CfnListenerRule.query_string_configoptionaltyping.Union[IResolvable, QueryStringConfigProperty]queryStringConfigoptionalIResolvableQueryStringConfigoptionalIResolvableQueryStringConfigoptionalinterface{} #Specify only when Field is query-string .
regexValuesoptionalstring[]regex_valuesoptionaltyping.List[str]regexValuesoptionalList<String>RegexValuesoptionalstring[]RegexValuesoptional*[]*string #The maximum length of each string is 128 characters. Specify only when Field is http-header , host-header , or path-pattern .
sourceIpConfigoptionalIResolvable | CfnListenerRule.source_ip_configoptionaltyping.Union[IResolvable, SourceIpConfigProperty]sourceIpConfigoptionalIResolvableSourceIpConfigoptionalIResolvableSourceIpConfigoptionalinterface{} #Specify only when Field is source-ip .
valuesoptionalstring[]valuesoptionaltyping.List[str]valuesoptionalList<String>Valuesoptionalstring[]Valuesoptional*[]*string #notes
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)