How do I revise a live Alexa skill?
Asked Answered
P

2

8

I need to revise my published Alexa skill. I'm familiar with the "In Development" skill version which Amazon automatically creates after publishing a skill. What I don't understand is how do I iterate on my skill, particularly when I need to change the interaction model and the linked Lambda function at the same time?

For example, I could create a separate "In Development" Lambda function and make it my default endpoint for my "In Development" Alexa skill. But then when I submit my "In Development" Alexa skill for publication, that "In Development" Lambda endpoint would become the new endpoint for my published skill. I suppose that could work, and I think that's what Amazon intends, but I don't want to have to recycle my Lambda functions, reconfigure x-ray tracing, etc. I use the Serverless Framework to deploy the Lambda functions linked to my Alexa skills, and it versions my Lambdas for me.

What's the recommended workflow? I feel like I'm missing something basic here.

I couldn't find any Amazon documentation for this beyond "edit the development version," which is obviously inadequate. That page has a link to "Revise and Update Your Skill after Publication" but clicking it sends me to a page about skill distribution.

Pneumograph answered 11/10, 2018 at 16:21 Comment(0)
K
12

Alexa Skill

As you said when your skill is published you will have a live version and development version. Both the live version and the development version of your skill are shown on the developer console.

You can now make changes to the development version of the skill like: change in interaction model, endpoint change etc. Any change in the developer portal requires your skill to go through certification process.

When you submit your new version for certification, both versions remain in your list until the new version is certified. Once the new version is certified, it becomes live and replaces the previous live version. All the existing users will have the live/latest version of your skill. A new development version is then created so that you can continue making updates.

Lambda Function

When you create a Lambda function for the first time, the default version is Latest. The Latest is your development version, and you can make changes to this. During development you will use the arn of the Latest version (development version) of Lambda function in Alexa portal. Once you are done with the changes and updates of your Lambda function and you feel that this has to be released, you version it. When you publish a version (you can provide the version name) of the Lambda function, you will have two versions Latest and released-version. You will no longer be able to make changes to released-version of your Lambda. And you can continue making updates to the Latest version and release it as you wish.

It's always a good practice to publish a version of Lambda and use it in Alexa developer portal before you submit the skill for certification.

This way you can link the versioned uneditable Lambda to your live skill. And for the development version of the skill, you can use the Latest version of the same Lambda function to continue making updates.

More on versioning Lambda functions here.

Kier answered 11/10, 2018 at 18:10 Comment(11)
And in fact you can analyze and measure the performance of the one in use and the one you're testingMallett
Thank you for your thorough answer, Cicil. I feel I understand the Alexa Skill versioning flow fine, but I still don't have a clear vision for the linked Lambda functions. Could you give an example of what you described in your final paragraph?Pneumograph
Thanks for the update. I think this is fine for creating a new skill and new lambda but I don't think this works well for editing an existing live skill and its associated lambda. Given a skill and its lambda are live (released-version), and I've made changes to the separate development versions of each (latest), when I'm ready to submit for certification then I'd have to create a 3rd lambda: release-candidate-version. I'd have to do this every time I want to make changes to my live skill. And I have a skill that requires 9 lambdas, a gateway, and a Dynamo DB. Three versions of everything? :(Pneumograph
This works fine with existing skill and Lambdas. Only release a version if it's required. If your skill has only interaction model changes then you don't have to release another version of Lambda. If you only have changes in only one Lambda, you only have to release a version of that particular Lambda. Likewise, release a version when its only required. Certification process is only for changes in Alexa developer portal.Kier
Thank you for your answer. I'll keep thinking on it. Perhaps this really is the best way to do it and I just need to stop whining that Amazon doesn't have a better toolset for deploying changes. :DPneumograph
By versioning you make your Lambda code uneditable. And your live skills backend is safe from edits.Kier
So to be clear, we keep using the term "version" when talking about the Lambda... but actually each "version" is a separate lambda function, no?Pneumograph
Each version is a variation of your Lambda function in your development workflow, such as development, beta, and production.Kier
I'm confused... a variation of the same lambda function, or a separate lambda function for each variation? I don't understand what you're saying.Pneumograph
Variation of the same Lambda function. Imagine it like the different revisions of a checked-in file in git.Kier
Ah okay! Now I'm following. :) Thank you! I just found this docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.htmlPneumograph
M
0

Alexa creates development and a live version of the skill. You can change the development version to include the updates. For me when specifying the AWS Lambda arn, I couldn't specify the version field. Whenever I tried saving ARN with version set to $Latest or a version number or an alias, Alexa developer console was giving an error. So I created 2 lambda functions. One, pointing to the old version of skill and the other one pointing to the new version of the skill.

Marcellemarcellina answered 30/4, 2019 at 17:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.