跳至內容

elbv2 api for rules - need example for http-header condition type

0

Hi,

I am looking for a documented example for creating listener rule with the condition type of "http-header". The API for the conditions element only allows attributes for "Field" and "Values". However, the "http-header" condition type also requires providing the "HttpHeaderName". For eg: "cookie". Trying to specify that in various ways but getting errors.

Is there an example of specifying this via the CLI?

Appreciate the help.

Thanks

已提問 7 年前檢視次數 982 次

2 個答案
0

this is a relateively new feature..upgrade your aws cli to at least:
aws-cli/1.16.144

then e.g:
aws elbv2 create-rule --listener-arn <listener arn> --priority 90 --conditions '{"Field":"http-header","HttpHeaderConfig":{"HttpHeaderName":"Cache-control","Values":["no-cache"]}} ' --actions Type=forward,TargetGroupArn=<targetarn>

已回答 7 年前

0

Thanks. Upgrading the cli and using the example below works.

已回答 7 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。