-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CARTO Pass-Through API #19
Comments
Now that I've actually read that doc page, it looks perfect! |
I tried it today and couldn't get it to deploy.
```
andrewbt_1:~/serverless-testing $ sls deploy
Serverless: Creating Stack...
Serverless: Checking Stack create progress...
.....
Serverless: Stack create finished...
Serverless: Packaging service...
Serverless: Uploading CloudFormation file to S3...
Serverless: Uploading service .zip file to S3 (22 B)...
Serverless: Updating Stack...
Serverless Error ---------------------------------------
Template format error: Unresolved resource dependencies
[ApiGatewayRestApi] in the Resources block of the template
Get Support --------------------------------------------
Docs: docs.serverless.com
Bugs: github.com/serverless/serverless/issues
Your Environment Information -----------------------------
OS: linux
Node Version: 4.6.1
Serverless Version: 1.6.1
```
Didn't have much time to debug, will be back at it later.
…On Wed, Feb 8, 2017 at 7:11 PM, Tim Wisniewski ***@***.***> wrote:
Now that I've actually read that doc page, it looks perfect!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#19 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB65c83u2ZZztx4Ir6zPE84xD8DiaEeRks5ralmogaJpZM4L7XRq>
.
--
Andrew Thompson, Solutions Engineer
*CARTO* | 201 Moore St, Brooklyn, NY, 11206
athompson@carto.com | T +1 508.333.7265 <+15083337265>
Web carto.com <http://cartodb.com/> | Twitter @carto
<http://twitter.com/carto>
Predict Through Location
Live sessions to learn CARTO <http://carto.com/webinars/>
|
This is almost working: resources:
Resources:
ProxyResource:
Type: AWS::ApiGateway::Resource
Properties:
ParentId:
Fn::GetAtt:
- ApiGatewayRestApi # our default Rest API logical ID
- RootResourceId
PathPart: carto # the endpoint in your API that is set as proxy
RestApiId:
Ref: ApiGatewayRestApi
ProxyMethod:
Type: AWS::ApiGateway::Method
Properties:
ResourceId:
Ref: ProxyResource
RestApiId:
Ref: ApiGatewayRestApi
AuthorizationType: NONE
HttpMethod: GET # the method of your proxy. Is it GET or POST or ... ?
MethodResponses:
- StatusCode: 200
Integration:
IntegrationHttpMethod: GET
Type: HTTP
Uri: https://phl.carto.com/api/v2/sql # the URL you want to set a proxy to
IntegrationResponses:
- StatusCode: 200 The problem appears to be that API Gateway doesn't pass querystrings along by default, and it looks like the only way to enable them is to explicitly activate each one. Fortunately, with carto, we can activate Need someone familiar with API Gateway / cloudformation to weigh in. I've asked in freenode ##aws and the og-aws slack. EDIT: Also, I think that ideally it would be EDIT2: Apparently you can make the resource pathpart |
@andrewbt can you post the screenshots of the 3 configuration forms you got working when you get a chance? I can try to translate into cloudformation code this weekend. |
Posted for help |
Reposting screenshots from #37 : Testable here: |
API Gateway allows you to “export” an API (under Stages) as a Swagger YAML or JSON document. One of the options for creating an API is through importing a Swagger document. If we can’t get serverless.yaml to work with the HTTP-proxy integration and other options we need there for the pass-through API, Swagger seems like a good alternative and will still let us keep “deployment in code” rather than through the AWS console UI. |
We bloody cracked it!! I got swagger to work, but it ended up overwriting all the serverless functions. But then I noticed that the swagger itself was basically cloudformation. So that told me what pieces were missing from the original cloudformation. And it's working! :D |
Hey! That's awesome!
…On Tue, Feb 28, 2017 at 7:47 AM Tim Wisniewski ***@***.***> wrote:
[image: giphy]
<https://cloud.githubusercontent.com/assets/761444/23405829/0d08737a-fd8a-11e6-8bd9-dd3e584a4a10.gif>
We bloody cracked it!!
I got swagger to work, but it ended up overwriting all the serverless
functions. But then I noticed that the swagger itself was *basically*
cloudformation. So that told me what pieces were missing from the original
cloudformation. And it's working! :D
https://67qq7fn418.execute-api.us-east-1.amazonaws.com/dev/carto/api/v2/sql?q=select%20*%20from%20pol_incidents_part1_part2%20limit%2010
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#19 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB65c5RZFDTModIV7f7Bb60e5EdLfNucks5rhBd1gaJpZM4L7XRq>
.
|
The text was updated successfully, but these errors were encountered: