I'm trying in a number of different ways to push my .zip to AWS Lambda. All of the methods I've tried (grunt, gulp, and cli) are throwing an error despite having copied my ARN straight from the IAM console.
I'm running the following in the CLI
aws lambda create-function --function-name myFunctionName --runtime nodejs4.3 --role="arn:aws:iam::848602986150:user/lambda" --handler index.handler --zip-file fileb://./path/to/my.zip
and receiving this error:
A client error (ValidationException) occurred when calling the CreateFunction operation: 1 validation error detected: Value 'arn:aws:iam::848602986150:user/lambda' at 'role' failed to satisfy constraint: Member must satisfy regular expression pattern: arn:aws:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+
Anyone know what I'm doing wrong?
You have to create and pass IAM Role
not IAM User
From the docs:
--role :
Services (AWS) resources. The Amazon Resource Name (ARN) of the IAM role that Lambda assumes when it executes your function to access any other Amazon Web
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With