{"action":"created","issue":{"url":"https://api.github.com/repos/Mashape/kong/issues/1005","repository_url":"https://api.github.com/repos/Mashape/kong","labels_url":"https://api.github.com/repos/Mashape/kong/issues/1005/labels{/name}","comments_url":"https://api.github.com/repos/Mashape/kong/issues/1005/comments","events_url":"https://api.github.com/repos/Mashape/kong/issues/1005/events","html_url":"https://github.com/Mashape/kong/issues/1005","id":134464115,"number":1005,"title":"AWS Lambda Integration","user":{"login":"sinzone","id":1213643,"avatar_url":"https://avatars.githubusercontent.com/u/1213643?v=3","gravatar_id":"","url":"https://api.github.com/users/sinzone","html_url":"https://github.com/sinzone","followers_url":"https://api.github.com/users/sinzone/followers","following_url":"https://api.github.com/users/sinzone/following{/other_user}","gists_url":"https://api.github.com/users/sinzone/gists{/gist_id}","starred_url":"https://api.github.com/users/sinzone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sinzone/subscriptions","organizations_url":"https://api.github.com/users/sinzone/orgs","repos_url":"https://api.github.com/users/sinzone/repos","events_url":"https://api.github.com/users/sinzone/events{/privacy}","received_events_url":"https://api.github.com/users/sinzone/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Mashape/kong/labels/area/plugins","name":"area/plugins","color":"d4c5f9"},{"url":"https://api.github.com/repos/Mashape/kong/labels/idea/integration","name":"idea/integration","color":"fef2c0"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2016-02-18T02:34:48Z","updated_at":"2016-05-04T21:39:43Z","closed_at":null,"body":"Support the ability to invoke a Lambda function from Kong."},"comment":{"url":"https://api.github.com/repos/Mashape/kong/issues/comments/217011990","html_url":"https://github.com/Mashape/kong/issues/1005#issuecomment-217011990","issue_url":"https://api.github.com/repos/Mashape/kong/issues/1005","id":217011990,"user":{"login":"timerickson","id":57726,"avatar_url":"https://avatars.githubusercontent.com/u/57726?v=3","gravatar_id":"","url":"https://api.github.com/users/timerickson","html_url":"https://github.com/timerickson","followers_url":"https://api.github.com/users/timerickson/followers","following_url":"https://api.github.com/users/timerickson/following{/other_user}","gists_url":"https://api.github.com/users/timerickson/gists{/gist_id}","starred_url":"https://api.github.com/users/timerickson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timerickson/subscriptions","organizations_url":"https://api.github.com/users/timerickson/orgs","repos_url":"https://api.github.com/users/timerickson/repos","events_url":"https://api.github.com/users/timerickson/events{/privacy}","received_events_url":"https://api.github.com/users/timerickson/received_events","type":"User","site_admin":false},"created_at":"2016-05-04T21:39:43Z","updated_at":"2016-05-04T21:39:43Z","body":"I would like to know the upstream_url in some context where a plugin's config values can be defaulted. E.g. I create an api foo-api with upstream_url aws-lambda://us-west-2/my-lambda-func and now I have to create a plugin for that api and define again the region and function name, among other things. Certainly the plugin doesn't need that upstream_url to make the call to the lambda, so long as those parameter values are in the plugin config. But if it has an upstream_url from which this data can be derived, then the plugin can be properly initialized by something like convention as opposed to (what should be superfluous) configuration.\r\n\r\nI thought the self_check might be a place for that. I originally tried the config value check functions, thinking it would be great to set the default function_name and aws_region values from a parsing of the elements of the upstream_url, as there are examples of setting conditional/sensible default values in those functions - just not from any information in the api.\r\n\r\nIt also seems natural that you should be able to access the api from the plugin, which is not really the plugin in general, but an instance of that plugin that is explicitly attached to that particular api.\r\n\r\nI don't think it should be made optional, however I don't like having a \"throwaway\" upstream_url, which is currently a required parameter for adding an api. The plugin needs this information, and so it needs to either be configured with it or be able to correctly and reliably infer that from somewhere else, and the upstream_url seems like an appropriate place for that.\r\n\r\nI feel like the lambda target should be expressed in the api definition, and the aws-lambda scheme seems like a relatively good way of expressing that."}}