2

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 ?

4
  • You should give more details about what are you doing. Sizes maybe, what was included in your project. Commented 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. Commented Aug 15, 2015 at 22:49
  • 1
    Yes, you could just include the DynamoDB module, this will substantially reduce the size of your JAR. java.awsblog.com/post/TxBSZ02ZOG3VPZ/… Commented Aug 16, 2015 at 19:42
  • hello, that was exactly what i was looking for. Thank you, off to try it. Commented Aug 16, 2015 at 23:12

3 Answers 3

2

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

Sign up to request clarification or add additional context in comments.

Comments

0

Maybe you could exclude all undesired libs from one specific dependency in pom.xml. Using this tag:

  <exclusions>
    <exclusion>  <!-- declare the exclusion here -->
      <groupId>sample.ProjectB</groupId>
      <artifactId>Project-B</artifactId>
    </exclusion>
  </exclusions> 

Comments

-1

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.