I'm trying to create an AWS Lambda Layer using the AWS CLI on Ubuntu, like this:
aws lambda publish-layer-version \
--layer-name numpy --description "numpy Python 3.9" \
--zip-file fileb://./lambda/deps/numpy/python.zip \
--compatible-runtimes python3.9 \
--compatible-architectures "x86_64" --output text --query "LayerVersionArn"
But I'm getting this error:
Unknown options: --compatible-architectures, x86_64
I tried all sorts of combinations to no avail. Any ideas?
The root cause was that I had AWS CLI version "aws-cli/2.2.2" installed on my machine...
As soon as I updated to the latest (version aws-cli/2.4.16), it worked.
I hope this helps someone in the future.