Questions tagged with Amazon API Gateway

Content language: English

Sort by most recent

Browse through the questions and answers listed below or filter and sort to narrow down your results.

1
answers
0
votes
30
views
asked a month ago

I'm having trouble writing the correct GraphQL query in Node.JS for an AWS DataExchange Provider's API specification

I'm trying to write a GraphQL query to fetch data from an AWS DataExchange provider based on their company's API specification. However, every query I've written so far is returning 'data: null'. I've verified that all my AWS credentials and IAM keys are correct. Could someone please help me write the correct query based on the API specification given by the data provider. Thanks! My current request 'body' looks like below: ```javascript Body: JSON.stringify({ content: { "application/graphql": { "schema": { "$ref": "#/components/schemas/CatalogSearchRequest" }, query: `query availablemetadatarecord(limit: 10 content: { catalogProperties: { vendor: { eq: "EYE" } } }) { assignedId } }` } } }), ``` The DataExchange provider's actual API specification looks like below. ```javascript { "openapi": "3.0.1", "info": { "title": "image-services", "description": "API Gateway for integration of Platform Services into AWS Data Exchange", "version": "2022-03-03T20:04:18Z" }, "servers": [ { "url": "" } ], "paths": { "/psdm/graphql": { "post": { "requestBody": { "description": "GraphQL query for the Catalog in the form of:\n\n `{\n availablemetadatarecord(\n QUERYPARAMS\n ) { \n FIELDLIST\n } \n }`\n", "content": { "application/graphql": { "schema": { "$ref": "#/components/schemas/CatalogSearchRequest" }, "examples": { "Limit returned data": { "description": "Limit the number of records in a response.\n\nIn your query, simply specify `limit: <int>` \n", "value": "{\n availablemetadatarecord(\n limit: 10\n content: { catalogProperties: { vendor: { eq: \"EYE\" } } }\n ) {\n assignedId\n }\n}\n" } } } }, "required": true }, "responses": { "200": { "description": "200 response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CatalogSearchResponse" } } } } }, "security": [ { "sigv4": [] } ] } } }, "components": { "schemas": { "CatalogSearchRequest": { "title": "CatalogSearchRequest", "type": "object" }, "CatalogSearchResponse": { "title": "Catalog Search Response", "required": [ "data", "paginationInfo" ], "type": "object", "properties": { "paginationInfo": { "type": "object", "properties": { "recordsInPage": { "type": "integer" }, "nextOffset": { "type": "integer" } } }, "data": { "type": "object", "properties": { "availablemetadatarecord": { "type": "array", "description": "Records returned by query", "items": { "type": "object" } } } } } } }, "securitySchemes": { "sigv4": { "type": "apiKey", "name": "Authorization", "in": "header", "x-amazon-apigateway-authtype": "awsSigv4" } } } } ``` The response I get from my GraphQL query looks like below: ```txt httpRequest: HttpRequest { method: 'POST', path: '/', headers: { 'User-Agent': 'aws-sdk-nodejs/2.1241.0 win32/v16.9.1' }, body: '', endpoint: { protocol: 'https:', host: 'dataexchange.us-east-1.amazonaws.com', port: 443, hostname: 'dataexchange.us-east-1.amazonaws.com', pathname: '/', path: '/', href: 'https://dataexchange.us-east-1.amazonaws.com/', constructor: [Function] }, region: 'us-east-1', _userAgent: 'aws-sdk-nodejs/2.1241.0 win32/v16.9.1' }, startTime: 2022-11-04T18:25:22.763Z, response: Response { request: [Circular *1], data: null, error: null, retryCount: 0, redirectCount: 0, httpResponse: HttpResponse { statusCode: undefined, headers: {}, body: undefined, streaming: false, stream: null }, maxRetries: 3, maxRedirects: 10 }, ```
0
answers
0
votes
14
views
asked a month ago

Can not call HTTP API with Custom domain which provided by Google Domain

I'm going to connect HTTP API to my domain and use it. My domain is ***.art and I'm using it from Google. First, I connected CNAME to connect to AWS Amplify. Below is a captured copy of the Admin tab for the Amplify domain and the DNS settings status for the Google domain. ![Enter image description here](/media/postImages/original/IMB_v0nABCQlCCYiDg12-d2w) ![Enter image description here](/media/postImages/original/IMFAxZpx67SJuQywDFZY_7kQ) Subsequently, we created an HTTP API and verified calls through that URL.![Enter image description here](/media/postImages/original/IMvwgkwY8cT26mAvQkxWUziQ) The path and CORS settings of the API are shown in the screenshot below. ![Enter image description here](/media/postImages/original/IMgV_fMCrZTCmDIGUNWS_OYg)![Enter image description here](/media/postImages/original/IMiNitf33iQamWTYY5xe6QPQ) And the settings for the custom domain are as follows. ![Enter image description here](/media/postImages/original/IMbAtfy-xzStmVm9fP81rLBg) ![Enter image description here](/media/postImages/original/IMDBwuYv4gSV2Ro_3u-Yhz3A) Finally, the certificate and the DNS setting of the Google domain to which it was applied are as follows. ![Enter image description here](/media/postImages/original/IM6kXCEe7ZRiKUxDoIX4hkyA) ![Enter image description here](/media/postImages/original/IMSm3e45NJTMCJZW9Khrwvyw) I would appreciate it if you could tell me which part went wrong. The following is an error response when Chrome accessed the HTTP API address through my custom domain. ![Enter image description here](/media/postImages/original/IMWg1T0EeAQq-SgV5FTYm_dA) ![Enter image description here](/media/postImages/original/IM-KMgzjgITX-I3u_N-Lr5JQ)
0
answers
0
votes
23
views
asked a month ago

HTTPAPI ALB integration over VPCLink to TargetGroup return 500 error

Hi, Here is my configuration mydomain.com -> API GW Custom Domain -> HTTPAPI -> Route (/api/{+proxy}) -> VPCLink -> ALB -> HTTPS Listener -> TargetGroup (Type: Instance) -> ECS Fargate Service HTTPAPI integration has the following parameter mapping: path -> overwrite -> /$request.path.proxy (I want to get rid of "api" part in the url) when I make below request I got 500 errors https://mydomain.com/api/otherPath I have enabled access logs on HTTPAPI but they show very limited information. ALB logs are sent to S3 bucket so it is almost impossible to track request. As far I see requests are not hitting the Fargate Service but I am not sure. Sample access log from API GW HTTP API: ``` { "requestId": "some_req_id=", "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36", "sourceIp": "176.232.**.**", "requestTime": "01/Nov/2022:09:25:37 +0000", "requestTimeEpoch": "1667294737", "httpMethod": "GET", "path": "/otherPath", "status": "500", "protocol": "HTTP/1.1", "responseLength": "35", "domainName": "mydomain.com", "error_Message": "Internal Server Error", "integrationErrorMessage": "-", "integration_Error": "-", "integrationStatus": "200", "integration_Status": "-", "integration_IntegrationStatus": "200", "integrationLatency": "5" } ``` What am I missing? Why is it sooooo hard to find what is causing the error? I think configuration is fine but somehow it is really hard to make it work. Unbelievable!
1
answers
0
votes
17
views
asked a month ago