Home > Blockchain >  How to use the Eclipse Toolkit with the new AWS update (Expansion of AWS Lambda states to all functi
How to use the Eclipse Toolkit with the new AWS update (Expansion of AWS Lambda states to all functi

Time:10-25

I am very new to AWS and at the company I work for, I have been uploading Java Lambda functions to AWS using the AWS Toolkit for Eclipse. I simply right-click the project in Eclipse > click AWS Lambda > click upload function to AWS Lambda.

From there, my project is uploaded to Lambda. However, I received an email from AWS that mentioned they are rolling out changes that may have an impact certain workflows that attempt to invoke or modify a function shortly after a create or an update action. According to the error log

It is the same problem as this question that has no answers: SO question

CodePudding user response:

I decided to not use the Eclispe Toolkit anymore. Instead, I put all of the external jar files inside src/main/resources and wrote a batch script that will add those files to local maven repo like this. Example of two of the lines in my batch script. I do this for each file:

EHCO starting
CALL mvn install:install-file -Dfile="./src/main/resources/routines.jar" -DgroupId=talend-jars -DartifactId=test-eenav-routine -Dversion=1.0 -Dpackaging=jar
CALL mvn install:install-file -Dfile="./src/main/resources/currenttalendproject_0_1.jar" -DgroupId=talend-jars -DartifactId=test-eenav-main-talend-jar -Dversion=1.0 -Dpackaging=jar

CALL mvn package

At the end of the above of script I call CALL mvn package which produces my shaded JAR which can be uploaded to AWS Lambda.

Here is the pom file that shows my configuration for shaded plugin as well as the two dependencies I added to the local maven repo:

    <build>
        <sourceDirectory>src/main/java</sourceDirectory>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
            </resource>
        </resources>
        <testSourceDirectory>src/test/java</testSourceDirectory>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.6.0</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <encoding>UTF-8</encoding>
                    <forceJavacCompilerUse>true</forceJavacCompilerUse>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.2</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <finalName>Demo-SHADED</finalName>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>talend-jars</groupId>
            <artifactId>test-eenav-routine</artifactId>
            <version>1.0</version>
        </dependency>
        <dependency>
            <groupId>talend-jars</groupId>
            <artifactId>test-eenav-main-talend-jar</artifactId>
            <version>1.0</version>
        </dependency>
    </dependencies>
  • Related