Reputation: 1691
When I tried to create the Lambda function from Command line in MAC machine with environment variable using
--environment Variables="{dbRegion=us-east-1,sourceFileLocation=https://s3.amazonaws.com/xxx-123/config.xlsx,clientID=123}"
I got the following error
Unknown options: --environment, Variables="{dbRegion=us-east-1,sourceFileLocation=https://s3.amazonaws.com/xxx-123/config.xlsx,clientID=123}"
But the same command is working in Linux environments.
My current AWS CLI version is aws-cli/1.11.13
Upvotes: 1
Views: 937
Reputation: 1578
Not Mac problem
Some times came this issue.
Run the similar command using python it is working
import os
os.system("<aws cli create lambda command>")
And also working with terminal with only one argument.
manivannan@manivannan-whirldatascience:~/aws lambda create-function --function-name <your function name> --runtime java8 --role <your role arn> --handler <handler name> --zip-file fileb://<your zip file> --environment Variables={Key1=Value1} --timeout 30 --memory-size 512
I am working with aws cli version
aws-cli/1.11.178 Python/3.5.2 Linux/4.4.0-101-generic botocore/1.7.36
Try after some time it will work
Upvotes: 0
Reputation: 81336
Your AWS CLI version is old. I don't remember when --environment
was added but I think it was early in the 1.14.x series.
The current version is 1.14.27.
Execute this command to update your system:
pip3 install awscli --upgrade --user
Upvotes: 1