{"action":"created","issue":{"url":"https://api.github.com/repos/ar90n/serverless-s3-local/issues/21","repository_url":"https://api.github.com/repos/ar90n/serverless-s3-local","labels_url":"https://api.github.com/repos/ar90n/serverless-s3-local/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/ar90n/serverless-s3-local/issues/21/comments","events_url":"https://api.github.com/repos/ar90n/serverless-s3-local/issues/21/events","html_url":"https://github.com/ar90n/serverless-s3-local/issues/21","id":307168549,"number":21,"title":"Using custom bucket configuration, the event handler doesn't match the bucket name","user":{"login":"mbudm","id":2467577,"avatar_url":"https://avatars0.githubusercontent.com/u/2467577?v=4","gravatar_id":"","url":"https://api.github.com/users/mbudm","html_url":"https://github.com/mbudm","followers_url":"https://api.github.com/users/mbudm/followers","following_url":"https://api.github.com/users/mbudm/following{/other_user}","gists_url":"https://api.github.com/users/mbudm/gists{/gist_id}","starred_url":"https://api.github.com/users/mbudm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbudm/subscriptions","organizations_url":"https://api.github.com/users/mbudm/orgs","repos_url":"https://api.github.com/users/mbudm/repos","events_url":"https://api.github.com/users/mbudm/events{/privacy}","received_events_url":"https://api.github.com/users/mbudm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-03-21T09:23:13Z","updated_at":"2018-03-23T00:35:02Z","closed_at":null,"author_association":"NONE","body":"Hi - me again. I  might be able to workaround this one by having a simpler config but it may be worth looking into.\r\n\r\nWith s3 events you can either have the bucket created by the event config for the triggered lambda or you can use [custom bucket configuration](https://serverless.com/framework/docs/providers/aws/events/s3#custom-bucket-configuration).\r\n\r\nI'm using the latter, like this.\r\n\r\n```yml\r\nfunctions:\r\n  uploaded:\r\n    handler: fotos/uploaded.uploadedItem\r\n    events:\r\n      - s3: fotos\r\n```\r\n\r\nThen I add my custom bucket config in the resources section, changing the name to something a bit more realistic for an s3 bucket name (fotopia-web-app-prod):\r\n\r\n```\r\n    S3BucketFotos:\r\n      Type: AWS::S3::Bucket\r\n      DeletionPolicy: Delete\r\n      Properties:\r\n        BucketName: ${self:provider.environment.S3_BUCKET}\r\n        AccessControl: PublicRead\r\n```\r\n\r\nMy lambda wasnt firing when I PUT images into the bucket so I added some logging into ```serverless-s3-local``` like so:\r\n\r\n![screen shot 2018-03-21 at 8 20 22 pm](https://user-images.githubusercontent.com/2467577/37702033-56e7ab28-2d45-11e8-94c7-a0d170b659fc.png)\r\n\r\nWhich revealed the problem - the event handler has the short (alias?) bucket name:\r\n\r\n![screen shot 2018-03-21 at 8 10 15 pm](https://user-images.githubusercontent.com/2467577/37702072-7bcf2024-2d45-11e8-89ae-c7d194e2f5e8.png)\r\n\r\nI'll have a dig around perhaps theres a way via the sls plugin API to get the connection between the shorthand name and the longer name specified in resources.\r\n"},"comment":{"url":"https://api.github.com/repos/ar90n/serverless-s3-local/issues/comments/375501876","html_url":"https://github.com/ar90n/serverless-s3-local/issues/21#issuecomment-375501876","issue_url":"https://api.github.com/repos/ar90n/serverless-s3-local/issues/21","id":375501876,"user":{"login":"ar90n","id":2285892,"avatar_url":"https://avatars0.githubusercontent.com/u/2285892?v=4","gravatar_id":"","url":"https://api.github.com/users/ar90n","html_url":"https://github.com/ar90n","followers_url":"https://api.github.com/users/ar90n/followers","following_url":"https://api.github.com/users/ar90n/following{/other_user}","gists_url":"https://api.github.com/users/ar90n/gists{/gist_id}","starred_url":"https://api.github.com/users/ar90n/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ar90n/subscriptions","organizations_url":"https://api.github.com/users/ar90n/orgs","repos_url":"https://api.github.com/users/ar90n/repos","events_url":"https://api.github.com/users/ar90n/events{/privacy}","received_events_url":"https://api.github.com/users/ar90n/received_events","type":"User","site_admin":false},"created_at":"2018-03-23T00:35:02Z","updated_at":"2018-03-23T00:35:02Z","author_association":"OWNER","body":"@mbudm \r\nI'm so sorry. \r\nI fixed the status of my comment.\r\nPlease check it."}}
{"actor":{"display_login":"ar90n"}}