aws-lambda

Can't run AWS SAM CLI under Docker

不羁岁月 提交于 2021-02-06 13:49:02
问题 I'm trying to create a Docker image for AWS SAM CLI, but invoking any function gives an error: "Unable to import module 'index'". I can run the same test case outside of Docker sucessfully. You can clone the test case here or see the files below. I already tried the following: Setting permissions of files and parent folder to 777 (or 755). Disabling SELinux in the Docker daemon (or enabling it). Running Docker under privileged mode (or not). I get the same error using an old (SAM 0.22) Docker

Can't run AWS SAM CLI under Docker

ⅰ亾dé卋堺 提交于 2021-02-06 13:48:30
问题 I'm trying to create a Docker image for AWS SAM CLI, but invoking any function gives an error: "Unable to import module 'index'". I can run the same test case outside of Docker sucessfully. You can clone the test case here or see the files below. I already tried the following: Setting permissions of files and parent folder to 777 (or 755). Disabling SELinux in the Docker daemon (or enabling it). Running Docker under privileged mode (or not). I get the same error using an old (SAM 0.22) Docker

Best Way to Monitor Customer Usage of AWS Lambda

偶尔善良 提交于 2021-02-05 08:46:27
问题 I have newly created an API service that is going to be deployed as a pilot to a customer. It has been built with AWS API Gateway, AWS Lambda, and AWS S3. With a SaaS pricing model, what's the best way for me to monitor this customer's usage and cost? At the moment, I have made a unique API Gateway, Lambda function, and S3 bucket specific to this customer. Is there a good way to create a dashboard that allows me (and perhaps the customer) to detail this monitoring? Additional question, what's

Need to check video resolution before transcoding video file

China☆狼群 提交于 2021-02-05 07:32:27
问题 I am converting video files using an elastic transcoder. AWS Lambda function get video file from s3 bucket and convert it according to PresetId. But, I need to compare video file resolution with PresetId. If the video file resolution is higher than the PresetId video resolution, then convert this video file, otherwise do not need to convert all video files. 回答1: Do you have access to ffmpeg/ffprobe/ffplay from AWS - is it possible to call them and take their console output? I'm not sure about

Need to check video resolution before transcoding video file

雨燕双飞 提交于 2021-02-05 07:32:09
问题 I am converting video files using an elastic transcoder. AWS Lambda function get video file from s3 bucket and convert it according to PresetId. But, I need to compare video file resolution with PresetId. If the video file resolution is higher than the PresetId video resolution, then convert this video file, otherwise do not need to convert all video files. 回答1: Do you have access to ffmpeg/ffprobe/ffplay from AWS - is it possible to call them and take their console output? I'm not sure about

API Gateway+Lambda+VPC timeout issue

99封情书 提交于 2021-02-05 05:57:26
问题 Good morning, Could you please help us with next problem: I have an API Gateway + Java Lambda Handler. this Lambda uses httpconnection to get some Internet REST API. when we use this Lambda without VPC it works fine. but when we are using VPC with configured internet access - sometimes Lambda fails with timeout errors. it fails in 20% of all requests (80% requests works fine) with next errors at log. REPORT RequestId: 16214561-b09a-11e6-a762-7546f12e61bd Duration: 15000.26 ms Billed Duration:

Programmatically Stop AWS EC2 in case of inactivity

扶醉桌前 提交于 2021-02-05 05:43:12
问题 Can we stop an AWS windows server EC2 instance of a development environment when there is no activity in it, say after 2 hours of inactivity? I am having trouble identifying whether any user is connected to the server virtually. I can easily start/stop the EC2 at a fixed time, programmatically, but in order to cut the cost of my server, I am trying to stop the EC2 when it is not being used. My intent(or use case) is : If no user is using the EC2 till a specified amount of time, it will

Is it feasible to create multiple Lambda functions (Java) in a jar

谁说我不能喝 提交于 2021-02-04 19:15:10
问题 I am new to AWS Lambda and I am using AWS Eclipse plugin to develop Lambda functions. Question: Is it possible to use a single .jar for all different Lambda functions. In this single .jar file can I have classes for different Lambda functions. Otherwise, should I create separate .jar files for each Lambda function and upload the .jars separately for each Lambda functions. 回答1: It's possible to use one .jar, but it's not possible for lambdas to share one .jar. You will need to upload the jar

Python Lambda to send files uploaded to s3 as email attachments

和自甴很熟 提交于 2021-02-04 16:27:46
问题 We have an online form that gives people the option to upload multiple files. The form is built by a third party, so I don't have any involvement with them. When someone uploads files using the form it dumps the files into a new folder within an s3 bucket. I want to be able to do the following: Get the files triggered by form filler's upload Attach the files to an email Send the email to specific people. I have done quite a lot of research, but I'm still new to coding and am trying to use

How to add array values in Claims of IdToken in Cognito using claimsToAddOrOverride

試著忘記壹切 提交于 2021-02-04 14:48:26
问题 I am using Pre Token Generation to update the claims of IdToken. I am successfully able to update claim using single key:value pair. Below is the sample example of that. event["response"] = {"claimsOverrideDetails":{"claimsToAddOrOverride":{"scope": "test.debug"}}} But when i am trying to add array of string inside that, it giving me internal server error (Response from AWS Cognito) Ex: event["response"] = {"claimsOverrideDetails":{"claimsToAddOrOverride":{"scope": ["test1","test2]}}} It is