When deploying a function from eclipse that needs to access an amazon service (dynamodb for example) i add the aws sdk library in project build path in order to gain access to aws services. This however results to a big jar which in result leads to big upload time in order to deploy and test the function. Is there an other way in order to make the jar lighter ?
-
You should give more details about what are you doing. Sizes maybe, what was included in your project.user4776684– user47766842015-08-15 22:48:52 +00:00Commented Aug 15, 2015 at 22:48
-
thx for the reply.I am trying to add an item to dynamodb from the lambda function. I am asking if there is another way than to include the whole aws sdk library.Nicholas Papadakos– Nicholas Papadakos2015-08-15 22:49:35 +00:00Commented Aug 15, 2015 at 22:49
-
1Yes, you could just include the DynamoDB module, this will substantially reduce the size of your JAR. java.awsblog.com/post/TxBSZ02ZOG3VPZ/…JaredHatfield– JaredHatfield2015-08-16 19:42:07 +00:00Commented Aug 16, 2015 at 19:42
-
hello, that was exactly what i was looking for. Thank you, off to try it.Nicholas Papadakos– Nicholas Papadakos2015-08-16 23:12:37 +00:00Commented Aug 16, 2015 at 23:12
3 Answers
I think you should use "maven" to add only the required dependencies. It will effectively reduce your jar size.
For required dependencies you can check the link given below: http://mvnrepository.com/artifact/com.amazonaws
Comments
If you want to use any Amazon services with Lambda function you don't have to include AWS-sdk library like AWS or even AWS-DynamoDB in project, simply add the reference for the AWS services you want to use.
As AWS Lambda is configured to use AWS-sdk libraries. If you are using services other than AWS then you have to include the supporting libraries.