跳至内容

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 年前985 查看次数

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 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。