aws-lambda

Cassandra database session reuse in AWS Lambda (python)

旧时模样 提交于 2019-12-23 19:13:12
问题 I am trying to reuse a Cassandra cluster session for subsequent AWS Lambda function calls. I've successfully implemented it in Java, but reusing the session in the python gets the lambda invocation timed out (the first call which actually performs the initialization is ok). From the CloudWatch logs I can see I get a Heartbeat failed for connection . It looks to me that the session is not able to communicate while idle, and that it gets in an inconsistent state in which is not able to resume

Getting permissions exception when calling amazondax service

白昼怎懂夜的黑 提交于 2019-12-23 19:08:00
问题 I'm using the amazondax service from an AWS Lambda method, and getting an exception that indicates missing permissions - but I don't know what permissions are necessary for this. Both the Lambda method and my DAX cluster are setup with the same VPC subnets and security groups. I'm getting the following exception: [ERROR] 2018-12-11T23:06:50.457Z 70c80374-fd99-11e8-bac1-318371e7b8ed Failed to retrieve endpoints Traceback (most recent call last): File "/var/task/amazondax/Cluster.py", line 211,

How to get API gateway url in AWS lambda function?

守給你的承諾、 提交于 2019-12-23 19:01:07
问题 I have a scenario where I am using an API URL to invoke lambda function. After invoking the lambda function, I want that particular URL in the lambda function. https://******.execute-api.eu-west-1.amazonaws.com/test/first https://******.execute-api.eu-west-1.amazonaws.com/test/second From this URL, I want the resource named first or second in lambda. Here the test is the stage name where I deplou\y my API. I have multiple resources created from that I want to change the behavior of lambda.

Amazon AWS Lambda Alexa HTTP Get issue

戏子无情 提交于 2019-12-23 18:29:06
问题 I keep getting an issue with the following code with Amazon Lambda and the alexa skills kit. I have spent countless hours on this and cannot get it to work. I keep getting this message returned and can't figure out why the http get is failing. "Please try again later". It isn't even printing the console messages. var Alexa = require('alexa-sdk'); var http = require('http'); var APP_ID = "omitted"; var SKILL_NAME = 'omitted'; var options = { host: 'api.forismatic.com', path: '/api/1.0/?method

How to access dataset of an identity in cognito federated identities from lambda

旧街凉风 提交于 2019-12-23 18:19:53
问题 Let me start with the overall description of what I'm trying to achieve. I'm building a serverless API using Lambda, Cognito (Federated Identities), API Gateway etc. I'm using aws_iam as the authorizer in API Gateway. In some endpoints, I need to access for example user e-mail or username or whatever so I can send it back in the response (also data of users who did not make the request). I guess I'm looking for some kind of "admin" access to the identity pool so I can retrieve data based on

AWS Lambda:The provided execution role does not have permissions to call DescribeNetworkInterfaces on EC2

狂风中的少年 提交于 2019-12-23 18:04:11
问题 Today I have a new AWS Lambda question, and can't find anywhere in Google. I new a Lambda function, there is no question. But when I input any code in this function[eg. console.log();] and click "Save", error is occured: "The provided execution role does not have permissions to call DescribeNetworkInterfaces on EC2" exports.handler = (event, context, callback) => { callback(null, 'Hello from Lambda'); console.log(); // here is my code }; I bound the function with Role: lambda_excute_execution

How to run AWS SDK Opsworks Commands in AWS Lambda?

允我心安 提交于 2019-12-23 16:59:38
问题 I've got a very simple lambda function trying to use the AWS SDK to call opsworks.describeInstances. The code executes locally fine, however inside lambda, it times out with no error or feedback. var AWS = require('aws-sdk'); var opsworks = new AWS.OpsWorks({ apiVersion: 'latest', region: "us-east-1" }); exports.handler = function(event, context, callback) { var params = { LayerId: 'idoflayer' }; opsworks.describeInstances(params, function(err, data) { if (err) { return callback(err); }

How to compile c++ library to be used in AWS Lambda?

前提是你 提交于 2019-12-23 16:03:14
问题 I haven't tried it yet, but I know you can supposedly run AWS Lambda functions in Java and reference C++ libraries from them. How do you compile the C++? 回答1: I was struggling to do exactly what you ask only a few days ago when I've stumbled upon this article: http://www.glfrc.com/2018/01/19/aws-lambda-with-java-and-native-code/ You basically have 2 options: on an Amazon Linux EC2 machine. on any machine running docker by using the Amazon Linux docker image. The article explains the second

amazon aws lamba function with spring autowired dependencies

依然范特西╮ 提交于 2019-12-23 15:52:12
问题 when code is executed in amazon aws lambda, my @autowired spring dependencies are null. Makes sense if there is no context being loaded, but i thought SpringBeanAutowiringSupport would help. How do you inject dependencies correctly in amazon lambda? This is my code that has null autowired fields but otherwise works fine (if i replace autowired with new: @Component public class ApplicationEventHandler { @Autowired private Foo foo; public ApplicationEventHandler() { logger.info("I'm sure the

AWS Lambda. Invoke with delay

时光毁灭记忆、已成空白 提交于 2019-12-23 15:44:54
问题 I need to build "tasks scheduler" with Amazon tools. Main problem that i need execute task once with huge delay (it may be a few hours or few weeks). I try to research how to build it with CloudWatch and Lambda function. As i understand - i need to use separate rule for one timeout execution. But AWS allow me only 100 rules/account. Probably i'm going wrong way and this tools not intended for my task. Also i tried SQS, but it did't allow me to set timeout more than 15 minutes. The simplest