{"action":"created","issue":{"url":"https://api.github.com/repos/awslabs/aws-sam-cli/issues/291","repository_url":"https://api.github.com/repos/awslabs/aws-sam-cli","labels_url":"https://api.github.com/repos/awslabs/aws-sam-cli/issues/291/labels{/name}","comments_url":"https://api.github.com/repos/awslabs/aws-sam-cli/issues/291/comments","events_url":"https://api.github.com/repos/awslabs/aws-sam-cli/issues/291/events","html_url":"https://github.com/awslabs/aws-sam-cli/issues/291","id":293910184,"node_id":"MDU6SXNzdWUyOTM5MTAxODQ=","number":291,"title":"Support for http_proxy type in x-amazon-apigateway-integration","user":{"login":"sgarcez","id":133269,"node_id":"MDQ6VXNlcjEzMzI2OQ==","avatar_url":"https://avatars2.githubusercontent.com/u/133269?v=4","gravatar_id":"","url":"https://api.github.com/users/sgarcez","html_url":"https://github.com/sgarcez","followers_url":"https://api.github.com/users/sgarcez/followers","following_url":"https://api.github.com/users/sgarcez/following{/other_user}","gists_url":"https://api.github.com/users/sgarcez/gists{/gist_id}","starred_url":"https://api.github.com/users/sgarcez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgarcez/subscriptions","organizations_url":"https://api.github.com/users/sgarcez/orgs","repos_url":"https://api.github.com/users/sgarcez/repos","events_url":"https://api.github.com/users/sgarcez/events{/privacy}","received_events_url":"https://api.github.com/users/sgarcez/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-02T14:42:52Z","updated_at":"2018-06-04T21:56:40Z","closed_at":null,"author_association":"NONE","body":"\r\nOur OpenApi spec contains the following path:\r\n```\r\n...\r\n          /{proxy+}:\r\n            get:\r\n              parameters:\r\n              - name: \"proxy\"\r\n                in: \"path\"\r\n              x-amazon-apigateway-integration:\r\n                type: \"http_proxy\"\r\n                uri: \"https://127.0.0.1:8000/{proxy}\"\r\n                httpMethod: \"GET\"\r\n               passthroughBehavior: \"when_no_match\"\r\n...\r\n```\r\n\r\n**Expected behaviour:**\r\nRequests are routed to `https://127.0.0.1:8000/*` when no other routes are matched.\r\n\r\n**Observed behaviour:**\r\n```\r\n$ sam local start-api\r\n\r\n2018/02/02 14:00:32 Connected to Docker 1.35\r\n2018/02/02 14:00:33 Could not extract Lambda function ARN: Could not find match in\r\n2018/02/02 14:00:33 Could not extract Lambda function ARN: Could not find match in https://127.0.0.1:8000/{proxy}\r\n2018/02/02 14:00:33 Fetching lambci/lambda:go1.x image for go1.x runtime...\r\ngo1.x: Pulling from lambci/lambda\r\nDigest: sha256:d77adf847c45dcb5fae3cd93283447fad3f3d51ead024aed0c866a407a206e7c\r\nStatus: Image is up to date for lambci/lambda:go1.x\r\n\r\nMounting handler (go1.x) at http://127.0.0.1:3000/a-non-proxied-endpoint [GET]\r\nWARNING: Could not find function for [GET] to /{proxy+} resource\r\n\r\nYou can now browse to the above endpoints [...]\r\n```\r\n\r\nIt would appear that the `type` property of [x-amazon-apigateway-integration](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-integration.html) is always treated like an `aws_proxy`.\r\n\r\n Looking at the source code, the [ApiGatewayIntegration type](https://github.com/awslabs/aws-sam-local/blob/739c48e3467109f7cec5b38b6bd407183e89e6a2/router/integration.go#L8)'s `GetFunctionArn()` method completely ignores the `Type` field, and simply attempts to construct a Function Arn from `Uri`, which fails with the `\"Could not find match in\"` error.\r\n\r\nI don't know what would be the best way to add support for this, I guess it could be done fully in Go or another solution would be to provide a 'proxier' handler / docker image that mimics the proxying behaviour in AWSGateway and [gets mounted](https://github.com/awslabs/aws-sam-local/blob/c4d34f2eb23c375274c374489cf723b0da5b87c3/router/api.go#L75) like any other endpoint.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/awslabs/aws-sam-cli/issues/comments/394513265","html_url":"https://github.com/awslabs/aws-sam-cli/issues/291#issuecomment-394513265","issue_url":"https://api.github.com/repos/awslabs/aws-sam-cli/issues/291","id":394513265,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NDUxMzI2NQ==","user":{"login":"sanathkr","id":22755571,"node_id":"MDQ6VXNlcjIyNzU1NTcx","avatar_url":"https://avatars3.githubusercontent.com/u/22755571?v=4","gravatar_id":"","url":"https://api.github.com/users/sanathkr","html_url":"https://github.com/sanathkr","followers_url":"https://api.github.com/users/sanathkr/followers","following_url":"https://api.github.com/users/sanathkr/following{/other_user}","gists_url":"https://api.github.com/users/sanathkr/gists{/gist_id}","starred_url":"https://api.github.com/users/sanathkr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sanathkr/subscriptions","organizations_url":"https://api.github.com/users/sanathkr/orgs","repos_url":"https://api.github.com/users/sanathkr/repos","events_url":"https://api.github.com/users/sanathkr/events{/privacy}","received_events_url":"https://api.github.com/users/sanathkr/received_events","type":"User","site_admin":false},"created_at":"2018-06-04T21:56:40Z","updated_at":"2018-06-04T21:56:40Z","author_association":"CONTRIBUTOR","body":"Unfortunately SAM CLI doesn't have mechanism to support other integration types. SAM CLI's API layer works only with Lambda backed APIs and not others. Is this something you will interested in contributing?\r\n\r\n"}}
{"actor":{"display_login":"sanathkr"}}