aws-lambda

QqsClient.SendMessageAsync without await doesn't work

房东的猫 提交于 2021-01-29 09:55:06
问题 I have a Lambda function and that lambda function is supposed to send messages to multiple queues in SQS and then exit, If I add await, then messages are sent to all queues, var sqsClient = ServerlessHelper.GetAmazonSqsClient(); foreach (var item in items) { await sqsClient.SendMessageAsync(item.QueueUrl, item.Message); } But if I remove await from the code, then none of messages are sent to queues. I want to send messages in parallel. But due to await I have function cannot send messages in

Deploy function in AWS Lamda (package size exceeds)

╄→尐↘猪︶ㄣ 提交于 2021-01-29 09:28:32
问题 I am trying to deploy my function on AWS Lambda. I need the following packages for my code to function: keras-tensorflow Pillow scipy numpy pandas I tried installing using docker and uploading the zip file, but it exceeds the file size. Is there a get around for this? How to use these packages for my Lambda function? 回答1: publish your packages in AWS Lambda layer instead, and reference it from your code. The packages published in the AWS Lambda layer will be there all the time and will not

How to deploy a Pre-Trained model using AWS SageMaker Notebook Instance?

岁酱吖の 提交于 2021-01-29 09:11:28
问题 I have a pre-trained model which I am loading in AWS SageMaker Notebook Instance from S3 Bucket and upon providing a test image for prediction from S3 bucket it gives me the accurate results as required. I want to deploy it so that I can have an endpoint which I can further integrate with AWS Lambda Function and AWS API GateWay so that I can use the model with real time application. Any idea how can I deploy the model from AWS Sagemaker Notebook Instance and get its endpoint? Code inside the

How to send SNS topic a message from Node.js Lambda function

对着背影说爱祢 提交于 2021-01-29 08:23:47
问题 An SNS topic has been created to call a subscribed Lambda function which adds a user to a group in Cognito. Sending a message to the topic using the console in the web browser works correctly. The Lambda function is called and the user is added to the group. The Lambda function below attempts to replace the web console by sending a message to the SNS topic itself, which should end with the user being added to the group. When running the function in the Lambda web console, the function returns

python subprocess popen does not execute php script

∥☆過路亽.° 提交于 2021-01-29 08:19:49
问题 Please note, we are using aws-lambda to execute a php script using python subprocess popen function. We used the following code to call the file in python popen: import json import subprocess # if the script doesn't need output. def lambda_handler(event, context): cmd = ["/usr/bin/php74/", "/home/admin/web/path/post.php"] proc = subprocess.Popen(cmd, shell=True,stdout = subprocess.PIPE, stderr = subprocess.PIPE) script_response = proc.stdout.read(); It displays a message indicating that data

AWS Lambda NodeJS call to SQL Server returns no data and no errors

让人想犯罪 __ 提交于 2021-01-29 07:51:50
问题 I am trying to connect to an AWS hosted SQL server with a lambda function, but when I test it in the lambda management console, or via an API call I get passed all the way through the function to get the final response of test here This seems to indicate that the call hit no errors and returned no records. Since I know the table has data I would have at least expected an error or ideally, data. How can I troubleshoot this? using CloudWatch console output I see 'called rdsquery' but nothing

Cloudformation giving error “Requires capabilities : [CAPABILITY_AUTO_EXPAND]”

喜夏-厌秋 提交于 2021-01-29 07:30:52
问题 I am trying to implement Continuous Deployment for my .net core app. When lambda function is invoked, I'am trying to create a cloudformation to spin up the resources. But getting error: Creating Cloud Formation stack: gateway-api-uat-stack Failed to create stack: gateway-api-uat-stack. Reason: Detailed Message: Requires capabilities : [CAPABILITY_AUTO_EXPAND] (Service: AmazonCloudFormation; Status Code: 400; Error Code: InsufficientCapabilitiesException; Request ID: 4779587c-2a17-11e9-a093

How to send parameters through AWS HTTP API to Lambda

别说谁变了你拦得住时间么 提交于 2021-01-29 07:17:15
问题 I have switched from the REST API to HTTP API for it's cost efficiency. I am a noob to AWS so please be patient with me. LAMBDA I have a simple Lambda function that returns the same value it's given. It works fine when tested from the actual Lambda console. exports.handler = async (event) => { // TODO implement const response = { statusCode: 200, body: "hello" + event["key1"] }; return response; }; When the function is tested from the Lambda console with JSON input: { "key1":"value1" }, it

How to read files outside main.go, and make it work on AWS lambda

我的未来我决定 提交于 2021-01-29 07:15:10
问题 On AWS Lambda, I want to use CSV file outside main.go Of course this works when I follow these steps. cd ~/go/src/lambda-go-sample GOOS=linux go build main.go zip main.zip main upload to Lambda and test => "Hello ƛ!" main.go package main import ( "github.com/aws/aws-lambda-go/lambda" ) func hello() (string, error) { return "Hello ƛ!", nil } func main() { lambda.Start(hello) } Now I add sample.csv on the same directory of main.go ,and add code to read it. lambda-go-sample |- main.go |- sample

Lambda trigger doesn't replicate to SQS source across accounts

浪尽此生 提交于 2021-01-29 06:12:39
问题 I'm trying to add an SQS as a source/trigger to a lambda. I can do this just fine if both components reside within the same account. When I add the trigger to the lambda, the lambda trigger configuration replicates over to the SQS queue to pair the two. When I try this same thing on my lambda when the SQS is remote in a different account the Lambda trigger is established, but when viewing the remote SQS it doesn't show a trigger configured. This seems to result in the trigger not working on