aws-lambda

AWS lambda: No module named 'cfnresponse'

假装没事ソ 提交于 2019-12-19 19:44:37
问题 I have deployed an AWS lambda which contains: import json import boto3 import cfnresponse import urllib.request from botocore.exceptions import ClientError def lambda_handler(event, context): ... cfnresponse.send(event, context, status, responseData, "CustomResourcePhysicalID") I tried to get the values of the cfnresponse in my cloudformations: Resources: API: Type: Custom::API Version: '1.0' Properties: ServiceToken: arn:aws:lambda:eu-west-1:1234567891011:function:getCountry Outputs: Status:

Increase number of shards in DynamoDB to spin up more lambdas in parallel

房东的猫 提交于 2019-12-19 18:57:17
问题 I'm currently using DynamoDB streams to process changed collection values with lambda functions, however, currently, I'm only running two lambda instances in parallel, which is not enough to process all the incoming data and lambda functions are just queued up. From aws documentation I can see that number of lambdas that can run in parallel is proportional to the number of shards of your DynamoDB: If you create a Lambda function that processes events from stream-based services (Amazon Kinesis

Increase number of shards in DynamoDB to spin up more lambdas in parallel

五迷三道 提交于 2019-12-19 18:57:12
问题 I'm currently using DynamoDB streams to process changed collection values with lambda functions, however, currently, I'm only running two lambda instances in parallel, which is not enough to process all the incoming data and lambda functions are just queued up. From aws documentation I can see that number of lambdas that can run in parallel is proportional to the number of shards of your DynamoDB: If you create a Lambda function that processes events from stream-based services (Amazon Kinesis

It is possible to Access AWS DynamoDB streams accross accounts?

独自空忆成欢 提交于 2019-12-19 17:45:35
问题 My company manages AWS using a multi-account system. I have a lambda function in account A and a DynamoDB table with a Stream enabled in account B. I want the stream events to trigger my function. When I run: aws lambda create-event-source-mapping --event-source-arn arn:aws:dynamodb:us-east-1:101010101:table/table/stream/2016-08-09T23:00:46.852 --function-name Lambda-qa --enabled --batch-size 10 --starting-position TRIM_HORIZON I get the following error: An error occurred

AWS Lambda using Java - setting the configuration connection/socket timeouts

守給你的承諾、 提交于 2019-12-19 12:07:03
问题 See here: AWS Documentation The connection timeout is the amount of time (in milliseconds) that the HTTP connection will wait to establish a connection before giving up. The default is 50,000 ms. To set this value yourself, use the ClientConfiguration.setConnectionTimeout method. I am trying to set the value myself, using: ClientConfiguration configuration = new ClientConfiguration(); configuration.setConnectionTimeout(1900000); configuration.setSocketTimeout(1900000); Problem is, I am trying

AWS Lambda using Java - setting the configuration connection/socket timeouts

微笑、不失礼 提交于 2019-12-19 12:06:09
问题 See here: AWS Documentation The connection timeout is the amount of time (in milliseconds) that the HTTP connection will wait to establish a connection before giving up. The default is 50,000 ms. To set this value yourself, use the ClientConfiguration.setConnectionTimeout method. I am trying to set the value myself, using: ClientConfiguration configuration = new ClientConfiguration(); configuration.setConnectionTimeout(1900000); configuration.setSocketTimeout(1900000); Problem is, I am trying

Classify images on basics of similarity

自作多情 提交于 2019-12-19 11:55:22
问题 I have 30 ,40 pictures of humans , Which I want to get in Python code . And make group of similar pics . Like 5 pic of john and 10 of peter . like this . I am new in Image processing thing. So my question is which algo is best for this . And I want to do this on AWS lambda function . Any help would be highly appreciated. P.S (Its my first ever task in this field. Kindly ignore mistakes of tell me to improve them Thanks) 回答1: I would suggest you to do the thing with AWS Rekognition. It's

Upload Image into S3 bucket using Api Gateway, Lambda funnction

耗尽温柔 提交于 2019-12-19 08:54:06
问题 I'm trying to upload the image (base64) from the postman, I can see when I hit the Serverless API, something has been added in S3 bucket but not image, I'm using nodejs Lambda function, I tried so many solutions but that didn't work out. Please suggest me where I'm wrong: const AWS = require('aws-sdk'); const s3 = new AWS.S3(); const moment = require('moment'); const fileType = require('file-type'); const sha1 = require('sha1'); const multipart = require('parse-multipart'); exports.handler =

AWS lambda nodejs runtime: io: read/write on closed pipe

你说的曾经没有我的故事 提交于 2019-12-19 08:17:10
问题 I am trying to execute a couple of async requests from a lambda function. The first call resolveEndpoints() succeeds and the second fails with 2017/11/03 17:13:27 Function oauth.callbackHandler timed out after 3 seconds 2017/11/03 17:13:27 Error invoking nodejs6.10 runtime: io: read/write on closed pipe The handler is: exports.callbackHandler = async (event, context, callback) => { context.callbackWaitsForEmptyEventLoop = false; let endpoints: any = await resolveEnpoints(); config

Terraform lambda source_code_hash update with same code

爷,独闯天下 提交于 2019-12-19 08:11:26
问题 I have an AWS Lambda deployed successfully with Terraform: resource "aws_lambda_function" "lambda" { filename = "dist/subscriber-lambda.zip" function_name = "test_get-code" role = <my_role> handler = "main.handler" timeout = 14 reserved_concurrent_executions = 50 memory_size = 128 runtime = "python3.6" tags = <my map of tags> source_code_hash = "${base64sha256(file("../modules/lambda/lambda-code/main.py"))}" kms_key_arn = <my_kms_arn> vpc_config { subnet_ids = <my_list_of_private_subnets>