I'm trying to use CLI, and Ansible to deploy a CloudFront instance with attached Lambda / Lambda@Edge functions. But I'm running into the following error:
Lambda@Edge cannot enable replication for the specified Lambda function. Update the IAM policy to add permission: lambda:EnableReplication* for resource: arn:aws:lambda:us-east-1:ACCOUNTNUMBER:function:FUNCTIONNAME:1 and try again.
The documentation does say that I need lambda:EnableReplication*
, but when I try to add the permissions to the lambda function via this command:
aws lambda add-permission --function-name FUNCITONNAME:1 --action "lambda:EnableReplication*" --statement-id something --principal "*" --output text
I get the following error:
An error occurred (ValidationException) when calling the AddPermission operation: 1 validation error detected: Value 'lambda:EnableReplication*' at 'action' failed to satisfy constraint: Member must satisfy regular expression pattern: (lambda:[*]|lambda:[a-zA-Z]+|[*])
How am I suppose to add these permissions do that this can be successful, what am I doing wrong here?