aws-sdk

Uploading screenshot from AWS lambda to s3 bucket fails

家住魔仙堡 提交于 2019-12-13 06:19:40
问题 I am trying to take screenshots with puppeteer on aws lambda and upload the screenshot to a s3 bucket. However, the s3.putObject method doesn't seem to be working. On the lambda console, I got both the "uploading screenshot 's3://${s3bucket}/${filename}'" and "uploading completed" message but not the "inside callback" message. The weird thing is, I got no error during the lambda execution, but I just couldn't get the message inside the putObject method and couldn't find the screenshots in the

How to access additional AWS resources from within an Amplify generated Lambda function?

浪尽此生 提交于 2019-12-13 03:55:55
问题 I've been playing around with AWS Amplify. Being relatively new to AWS I'm a huge fan of how Amplify provisions the necessary resources and IAM roles on AWS for me. My question is in regards to using Lambda with GraphQL. Following the documentation I'm able to create a custom GraphQL query that calls a Lambda function and returns a GraphQL response. However, I can't find anywhere in the documentation on how to interact with other AWS resources from within this Lambda function. For example, I

Is there a node.js default credential provider chain?

一个人想着一个人 提交于 2019-12-13 03:31:02
问题 I'm writing a node.js app that uses the AWS SDK. I'm looking at the java documentation, and it describes a very convenient concept called the default credential provider chain. When I read the documentation on the Node.js api, I don't see it describe the same concept: https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/setting-credentials-node.html I'm hoping that node/javascript has this as an undocumented feature. Does the javascript api provide a default credential provider

Nothing inside the S3 API's getObject callback is running in Lambda function

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-13 03:23:48
问题 I'm having a problem where I can't read my file from S3... or even get inside the S3 callback. I'm using node 8.10 for my lambda, and I've verified everything is running until I try to get inside of getObject -- the console.log below won't even run. Does anything look askew here? I've granted full access to lambda and S3, so I don't think that's the issue. const AWS = require('aws-sdk') exports.handler = async (event, context, callback) => { const s3options = { accessKeyId: process.env.AWS

Uncaught Error: Script error for “aws-sdk”

↘锁芯ラ 提交于 2019-12-13 03:18:18
问题 Trying to use the AWS SDK for node but I get this error Uncaught Error: Script error for "aws-sdk" Heres my code. I tried using require('aws-sdk'), but the console error than said to use require([],()=>{}) I downloaded both require and aws-sdk from npm require(['aws-sdk'], (AWS) => { let email = document.getElementById('footerEmail'); let emailSubmit = document.getElementById('footerButton'); AWS.config.update({ region: 'us-east-1' }); let sns = new AWS.SNS(); let params = { Protocol: 'email'

Using AWS Javascript SDK with NativeScript

六眼飞鱼酱① 提交于 2019-12-13 01:29:19
问题 I'm planning to build an app using Nativescript. However, I want to integrate AWS services in the app architecture. Please, can someone tell me whether I can use AWS JS SDk with nativescript or not. If yes, how? Thank you. 回答1: Yes, you can use AWS SDK with NativeScript. I am using it to upload files to S3. You need to install it using npm i aws-sdk File upload to AWS S2 example In your component file, import it import * as AWS from 'aws-sdk'; const AWSService = AWS; const region = 'Your

How can I download the content of a file from S3 bucket into memory with ruby?

試著忘記壹切 提交于 2019-12-13 00:12:42
问题 New to ruby here, I have a bucket in Amazon AWS S3 which has a file in it called users.csv How can I load the content of this file from the S3 bucket into memory with ruby? I want to be able to parse the content of this file after I have it loaded into memory. Here is my code: require 'aws-sdk' s3 = Aws::S3::Resource.new(region: 'us-west-1') resp = s3.list_objects(bucket: 'bucket-name', max_keys: 1) resp.contents.each do |object| puts #{object.value} end When I try this in IRB i get: struct

How execute Spring integration flow in multiple threads to consume more Amazon SQS queue messages in parallel?

自作多情 提交于 2019-12-12 16:15:22
问题 need help I need to create multiple sqs queue consumers that execute in parallel, but i don't know how to achieve this using Sprint Integration I have the following architecture An Amazon SQS queue with 200k messages A Amazon stack with 5 EC2 instances, every instance with tomcat server running a Spring boot application with a Spring Integration flow that consume the messages of SQS using sqs-message-driven-channel-adapter from spring-integration-aws (https://github.com/spring-projects/spring

S3.getSignedUrl to accept multiple content-type

五迷三道 提交于 2019-12-12 16:10:10
问题 I'm using the react-s3-uploader node package, which takes in a signingUrl for obtaining a signedUrl for storing an object into S3. Currently I've configured a lambda function (with an API Gateway endpoint) to generate this signedUrl. After some tinkering, I've got it to work, but noticed that I have to define in my lambda function the content-type , which looks like this: var AWS = require('aws-sdk'); const S3 = new AWS.S3() AWS.config.update({ region: 'us-west-2' }) exports.handler =

AWS API to get Alexa voice

拥有回忆 提交于 2019-12-12 15:11:43
问题 Does anyone know if there is an AWS API or similar that would allow me to send in text (or SSML), and get back the audio of Alexa 'speaking' it. Crucially, I want the output in Alexa's 'voice' The options I have explored so far are: AWS Polly This was my first port of call and sounds promising, and simple to interact with; but the available voices do not include Alexa's voice (I think the GB voice for Alexa is 'Abbey') If I didn't need the voice to be Alexa's, I'd probably be using this idea