aws-lambda

list_datasets() method does nothing in AWS Lambda

两盒软妹~` 提交于 2019-12-23 04:56:23
问题 I am trying to get the list of datasets from BigQuery inside the AWS lambda. But, while executing the client.list_datasets() method it does nothing and lambda is timed out. My code is as follows: from google.cloud.bigquery import Client from google.oauth2.service_account import Credentials credentials = Credentials.from_service_account_info( service_account_dict) client = Client( project=service_account_dict.get("project_id"), credentials=credentials ) datasets = client.list_datasets() print

aws - java8 - Can not deserialize instance of java.lang.String out of START_OBJECT token

别说谁变了你拦得住时间么 提交于 2019-12-23 03:12:09
问题 java newbie. I've compiled with java 8 javac HelloWorld.java --release 8 and uploaded the complied file as the aws lambda code. Why am I getting the error when i run it in aws lambda? public class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World"); } } Error An error occurred during JSON parsing: java.lang.RuntimeException java.lang.RuntimeException: An error occurred during JSON parsing Caused by: java.io.UncheckedIOException: com.fasterxml.jackson

Fork and Join with Amazon Lambda

吃可爱长大的小学妹 提交于 2019-12-23 02:20:13
问题 I am trying to write a lambda function that triggers many small lambdas exports.handler = (event, context, callback) => { var AWS = require('aws-sdk'); let noOfPages = 20, currentPage = 1; var message = ''; //let payloadArray = []; while(currentPage <= noOfPages){ message = '{"first_page": '+ currentPage +', "last_page": '+ (currentPage) + ', "file_name" : "something.doc"' +'}'; console.log(message); var params = { FunctionName: 'test', InvocationType: 'Event', LogType: 'Tail', Payload:

module initialization error: Cannot load native module 'Crypto.Cipher._raw_ecb' at AWS lambda

陌路散爱 提交于 2019-12-23 01:58:10
问题 I am making service using AWS lambda. I am using PyCryptodome for encryption and decryption. I am able to test my application locally, but when I upload to AWS lambda for decrypting. I get the error as module initialization error: Cannot load native module 'Crypto.Cipher._raw_ecb': Trying '_raw_ecb.cpython-36m-x86_64-linux-gnu.so': /var/task/Cryptodome/Util/../Cipher/_raw_ecb.cpython-36m-x86_64-linux-gnu.so: cannot open shared object file: No such file or directory, Trying '_raw_ecb.abi3.so':

AWS DynamoDB query not filtering on BOOL value

狂风中的少年 提交于 2019-12-23 01:52:11
问题 I have a users table that was create with the GUI and given a partion key of email and it is a string. I then used aws lambda to do a putItem that had: email (string) test@testing.com deleted (BOOL) false This worked fine. I then tried to query it with lambda using the following params and query: var params = { TableName : 'Users', KeyConditionExpression : 'email = :email', FilterExpression : 'deleted = :deleted', ExpressionAttributeValues : { ':email' : email, ':deleted': { BOOL: false } } }

How can I dynamically update my AWS CloudWatch dashboards?

自古美人都是妖i 提交于 2019-12-23 01:37:37
问题 I have several dashboards in CloudWatch that represent a static view of my infrastructure, for instance, how many instances from an autoscaling worker group are currently running, or the CPU/disk status of various key EC2 instances. However, when I add new instances, I am always stuck manually updating the dashboards to include them in the display. I'm curious if there is there any way to programmatically populate these dashboards, say through a CLI/API call using an AWS Lambda function? It

How can I invoke an AWS Lambda function from my EC2 instance?

↘锁芯ラ 提交于 2019-12-22 13:00:36
问题 I wrote a lambda function to take over some of the multithreaded code in our web app. Now, I'm looking to manually invoke the lambda function from an ASP.NET controller and then pass the function's return value back to the end-user. I thought about using AWS SQS to invoke the function but I haven't the slightest idea how to grab the return function's return value (the value passed back with context.succeed(returnData); ). Any ideas? 回答1: AWS Lambda now supports synchronous ("RequestResponse")

Cloudformation template to trigger Lambda on S3 event

做~自己de王妃 提交于 2019-12-22 12:29:30
问题 I want to use Cloudformation to create an S3 bucket that will trigger Lambda function whenever an S3 event occurs such as file creation, file deletion, etc. From my research, I have my AWS::Lambda::Function and AWS::S3::Bucket setup, AWSTemplateFormatVersion: '2010-09-09' Resources: HandleFileCreation: Type: "AWS::Lambda::Function" Properties: ... LambdaExecutionRole: Type: AWS::IAM::Role Properties: ManagedPolicyArns: - arn:aws:iam::aws:policy/AmazonS3FullAccess - arn:aws:iam::aws:policy

Getting s3 object metadata then creating stream

删除回忆录丶 提交于 2019-12-22 11:35:30
问题 I'm downloading an object from s3 and creating a read stream object from it to process a video: s3.getObject(params).createReadStream() However, I need to get the metadata from it which is possible when i just get the object by accessing its 'metadata' property: s3.getObject() How would I either: Get the object via s3.getObject() , grab the metadata from its metadata property, and then turn it into a read stream? var stream = fs.createReadStream(response); isn't working - input must be a

Running AWS Firehose in lambda.js gives an undefined error

試著忘記壹切 提交于 2019-12-22 09:25:06
问题 var AWS = require('aws-sdk'); var firehose = new AWS.Firehose(); Running above code in lambda with proper roles configured, AWS returns errorMessage": "undefined is not a function Anyone have an idea how can I get firehouse to load in aws-sdk? 回答1: I opened ticket, with amazon and they verified firehouse isn't working with lambda, yet is working ec2. They have escalated the issue to a service-team in order to support FireHose. 回答2: If you update aws-sdk module to version 2.3.19 you should not