aws-lambda

Testing AWS Lambda locally

别来无恙 提交于 2019-12-25 09:50:00
问题 I am about to write a server component targeting AWS lambda. How do I develop this locally without having to deploy this every time I make a change? 回答1: Without knowing more about your project, the only thing I can recommend is for you to build a minimal web server application that will create your event object based on the request that you send. In NodeJS, you can do this by writing a minimal express server that invokes your lambda handler in its route handler. If you use serverless

how do i apply security configuration on existing emr cluster using boto3?

安稳与你 提交于 2019-12-25 09:42:30
问题 I am new to aws emr services. I am trying to add security configuration to already created emr cluster using boto3. Please reply if it is possible to do so or is there any alternative solution to achive the same 回答1: The Specifying Amazon EMR Encryption Options Using a Security Configuration documentation page says: Using a security configuration to specify cluster encryption settings is a two-step process. First, you create a security configuration, which you can use for any number of

AWS Lambda Node.js execute this.emit after async HTTP request completes

感情迁移 提交于 2019-12-25 09:25:50
问题 I am making an API request and would like to ask the user a question with the data returned from the request. I make a call to a function, which executes the request and returns the appropriate response: httpRequest(params).then(function(body) { console.log(body); this.emit(':ask', speechOutput, repromptSpeech); }); The this.emit function returns an unhandled promise rejection error. How can I wait for the request callback to be executed and then issue the :ask event? 回答1: The this inside the

Using AWS Developer Identities for Authentication for iOS (Objective-c)

半城伤御伤魂 提交于 2019-12-25 09:06:28
问题 I use the latest version of aws-ios-sdk with Objective-C which is 2.4.16 I think. I used Lambdaauth from the internet as a baseline. I did all the Lambda functions in node 4.3 and then access them from my iOS device using the the api gateway. So for instance after a user has registers I call a class in my iOS (auth class) that uses NSURLSessions and NSURLRequests to pass the JSON back and forth to the gateway which calls the appropriate Lambda function. So to login it passes in the email and

When and when not to use aws lambda functions [closed]

旧时模样 提交于 2019-12-25 08:39:03
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago . I have a general understanding of serverless architecture. I was wondering what are the top pro's and con's using this architecture compared to the previous generally used architectures. 回答1: Pros Invoke Lambda Functions only during event triggering VS keeping Instance(s) idle for

Parsing a csv file to populate database

你离开我真会死。 提交于 2019-12-25 08:16:51
问题 Given I have a csv file such as this str_name,int_points,int_bonus joe,2,5 Moe,10,15 Carlos,25,60 I can have csv file with x number of columns and y number of rows so i am trying to develop a generic method to parse it and populate data in to dynamodb table. In order to populate the dynamodb table i would do something like this String line = ""; String cvsSplitBy = ","; try (BufferedReader br = new BufferedReader( new InputStreamReader(objectData, "UTF-8")); while ((line = br.readLine()) !=

How to get status code in Angularjs?

放肆的年华 提交于 2019-12-25 07:52:37
问题 We use aws and swagger, also we have a service with getData method var getData = () => { return $http({ method: 'GET', url: 'myURL', headers: { 'Authorization': 'token' } }); }; I'm trying to use it with bellow code dataservice.getData().then(response => { console.log(response) }) .catch((err) => { console.log(err)); }) And for good request (when I'm autorized) it works fine, I get my data, but then token is not valid I'm gettin error whitout status code in console Object {data: null, status:

Reading AWS Dynamodb Stream

寵の児 提交于 2019-12-25 07:37:11
问题 I want to do an incremental DynamoDB backup on S3 using DynamoDB Streams. I have a lambda that reads the dynamodb stream and writes files into S3. In order to mark already read shards I have ExclusiveStartShardId logged into configuration file. What I do is: Describe the stream (using the logged ExclusiveStartShardId) Get stream's shards For all shards that are CLOSED (has EndingSequenceNumber) I do the following: Get shard iterator for the certain shard (shardIteratorType: 'TRIM_HORIZON')

AWS Lambda - Buffered reader

寵の児 提交于 2019-12-25 06:32:39
问题 I am using Java on AWS Lambda to get the URL source code of the site. I have the following code: URL yahoo = new URL(url); URLConnection yc = yahoo.openConnection(); yc.addRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"); BufferedReader in = new BufferedReader(newInputStreamReader(yc.getInputStream(), "UTF-8")); String inputLine; StringBuilder a = new StringBuilder(); while ((inputLine = in.readLine()) != null)a.append(inputLine); in.close(); System.out

AWS Lambda - Buffered reader

…衆ロ難τιáo~ 提交于 2019-12-25 06:30:03
问题 I am using Java on AWS Lambda to get the URL source code of the site. I have the following code: URL yahoo = new URL(url); URLConnection yc = yahoo.openConnection(); yc.addRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"); BufferedReader in = new BufferedReader(newInputStreamReader(yc.getInputStream(), "UTF-8")); String inputLine; StringBuilder a = new StringBuilder(); while ((inputLine = in.readLine()) != null)a.append(inputLine); in.close(); System.out