1 réponse
- Le plus récent
- Le plus de votes
- La plupart des commentaires
0
Hi,
it should definitely possible, without involving an API Gateway.
Make sure Lambda is either non in a VPC 8as it gets outbound internet traffic automatically), or if it is in VPC, then you will need a NAT Gateway + Internet Gateway (IGW).
Nevertheless, depending on your language of choice, you can use libraries such as native https or axios for NodeJS one or requests (https://pypi.org/project/requests/) for Python.
An example for Node:
const axios = require('axios');
exports.handler = async (event) => {
const url = 'https://data.nasdaq.com/api/v3/datatables/ZILLOW/DATA?indicator_id=ZSFH®ion_id=99999&api_key=__afpDhxkYvt5XZzfEB-';
const response = await axios.get(url);
const data = response.data;
return data;
};
or for Python:
import requests
def lambda_handler(event, context):
url = 'https://data.nasdaq.com/api/v3/datatables/ZILLOW/DATA?indicator_id=ZSFH®ion_id=99999&api_key=__afpDhxkYvt5XZzfEB-';
response = requests.get(url)
data = response.json()
return data
Hope it helps ;)
Contenus pertinents
- demandé il y a un an
- demandé il y a 7 mois
- demandé il y a 2 mois
- AWS OFFICIELA mis à jour il y a 2 ans
- AWS OFFICIELA mis à jour il y a 2 ans