amazon-web-servicesamazon-s3aws-lambdaaws-api-gateway

pull data from s3 bucket in json format via api call


I have csv's in a bucket (stock data). I have products in Amazon Data Exchange and I would like to create some products in which an API can be used to pull this data by subscribers. Do I need a lambda to pull the data and then connect it to an API in API gateway, or can the API directly reference the data in the bucket and deliver it in json (or csv if user wants). I would also need to be able to give users the ability to structure a payload via aws SDK or CLI or some other IDE in which they specify various fields, date ranges etc... Thank you.


Solution

  • As far as i know there's no direct method in AWS API Gateway to convert from csv to json without using a Lambda triggered by your API GET Method. For formatting i guess you can define a Query Parameter containing a list with the desired fields , read the parameters in the Lambda function and format your output as required.