aws-lambda

Accessing an AWS Lambda function from a java web application application is done over Https or Http

耗尽温柔 提交于 2019-12-25 03:39:30
问题 I am accessing a lambda function from my java code and I would like to know if I am using Https or Https for that request. How can I do that. This is how my method looks like. public interface FileScanService { @LambdaFunction( functionName = "s3-antivirus-api-scan" ) public FileScanOutput scanFile( FileScanInput fileScanInput ); } PS: this method is fully functional. 回答1: UPDATE : See the comment by Michael below. It turns out there is a way how to do it directly via HTTPS. A Lambda function

Runtime Error on AWS Lambda with Scrapy - Reuse container issue

戏子无情 提交于 2019-12-25 02:55:33
问题 I had a problem with AWS Lambda container and Scrapy. When I execute the code in local with SAM, it never fails but when execute the code in AWS Lambda containers two times in a short period of time, it produce this error: START RequestId: cbd8f1cf-a9a1-41eb-89e9-bedf5ba1a0f7 Version: $LATEST 2019-01-24 12:02:01 [scrapy.utils.log] INFO: Scrapy 1.5.2 started (bot: scrapybot) 2019-01-24 12:02:01 [scrapy.utils.log] INFO: Versions: lxml 4.3.0.0, libxml2 2.9.9, cssselect 1.0.3, parsel 1.5.1, w3lib

What is trusted entities in resulting role definition of Lambda?

岁酱吖の 提交于 2019-12-25 02:33:14
问题 Below is the SAM template, Resources: HelloWorldFunction: Type: AWS::Serverless::Function Properties: CodeUri: hello-world/ Handler: app.LambdaHandler Runtime: nodejs8.10 Policies: - AWSLambdaExecute for which, below is role(JSON) created for Lambda function: { "roleName": "somestack-HelloWorldFunctionRole-AAAAAAAA", "policies": [ {...}, # AWSLambdaExecute {...}, # AWSLambdaSQSQueueExecutionRole {....} # AWSLambdaBasicExecutionRole ], "trustedEntities": [ "lambda.amazonaws.com" ] } What is

Disable CloudWatch to monitor logs for Lambda function

旧时模样 提交于 2019-12-25 02:23:15
问题 Is there any possible way to disable CloudWatch to log Lambda Function's events? If possible, then what are the steps to do this. 回答1: As per my understanding log output is generated by as a default behavior if you do any tests with lambda function. However, the logs are stored in CloudWatch log group only if your lambda role has permission to write to CloudWatch. 来源: https://stackoverflow.com/questions/51166504/disable-cloudwatch-to-monitor-logs-for-lambda-function

How to have more than one handler in AWS Lambda Function?

≡放荡痞女 提交于 2019-12-25 02:16:46
问题 I have a very large python file that consists of multiple defined functions. If you're familiar with AWS Lambda, when you create a lambda function, you specify a handler, which is a function in the code that AWS Lambda can invoke when service executes my code, which is represented below in my_handler.py file: def handler_name(event, context): ... return some_value Link Source: https://docs.aws.amazon.com/lambda/latest/dg/python-programming-model-handler-types.html However, as I mentioned

Connection does not throw error but does not succeed either

≯℡__Kan透↙ 提交于 2019-12-25 01:55:31
问题 I am currently trying to connect to an amazon RDS from a lambda function. The problem I am facing is that I do not get an error but neither I manage to get a connection, so I am not sure how to proceed. I do not have a timeout, or an error with the parameters, but the object "con" is always null. To do this I am doing the following: Connection con = null; String jdbcUrl2 = "jdbc:mysql://" + "connectionValueExample-zone.rds.amazonaws.com" + ":" + "3306" + "/" + "botdb" + "?user=" + "bot" + "

AWS Lambda functions issue

故事扮演 提交于 2019-12-25 01:48:54
问题 I have recently started trying to use AWS Lambda functions. Here is what I get in the Execution results window of the Lambda console, when clicking the Test button. Response: { "statusCode": 500, "body": "{\"message\":\"Missing credentials in config\", \"code\":\"CredentialsError\",\"time\":\"2019-06-06T07:11:53.538Z\", \"originalError\":{\"message\":\"No credentials to load\", \"code\":\"CredentialsError\",\"time\":\"2019-06-06T07:11:53.538Z\"}}" } And here is the Lambda function source code

How to access SQL database in AWS Lamda?

流过昼夜 提交于 2019-12-25 01:47:41
问题 How can I establish a connection with the SQL database in Lamda function using Node.js? I want to get and post data in SQL database. Thanks 回答1: Running nodejs code in lambda is same as running same code on any other server or your local machine. You get the same nodejs runtime. There might be limitations when it comes to lambda such as package size, but there is no difference in how the code is executed. The link below shows, how to connect to mysql from nodejs https://www.w3schools.com

How to validate API Key in AWS Lambda function

孤者浪人 提交于 2019-12-25 01:47:03
问题 I have read quite a few articles like this one and it looks like currently in AWS API Gateway you cannot send API Key in query string. We also have few legacy clients that will need passing api-key in query string. So i thought of two options 1>Create lambda function as Integration Type and validate API in key inside function handler. But i am not able to figure out how to validate it against keys in aws. Something like public async Task<JObject> FunctionHandler(JObject request,

How to trigger response for Custom Intent?

回眸只為那壹抹淺笑 提交于 2019-12-25 01:37:05
问题 I created an Alexa 'riddle' skill recently and I'm having trouble with the utterances. I created an intent "GetRiddleIntent" then associated a few utterances e.g. "riddle me this" with that intent. I did not include any intent slots. When I test my skill, I have to use the invocation name in order to bring back results from lambda. The built in intents work upon invocation e.g. "LaunchRequest" & "Amazon HelpRequest" but none of the sample utterances for my custom intent return any results, I