aws-lambda

AWS Lambda Function is misinterpreting event dictionary in python?

点点圈 提交于 2019-12-21 06:33:07
问题 I am trying to deploy a google calendar api to AWS Lambda. Since I was facing a problem in extracting the value from the event dictionary (created by lambda from the JSON payload of a POST request), i created a toy function to test def handler(event,context): a=event.get("type") if a=='create': return { "statusCode": 200, "headers": { "Content-Type": "text/plain"}, #"body": "Event_id"+ str(event_identifier) + " Event Link: " +str(links) "body" : str(a) } else: return { "statusCode": 200,

Read Parquet file stored in S3 with AWS Lambda (Python 3)

人盡茶涼 提交于 2019-12-21 05:07:13
问题 I am trying to load, process and write Parquet files in S3 with AWS Lambda. My testing / deployment process is: https://github.com/lambci/docker-lambda as a container to mock the Amazon environment, because of the native libraries that need to be installed (numpy amongst others). This procedure to generate a zip file: http://docs.aws.amazon.com/lambda/latest/dg/with-s3-example-deployment-pkg.html#with-s3-example-deployment-pkg-python Add a test python function to the zip, send it to S3,

Read Parquet file stored in S3 with AWS Lambda (Python 3)

China☆狼群 提交于 2019-12-21 05:07:13
问题 I am trying to load, process and write Parquet files in S3 with AWS Lambda. My testing / deployment process is: https://github.com/lambci/docker-lambda as a container to mock the Amazon environment, because of the native libraries that need to be installed (numpy amongst others). This procedure to generate a zip file: http://docs.aws.amazon.com/lambda/latest/dg/with-s3-example-deployment-pkg.html#with-s3-example-deployment-pkg-python Add a test python function to the zip, send it to S3,

Cannot get aws lambda function response in PHP client

一曲冷凌霜 提交于 2019-12-21 04:41:02
问题 I am trying to call a simple Aws Lambda function using PHP as Instructed in the documentation, But I am not getting the desired response. PHP Lambda client require './aws/aws-autoloader.php'; use Aws\Lambda\LambdaClient; $client = LambdaClient::factory(array( 'version' => "latest", 'credentials' => array( 'key' => '*******', 'secret' => '*******' ), 'region' => '*******' )); $response = $client->invoke([ 'FunctionName' => 'myLambda', // REQUIRED 'InvocationType' => 'RequestResponse', 'Payload

How Publish SNS message in C# Lambda Core

自闭症网瘾萝莉.ら 提交于 2019-12-21 04:26:15
问题 I found the code below at https://forums.aws.amazon.com/thread.jspa?threadID=53629: AmazonSimpleNotificationService sns = AWSClientFactory.CreateAmazonSNSClient(key, secret); PublishRequest req = new PublishRequest(); req.WithMessage("This is my test message"); req.WithSubject("The Test Subject"); req.WithTopicArn(topicArn); PublishResponse result = sns.Publish(req); But does it work in .NET Core? If so how, and what using statements? I used this Nuget install: Install-Package AWSSDK

Alexa not finding my Skill

偶尔善良 提交于 2019-12-21 04:24:32
问题 I created my Alexa Skill as an AWS Lambda Node.js app based on one of the provided examples in the Alexa Skills Kit. I followed all the instructions: My Echo is registered with the same account as my developer account on AWS I configured my Skill on the Amazon developer console I put my application ID from the console into my application code I uploaded my code to the AWS Lambda service (set to N. Virginia, as instructed) I tested my service and it returned the expected JSON I entered my ARN

Invoke AWS Lambda SNS event only after SQS subscription on same topic has been processed

喜你入骨 提交于 2019-12-21 04:16:09
问题 I would like to implement an Amazon SNS topic which first delivers messages to a SQS queue that is a subscriber on the topic, and then executes an AWS Lambda function that is also a subscriber on the same topic. The Lambda function can then read messages from the SQS queue and process several of them in parallel (hundreds). My question is whether there is any way to guarantee that messages sent to the SNS topic would first be delivered to the SQS queue, and only then to the Lambda function?

Mapping Lambda output in API Gateway gives server error

流过昼夜 提交于 2019-12-21 04:04:20
问题 I have an AWS API Gateway setup, served by a Python Lambda function. For successful responses the Lambda returns a response of the form: "200:{\"somekey\": \"somevalue\"}" By default, the Integration Response settings in the gateway console have just one rule configured with a Lambda Error Regex of .* mapping to a response status of 200. This works fine. The problem is when I try to change that to 200.* (with a view to enabling more specific codes going forward). Now I get a {"message":

The role defined for the function cannot be assumed by Lambda

爷,独闯天下 提交于 2019-12-21 03:11:02
问题 I'm getting the error "The role defined for the function cannot be assumed by Lambda" when I'm trying to create a lambda function with create-function command. aws lambda create-function --region us-west-2 --function-name HelloPython --zip-file fileb://hello_python.zip --role arn:aws:iam::my-acc-account-id:role/default --handler hello_python.my_handler --runtime python2.7 --timeout 15 --memory-size 512 回答1: I got the error "The role defined for the function cannot be assumed by Lambda"

Send an SMS for a cloudwatch Alarm outside of us-east?

流过昼夜 提交于 2019-12-21 02:43:33
问题 It looks like AWS does not provide SMS as a protocol for SNS topic subscribers outside of US East. I wanted to hook up my CloudWatch alarms and receive text messages when something breaks but cannot send them to SMS. 回答1: YES! After some digging I was able to get this to work. It's a little more complicated than just selecting a topic or inputing an alarm but it works great! The key to the solution was using AWS's lambda functions! The flow of data is such: > Alarm triggered > -> Push