Praveen Sivakumar
Praveen Sivakumar

Reputation: 27

AWS CLI: Eror parsing parameter

We are trying to create a listener rule with conditions-Host header in elastic load balancer by aws cli.

aws elbv2 create-rule 
--listener-arn arn:aws:elasticloadbalancing:ap-south-1:123456789:listener/app/testing-alb/6sdfgsgs5fg45s4fg5sd \
--conditions test.com \
--priority 5 \
--actions arn:aws:elasticloadbalancing:ap-south-1:123456789:targetgroup/tgtest-1/hsdjif444225 \
--region ap-south-1 \
--output json

However, we got a error like this,

Error parsing parameter '--conditions': Expected: '=', received: 'EOF' for input:
test.com
        ^

Upvotes: 0

Views: 332

Answers (1)

jellycsc
jellycsc

Reputation: 12349

If you want to do this inline, here is the correct syntax:

aws elbv2 create-rule \
--listener-arn arn:aws:elasticloadbalancing:ap-south-1:123456789:listener/app/testing-alb/6sdfgsgs5fg45s4fg5sd \
--conditions '[{"Field":"host-header","HostHeaderConfig":{"Values":["test.com"]}}]' \
--priority 5 \
--actions Type=forward,TargetGroupArn=arn:aws:elasticloadbalancing:ap-south-1:123456789:targetgroup/tgtest-1/hsdjif444225 \
--region ap-south-1 \
--output json

Upvotes: 1

Related Questions