AWS::ElasticLoadBalancingV2::ListenerRule HostHeaderConfig - Amazon CloudFormation
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

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

AWS::ElasticLoadBalancingV2::ListenerRule HostHeaderConfig

Information about a host header condition.

Syntax

To declare this entity in your Amazon 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" } } ] } } }