{"action":"created","issue":{"url":"https://api.github.com/repos/pjodouin/ansible-lambda/issues/5","repository_url":"https://api.github.com/repos/pjodouin/ansible-lambda","labels_url":"https://api.github.com/repos/pjodouin/ansible-lambda/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/pjodouin/ansible-lambda/issues/5/comments","events_url":"https://api.github.com/repos/pjodouin/ansible-lambda/issues/5/events","html_url":"https://github.com/pjodouin/ansible-lambda/issues/5","id":136219597,"number":5,"title":"error trying to create 'PutBucketNotificationConfiguration'","user":{"login":"curras","id":4583309,"avatar_url":"https://avatars.githubusercontent.com/u/4583309?v=3","gravatar_id":"","url":"https://api.github.com/users/curras","html_url":"https://github.com/curras","followers_url":"https://api.github.com/users/curras/followers","following_url":"https://api.github.com/users/curras/following{/other_user}","gists_url":"https://api.github.com/users/curras/gists{/gist_id}","starred_url":"https://api.github.com/users/curras/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/curras/subscriptions","organizations_url":"https://api.github.com/users/curras/orgs","repos_url":"https://api.github.com/users/curras/repos","events_url":"https://api.github.com/users/curras/events{/privacy}","received_events_url":"https://api.github.com/users/curras/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-24T23:14:26Z","updated_at":"2016-02-25T02:09:57Z","closed_at":null,"body":"I've looked at your examples and code and I'm unable to diagnosis the issue. I'm not sure if this a documentation bug or if I'm missing something obvious. the lambda function is created and I get the following error when it tries to execute the notification configuration. \r\n\r\nerror: \"module_name\": \"lambda_s3_event\"}, \"msg\": \"Error creating s3_lambda_event: An error occurred (InvalidArgument) when calling the PutBucketNotificationConfiguration operation: Unable to validate the following destination configurations\"}\r\n\r\n```---\r\n- hosts: localhost\r\n  gather_facts: no\r\n  vars:\r\n    state: present\r\n  tasks:\r\n  - name: create function\r\n    lambda:\r\n      state: \"{{ state | default('present') }}\"\r\n      type: code\r\n      function_name: test\r\n      runtime: java8\r\n      code:\r\n        s3_bucket: {{ bucket }}\r\n\t\ts3_key: {{ s3Key }}\r\n      timeout: 3\r\n      handler: {{ lambda.handler }}\r\n      role: {{ lambda.role }}\r\n      publish: True\r\n      version: 4\r\n      source_arn: {{ source.arn }}\r\n  - name: display stuff\r\n    debug: var=results\r\n\r\n\r\n- hosts: localhost\r\n  gather_facts: no\r\n  vars:\r\n    state: present\r\n    bucket: {{ bucket }}\r\n  tasks:\r\n  - name: add s3 event notifications that trigger a lambda function\r\n    lambda_s3_event:\r\n      state: \"{{ state | default('present') }}\"\r\n      bucket: \"{{ bucket }}\"\r\n      lambda_function_configurations:\r\n      - id: test\r\n        lambda_function_arn: {{ lambda.function.arn }}\r\n        events: [ 's3:ObjectCreated:*' ]\r\n  - name: display stuff\r\n    debug: var=results```"},"comment":{"url":"https://api.github.com/repos/pjodouin/ansible-lambda/issues/comments/188563057","html_url":"https://github.com/pjodouin/ansible-lambda/issues/5#issuecomment-188563057","issue_url":"https://api.github.com/repos/pjodouin/ansible-lambda/issues/5","id":188563057,"user":{"login":"pjodouin","id":1208458,"avatar_url":"https://avatars.githubusercontent.com/u/1208458?v=3","gravatar_id":"","url":"https://api.github.com/users/pjodouin","html_url":"https://github.com/pjodouin","followers_url":"https://api.github.com/users/pjodouin/followers","following_url":"https://api.github.com/users/pjodouin/following{/other_user}","gists_url":"https://api.github.com/users/pjodouin/gists{/gist_id}","starred_url":"https://api.github.com/users/pjodouin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pjodouin/subscriptions","organizations_url":"https://api.github.com/users/pjodouin/orgs","repos_url":"https://api.github.com/users/pjodouin/repos","events_url":"https://api.github.com/users/pjodouin/events{/privacy}","received_events_url":"https://api.github.com/users/pjodouin/received_events","type":"User","site_admin":false},"created_at":"2016-02-25T02:09:57Z","updated_at":"2016-02-25T02:09:57Z","body":"I suspect lambda_function_arn is pointing to a version/alias that does not exist.  I tried applying an event using an invalid version and got the same error.  However, the AWS API and console are buggy with respect to lambda versions.  If you start with the console, you cannot specify an alias or version for your s3 bucket event.  And I've discovered a few other anomalies. I recommend not using an explicit version for now and just use $LATEST.  \r\n\r\nAlso, I noticed that you have \"version: 4\" in your lambda task--this will not work with that module but should with the idempotent one I am currently writing.\r\n\r\nHope this helps. "}}