CreateRule
In this article:
CreateRule#
Description#
Request to create a listener rule for the Elastic Load Balancer (ELB).
Request Parameters#
Actions.member.N — Actions that ELB applies to incoming requests.
Type: List of Action objects
Required: Yes
Conditions.member.N — Conditions that ELB applies to incoming requests.
Type: List of RuleCondition objects
Required: Yes
ListenerArn — The Amazon Resource Name (ARN) of the listener.
Type: String
Required: Yes
Priority — The rule priority.
Type: Integer
Required: Yes
Valid range: 1 to 50000
Response Elements#
Rules.member.N — Information about the listener rule.
Type: List of Rule objects
Examples#
c2-elb CreateRule ListenerArn "listener_arn" Actions.1.TargetGroupArn "tg_arn" Actions.1.Type forward Conditions.1.Field host-header Conditions.1.Values.1 example.com Priority 10
c2-elb CreateRule ListenerArn "listener_arn" Actions.1.Type fixed-response Actions.1.FixedResponseConfig.StatusCode 200 Actions.1.FixedResponseConfig.ContentType text/plain Actions.1.FixedResponseConfig.MessageBody "plain text in response" Conditions.1.Field host-header Conditions.1.Values.1 example.com Conditions.2.Field path-pattern Conditions.2.Values.1 "/api/v1" Priority 100