{"action":"closed","issue":{"url":"https://api.github.com/repos/aws/aws-sdk-js/issues/792","labels_url":"https://api.github.com/repos/aws/aws-sdk-js/issues/792/labels{/name}","comments_url":"https://api.github.com/repos/aws/aws-sdk-js/issues/792/comments","events_url":"https://api.github.com/repos/aws/aws-sdk-js/issues/792/events","html_url":"https://github.com/aws/aws-sdk-js/issues/792","id":116558899,"number":792,"title":"Credential should be scoped to a valid region, not 'execute-api'.","user":{"login":"MaxiSantos","id":1896467,"avatar_url":"https://avatars.githubusercontent.com/u/1896467?v=3","gravatar_id":"","url":"https://api.github.com/users/MaxiSantos","html_url":"https://github.com/MaxiSantos","followers_url":"https://api.github.com/users/MaxiSantos/followers","following_url":"https://api.github.com/users/MaxiSantos/following{/other_user}","gists_url":"https://api.github.com/users/MaxiSantos/gists{/gist_id}","starred_url":"https://api.github.com/users/MaxiSantos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaxiSantos/subscriptions","organizations_url":"https://api.github.com/users/MaxiSantos/orgs","repos_url":"https://api.github.com/users/MaxiSantos/repos","events_url":"https://api.github.com/users/MaxiSantos/events{/privacy}","received_events_url":"https://api.github.com/users/MaxiSantos/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/aws/aws-sdk-js/labels/Question","name":"Question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-11-12T14:30:27Z","updated_at":"2015-11-20T21:09:07Z","closed_at":"2015-11-20T21:09:07Z","body":"Hi guys. I have an issue and I don't know where this problem comes from.\r\n\r\nI'm using select2 component along with csd. Select2 component allows me to load data from an external service while I'm typing on it. The problem is that when I get the response is a success but there is no data returned and if I look into the response tab on networking option on google chrome I see this error message:\r\n\r\n{\"__type\":\"#SignatureDoesNotMatch\",\"error\":{\"message\":\"[*Deprecated*: Use the outer message field] Credential should be scoped to a valid region, not 'execute-api'. \"},\"message\":\"Credential should be scoped to a valid region, not 'execute-api'. \"}\r\n\r\nDebbugin the sdk I found this:\r\n\r\n```javascript\r\nupdateRegion: function updateRegion(request) {\r\n                var endpoint = request.httpRequest.endpoint.hostname;\r\n                var zones = endpoint.split(\".\");\r\n                request.httpRequest.region = zones[1] || request.httpRequest.region;\r\n            }\r\n```\r\n\r\nSo, if you look at my endpoint (https://domain.execute-api.us-west-2.amazonaws.com/dev) you will see it's updating the region with \"execute-api\" value instead of \"us-west-2\". We are using a gateway because of the CORS issue.\r\n\r\nThis is the function I'm using with select2 component.\r\n\r\n```javascript\r\n_transport = function (params, success, failure) {\r\n       var csd = new AWS.CloudSearchDomain({\r\n\t          endpoint: 'https://domain.execute-api.us-west-2.amazonaws.com/dev',\r\n\t          region: 'us-west-2',\r\n\t          accessKeyId: 'accessKeyId',\r\n\t          secretAccessKey: 'secretAccessKey'\r\n\t        }),\r\n\t        csdParams = _prepareQuery(params);\r\n\r\n\t      var searchRequest = csd.search(csdParams);\r\n\t      searchRequest.\r\n\t        on('success', function(response) {\r\n\t          console.log(\"Success!\" + response.data);\r\n\t          params.success(response.data);\r\n\t        }).\r\n\t        on('error', function(response) {\r\n\t          console.log(\"Error!\" + response.data);\r\n\t          params.error(searchRequest, \"text status\", \"errorThrown\");\r\n\t        }).\r\n\t        on('complete', function(response) {\r\n\t          console.log(\"Always!\" + response.data);\r\n\t        }).\r\n\t        send();\r\n\treturn searchRequest;\r\n}\r\n```\r\nCould someone point me a little where to find the issue?"}}