Salta al contenuto

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

posta 7 anni fa979 visualizzazioni

2 Risposte
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>

con risposta 7 anni fa

0

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

con risposta 7 anni fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.