AWS::ElasticLoadBalancingV2::ListenerRule HostHeaderConfig - AWS CloudFormation

This is the new AWS CloudFormation Template Reference Guide. Please update your bookmarks and links. For help getting started with CloudFormation, see the AWS CloudFormation User Guide.

AWS::ElasticLoadBalancingV2::ListenerRule HostHeaderConfig

Information about a host header condition.

Syntax

To declare this entity in your AWS CloudFormation template, use the following syntax:

JSON

{ "Values" : [ String, ... ] }

YAML

Values: - String

Properties

Values

The host names. The maximum size of each name is 128 characters. The comparison is case insensitive. The following wildcard characters are supported: * (matches 0 or more characters) and ? (matches exactly 1 character). You must include at least one "." character. You can include only alphabetical characters after the final "." character.

If you specify multiple strings, the condition is satisfied if one of the strings matches the host name.

Required: No

Type: Array of String

Update requires: No interruption

Examples

This example creates a listener rule with an action that forwards requests destined for the specified domain and subdomain to the specified target group.

YAML

myHostHeaderListenerRule: Type: 'AWS::ElasticLoadBalancingV2::ListenerRule' Properties: ListenerArn: !Ref myListener Priority: 10 Conditions: - Field: host-header Values: - example.com - www.example.com Actions: - Type: forward TargetGroupArn: !Ref myTargetGroup

JSON

{ "myHostHeaderListenerRule": { "Type": "AWS::ElasticLoadBalancingV2::ListenerRule", "Properties": { "ListenerArn": { "Ref": "myListener" }, "Priority": 10, "Conditions": [ { "Field": "host-header", "Values": [ "example.com", "www.example.com" ] } ], "Actions": [ { "Type": "forward", "TargetGroupArn": { "Ref": "myTargetGroup" } } ] } } }