PATH:
usr
/
local
/
jetapps
/
var
/
lib
/
aws
/
lib
/
python2.7
/
site-packages
/
awscli
/
examples
/
elbv2
**To create a rule using a path condition** This example creates a rule that forwards requests to the specified target group if the URL contains the specified pattern (for example, /img/*). Command:: aws elbv2 create-rule --listener-arn arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2 --priority 10 --conditions Field=path-pattern,Values='/img/*' --actions Type=forward,TargetGroupArn=arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067 Output:: { "Rules": [ { "Actions": [ { "Type": "forward", "TargetGroupArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067" } ], "IsDefault": false, "Conditions": [ { "Field": "path-pattern", "Values": [ "/img/*" ] } ], "Priority": "10", "RuleArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener-rule/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2/9683b2d02a6cabee" } ] } **To create a rule using a host condition** This example creates a rule that forwards requests to the specified target group if the hostname in the host header matches the specified hostname (for example, *.example.com). Command:: aws elbv2 create-rule --listener-arn arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2 --priority 5 --conditions Field=host-header,Values='*.example.com' --actions Type=forward,TargetGroupArn=arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067 Output:: { "Rules": [ { "Actions": [ { "Type": "forward", "TargetGroupArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067" } ], "IsDefault": false, "Conditions": [ { "Field": "host-header", "Values": [ "*.example.com" ] } ], "Priority": "5", "RuleArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener-rule/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2/db8b4ff9007785e9" } ] }
[-] modify-listener.rst
[edit]
[-] describe-listener-certificates.rst
[edit]
[-] create-target-group.rst
[edit]
[-] add-tags.rst
[edit]
[-] describe-target-group-attributes.rst
[edit]
[-] modify-load-balancer-attributes.rst
[edit]
[+]
..
[-] describe-rules.rst
[edit]
[-] delete-target-group.rst
[edit]
[-] describe-load-balancer-attributes.rst
[edit]
[-] delete-listener.rst
[edit]
[-] set-subnets.rst
[edit]
[-] set-security-groups.rst
[edit]
[-] add-listener-certificates.rst
[edit]
[-] modify-rule.rst
[edit]
[-] describe-target-groups.rst
[edit]
[-] modify-target-group-attributes.rst
[edit]
[-] describe-account-limits.rst
[edit]
[-] delete-rule.rst
[edit]
[-] delete-load-balancer.rst
[edit]
[-] register-targets.rst
[edit]
[-] describe-tags.rst
[edit]
[-] modify-target-group.rst
[edit]
[-] remove-tags.rst
[edit]
[-] describe-ssl-policies.rst
[edit]
[-] remove-listener-certificates.rst
[edit]
[-] create-rule.rst
[edit]
[-] deregister-targets.rst
[edit]
[-] set-ip-address-type.rst
[edit]
[-] create-listener.rst
[edit]
[-] describe-target-health.rst
[edit]
[-] describe-listeners.rst
[edit]
[-] set-rule-priorities.rst
[edit]
[-] describe-load-balancers.rst
[edit]
[-] create-load-balancer.rst
[edit]