question

benlikeshotchocolate avatar image
benlikeshotchocolate asked

Ask CLI wont deploy

Hi there. I'm stuck with a problem of the ask cli. The cli deploy command wont update my lambda function, eben though i made local changes to my project:

$ ask deploy -t lambda
[Info]: No lambda functions need to be deployed.

Help is very much appreciated!

alexa skills kitask cli
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Ron Wang avatar image
Ron Wang answered

Hi Ben,

I guess I see the reason why you have a response with "No lambda functions need to be deployed".

This is because for the intelligent commands in CLI, like "ask deploy", we use the "sourceDir" field in skill.json to decide if there is a Lambda folder or not. Currently there is no such field in your skill.json, so CLI cannot find any lambda code and no deploy for it. I guess you do have a lambda code folder inside the skill to be deployed. Please try to modify it to the format shown below and LMK if this solves your problem!

"apis": {
  "custom": {        
    "endpoint": {          
      "sourceDir": "lambda/custom" (or the true relative path for your lambda folder)    
    },        
    "interfaces": []      
  }
}
1 comment
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

benlikeshotchocolate avatar image benlikeshotchocolate commented ·

Hi Ron, First of all thank you so much! Indeed, this solved my problem.

Deploying my project is so much easier now, not having to go through the hassle of manually zipping the files, navigating to the site and uploading everything there.

Again, thanks a lot! -Ben

0 Likes 0 ·
Anand@Amazon avatar image
Anand@Amazon answered

Hi benlikeschocolate,

It looks like your lambda code doesn't have execution permission. Please add AWSLambdaBasicExecutionRole in your IAM role and grant execution permission to lambda function.

http://docs.aws.amazon.com/lambda/latest/dg/intro-permission-model.html#lambda-intro-execution-role

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

benlikeshotchocolate avatar image
benlikeshotchocolate answered

Hi Anand, thanks a lot for trying to help out! I added the role AWSLambdaBasicExecutionRole to my IAM rule as you described, but unfortunately it didn't solve my issue. Really not sure what else to do...

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Ron Wang avatar image
Ron Wang answered

Hi benlikeshotchocolate,

First, I also like hot choc, shake hands!

Then in terms of your problem, can you provide your "apis" object from skill.json, along with your "merge" object from .ask/config?

For the logic under the hood, the field in "merge" logic will literally merge the same field in skill.json before "ask deploy". So I'm thinking your lambda information is unexpectedly changed after the merge, and the CLI doesn't recognize it anymore. So can you provide the 2 schemas mentioned above? Thanks!

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

benlikeshotchocolate avatar image
benlikeshotchocolate answered

Hi Ron, thanks for trying to help, and yeah, hot choc is awesome ;)

Alright here are the config objects you were asking for:

./ask/config

      "merge": {
        "skillManifest": {
          "apis": {
            "custom": {
              "endpoint": {
                "uri": "arn:aws:lambda:eu-west-..."
              }
            }
          }
        }
      }

skill.json

    "apis": {
      "custom": {
        "endpoint": {
          "uri": "arn:aws:lambda:eu-west-..."
        },
        "interfaces": []
      }
    }

So far I couldn't spot any issue there..

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hondo avatar image
Hondo answered

I am having the same issue. I am able to deploy the Skill the first time, but subsequent attempts to re-deploy result in "Create Lambda error. ResourceConflictExcetion: Function already exist:". Has anyone successfully re-deployed a Skill with ask-cli after the initial creation?

1 comment
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Anand@Amazon avatar image Anand@Amazon ♦ commented ·

Hi Hondo,

Let's assume you created your alexa skill project in your local system so for re-deploy simply move it to that folder and if you want to re-deploy the whole project then run this command on terminal

$ ask deploy

If you updated only lambda function not the interaction model and skill.json file then run below command:

$ ask deploy -t lambda
0 Likes 0 ·