Aws-toolkit-jetbrains: Invalid directory error on SAM build

Created on 25 Sep 2019  路  4Comments  路  Source: aws/aws-toolkit-jetbrains

Realize that this is my first Lambda and I am trying to test it locally. I am not sure if this is a bug or a configuration issue on my end.

To reproduce

This is running the lambda via right clicking on the lambda symbol in the left column of the Handler and select run (or debug) local.

Expected behavior
Just hoping it will build and run.

C:\Users\eb96409AppData\Roaming\Python\Python37\Scripts\sam.exe build --template C:\REGAPI\hubintergration\template.yaml --build-dir C:\REGAPI\hubintergration.aws-sam\build HandlerFunction
2019-09-24 14:38:10 Building resource 'HandlerFunction'
2019-09-24 14:38:12 Running JavaMavenWorkflow:CopySource

Error: JavaMavenWorkflow:CopySource - [WinError 267] The directory name is invalid: 'C:\REGAPI\hubintergration\vvAuth.jar'
Build Failed

AWS toolkit 1.6

IntelliJ IDEA 2019.2.2 (Ultimate Edition)
Build #IU-192.6603.28, built on September 6, 2019
Runtime version: 11.0.3+12-b304.56 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0
GC: ParNew, ConcurrentMarkSweep
Memory: 1946M
Cores: 12

C:\Users\eb96409>sam --version
SAM CLI, version 0.16.1

needs-response sam

Most helpful comment

Me: Should it be referenced somewhere in the official documentation?
Amazon: Does the Pope shit in the woods?

All 4 comments

Could you please share the HandlerFunction resource from your SAM Template? I am wondering if your CodeUri and/or Handler fields are set up correctly.

An example of the "hello world" sample that gets created from the Toolkit looks like this:

Resources:
  HelloWorldFunction:
    Type: AWS::Serverless::Function
    Properties:
      CodeUri: HelloWorldFunction  # This is the folder relative to the template.yaml file
      Handler: helloworld.App::handleRequest # This is the Lambda handler signature
      Runtime: java8

This could be the same issue as https://github.com/awslabs/aws-lambda-builders/issues/113 - sam build currently expects the CodeUri property to point to the root of the Maven project, not the build artifact (jar file).

Me: Should it be referenced somewhere in the official documentation?
Amazon: Does the Pope shit in the woods?

is this going to be fixed? this basically prevents us from using assembly zips when using jetbrains toolkit

Was this page helpful?
0 / 5 - 0 ratings