Splatting args into the AWS cli results in "unknown options"

26 views Asked by At

I'm getting the error unknown options from this:

$test = "s3",  "ls",  "s3://mybucket", '--region us-east-2'
aws @test

Unknown options: --region us-east-2

1

There are 1 answers

0
Fredrick On BEST ANSWER

The problem is the argument with a value needs to be broken up:
'--region us-east-2' to '--region', 'us-east-2'

$test = "s3",  "ls",  "s3://mybucket", '--region', 'us-east-2'
aws @test