aws-lambda

Unable to install aws-sam-cli using pip on Windows 10

会有一股神秘感。 提交于 2019-12-11 18:23:40
问题 I'm at my wits end. I'm trying to install aws-sam-cli so that I can test AWS Lambda functions locally. I've followed all the tutorials I can find but I'm stuck. I've installed docker and python 3.7 onto my local machine but when I try to install aws-sam-cli using: pip install aws-sam-cli I get the following error: Could not find a version that satisfies the requirement pypiwin32==220; sys_platform == "win32" and python_version >= "3.6" (from docker>=3.3.0->aws-sam-cli) (from versions: 219,

Storing the session token in AWS Lambda function?

社会主义新天地 提交于 2019-12-11 18:06:23
问题 I have a AWS Lambda function which need to talk to an external REST API. The external API needs a session token with every request. I generate session token using client id and secret and then i use the session token with further requests to the external REST API. I am currently storing the session token in mongodb (to persist data during lambda restarts) and retrieving it every time i need it. I think this is not the best way. what is the best / recommended way ? 回答1: The approach you are

python Bytes IO usage on AWS Lambda and second iteration of csv file

久未见 提交于 2019-12-11 18:04:28
问题 I have a csv file named myref.csv and a list as ref_list: myref.csv name,Dept,City sree,NULL,Bengaluru vatsasa,,Hyd ,,VJA capgemini,,TPTY DTP,, Bengaluru,NULL,TVM sre,NULL,MNGL vatsas,,Kochi ,NULL,TVM capgemin,NULL,MNGL DTP9,NULL,Kochi NULL,NULL,TVM sree0,NULL,MNGL ref_list: ref_list=['Name', 'Dept', 'City', 'Address'] I have following code written: response = s3.get_object(Bucket=src_bucket, Key=key) lines = response['Body'].read().splitlines(True) reader = csv.reader(lines) first_row = next

Public IP address for AWS API Gateway & Lambda (no VPC)

柔情痞子 提交于 2019-12-11 17:56:24
问题 I have provisioned an AWS API Gateway and created a Lambda function to connect to an external REST API. The API Gateway & Lambda is not in a VPC so the egress IP address is random. The challenge I have is the external REST API is behind a firewall, which requires the IP address or subnet of the Lambda to be whitelisted. I have looked at the AWS IP Address page (below), however there is no explicit mention of either API Gateway or Lambda. https://docs.aws.amazon.com/general/latest/gr/aws-ip

Getting error AWS Lambda : EROFS: read-only file system, open '/var/task/assets/docs.zip'

别来无恙 提交于 2019-12-11 17:56:20
问题 Can any one help me that why i got this issue I run this code locally it runs perfectly but at aws lambda i got this error even i increase the time over lambda time out function as well memory. In this code i do a basic task for get call i just convert a xlsx to json and in post i just convert a test dir to zip file.I tried it from last few hrs for uploading at aws lambda now I am stuck and seeing continously this error can anyone help me out from this situation thanks in advance. here is my

node able to make http request node js aws lambda

可紊 提交于 2019-12-11 17:26:05
问题 I am trying to write a lambda function which will make 3 http calls to the endpoints of my service running in the ec2 instance of my pod , the aws lambda will be triggered by the cron which I have configured, I have also added the VPC in the network setting while configuring the aws lambda. I am using node.js 8.10 to code my lambda handler function , here is my code for the lambda handler function 'use strict'; var http = require('http'); exports.handler = async (event) => { http.get('url1',

How to implement Mongodb connection pooling in lambda function using pymongo

删除回忆录丶 提交于 2019-12-11 17:22:48
问题 I am using aws lambda function, python and monogdb atlas. I have executed the below code. client = MongoClient('mongodb+srv://app_user:123456@accesdev-dxjpa.mongodb.net/test') db = client.test def lambda_handler(event, context): print("Received event: " + json.dumps(event, indent=1)) user_profile = db.user_profile Email = event['email'] res = Email.find('@') if res == -1: disuname = list(user_profile.find({"username" : Email},{"name": 1, "photo": 1, "bio": 1})) uid = json.dumps(disuname,

AWS Python Lambda with Oracle - OID Generation Failed even after adding HOSTALIASES

蹲街弑〆低调 提交于 2019-12-11 17:17:41
问题 I am trying to connect to oracle on rds using lambda with python using cx_oracle package but i get: ORA-21561: OID generation failed: DatabaseError. Even after adding file /tmp/HOSTALIASES with the lambda-server-name localhost . Also added HOSTALIASES to lambda environment variables . Referd from: AWS Python Lambda with Oracle - OID Generation Failed. How to resolve this OID generation problem in aws lambda Here is my code import cx_Oracle import os import sys import time # sys.path.append(

Why can I not use aws_lambda_function datasource inside aws_lambda_alias routing_config?

十年热恋 提交于 2019-12-11 16:57:28
问题 I am experimenting with a blue/green deployment setup for lambdas using terraform and lambda aliases. I am trying to automatically retrieve the previously deployed version of the lambda by using the aws_lambda_function data source and using the value inside the routing_config => additional_version_weights. This would allow me to set up a traffic split between the previously deployed version and the version that has just been deployed. However, I have run into 2 errors I don't quite understand

Perl script in Amazon Web Services Lambda functions

℡╲_俬逩灬. 提交于 2019-12-11 16:56:41
问题 Is there any possibility of running a Perl program from lambda functions in Amazon Web Services ? 回答1: You can run essentially anything in Lambda as long as it is binary-compatible with the Lambda runtime environment and can fit into a deployment package. But you have to wrap it in a function written in one of the supported languages. This is surprisingly more effective and efficient than you might expect, particularly if you can write your code in the other language so that it can be spawned