aws-lambda

AWS JS SDK V3 (Lambda module) - Unable to connect to instance metadata service

偶尔善良 提交于 2020-01-25 09:45:09
问题 I was previously using the all-in-one aws-sdk npm module (https://www.npmjs.com/package/aws-sdk) to invoke an AWS Lambda function, and for that the following code had been working well: //Some code to get "credentials" ... const AWS = require('aws-sdk'); const lambda = new AWS.Lambda({ accessKeyId: credentials.accessKeyId, secretAccessKey: credentials.secretAccessKey, region: Config.REGION }); lambda.invoke(pullParams, (err, data) => //I would do something with data ); ... Now, taking a cue

python error sending mail with amazon ses with aws lambda

半世苍凉 提交于 2020-01-25 08:32:06
问题 I am new to aws lambda. I am trying to send mail with aws ses with aws lambda, without any triggers. Here is my code import boto3 from botocore.exceptions import ClientError ses = boto3.client('ses') email_from = 'proteeti@cloudly.io' email_to = 'proteeti13@gmail.com' emaiL_subject = 'Subject' email_body = 'Body' def lambda_handler(event, context): response = ses.send_email( Source = email_from, Destination={ 'ToAddresses': [ email_to, ], }, Message={ 'Subject': { 'Data': emaiL_subject },

Connecting from AWS Lambda to MongoDB

我的梦境 提交于 2020-01-25 08:29:07
问题 I'm working on a NodeJS project and using pretty common AWS setup it seems. My ApiGateway receives call, triggers lambda A, then this lambda A triggers other lambdas, say B or C depending on params passed from ApiGateway. Lambda A needs to access MongoDB and to avoid hassle with running MongoDB myself I decided to use mLab. ATM Lambda A is accessing MongoDB using NodeJS driver. Now, not to start connection with every Lambda A execution I use connection pool, again, inside of Lambda A code,

Not able to sign in with AWSMobileClient iOS. Getting AWSMobileClientError error 13

两盒软妹~` 提交于 2020-01-25 08:14:06
问题 I'm using the AWSMobileClient on iOS for authentication and I'm not able to sign in. I'm calling the signin method and all I'm getting is the following error: The operation couldn’t be completed. (AWSMobileClient.AWSMobileClientError error 13.) This error is useless to me and I can't find any decent documentation on what this error means. Has anyone seen this? Appreciate your help. 回答1: Please take a look at this https://github.com/aws-amplify/aws-sdk-ios/issues/1538#issuecomment-491905913

How to fix Unhandled rejection Error: Could not execute GraphicsMagick/ImageMagick in AWS LAMBDA (NodeJS)

北城以北 提交于 2020-01-25 08:07:51
问题 Unhandled rejection Error: Could not execute GraphicsMagick/ImageMagick: gm "identify" "-ping" "-format" "%p" "/tmp/temp.pdf" this most likely means the gm/convert binaries can't be found I have tried everything mentioned in similar questions. This is my first lambda function and I am stuck. Please find below how I am adding gm into my lambda function index.js // dependencies var AWS = require('aws-sdk'); var simpleParser = require('mailparser').simpleParser; const gm = require('gm').subclass

Updating a static website hosted on an AWS S3 Bucket

时光怂恿深爱的人放手 提交于 2020-01-25 03:58:31
问题 I need a better way to update a static website that is hosted in an AWS S3 bucket. Whenever I am wanting to update my personal site that I have hosted through a S3 bucket, I have to deleting the index.html file and the assets folder from the S3 bucket, then re-upload the new files. I am doing this through the AWS web interface. Is there a way to use a different AWS service to do this in a way similar to git where I can push updated code? Possibly with lambda? 回答1: You cant automate the whole

Updating a static website hosted on an AWS S3 Bucket

牧云@^-^@ 提交于 2020-01-25 03:58:26
问题 I need a better way to update a static website that is hosted in an AWS S3 bucket. Whenever I am wanting to update my personal site that I have hosted through a S3 bucket, I have to deleting the index.html file and the assets folder from the S3 bucket, then re-upload the new files. I am doing this through the AWS web interface. Is there a way to use a different AWS service to do this in a way similar to git where I can push updated code? Possibly with lambda? 回答1: You cant automate the whole

Copy DynamoDB table data cross account real time

ⅰ亾dé卋堺 提交于 2020-01-25 01:57:16
问题 What is the easiest approach (easiest implies low number of service maintenance overhead. Would prefer server less approach if possible) to copy data from a DDB table in one account to another, preferably in server less manner (so no scheduled jobs using Data pipelines). I was exploring possibility of using DynamoDB streams, however this old answer mentions that is not possible. However, I could not find latest documentation confirming/disproving this. Is that still the case? Another option I

Is there any event generated when tag is added to an existing S3 object?

爱⌒轻易说出口 提交于 2020-01-24 22:08:48
问题 I'd like to have an AWS lambda triggered when a tag is added to an existing object in S3 bucket (in the same way as we can do it for object create and remove). Any way to do that? 回答1: If you setup Cloudtail you could have a Lambda function monitor the logs and notify you on the tagging event PutBucketTagging Example Lambda function https://github.com/retailnext/aws-lambda-cloudtrail-alert Cloudtail Documentation http://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-user-guide

AWS S3 - PUT to URL from getSignedUrl() returns 403 SignatureDoesNotMatch error

六月ゝ 毕业季﹏ 提交于 2020-01-24 21:33:32
问题 This problem has been driving me nuts for two days now. The objective: Upload an image directly from the browser to S3 via a pre-signed URL supplied by the getSignedUrl function in the AWS Javascript SDK. I haven't had any problems generating URLs with getSignedUrl. The following code... const params = { Key: key, Bucket: process.env.S3_BUCKET, ContentType: "image/jpeg" }; S3.getSignedUrl("putObject", params, callback); ...yields something like: https://s3.amazonaws.com/foobar-bucket