Yandex Cloud
Search
Discuss with expertTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Tutorials
    • All tutorials
        • Overview
        • Management console, CLI, and API
        • Terraform
      • Building a skill for Alice and a website with authorization

In this article:

  • Getting started
  • Create the infrastructure
  • Add the function link to the Alice's skill
  • Test the skill
  • How to delete the resources you created
  1. Application solutions
  2. Alice
  3. Creating a skill for Alice
  4. Terraform

Creating a skill for Alice using Terraform

Written by
Yandex Cloud
Updated at July 8, 2026
View in Markdown
  • Getting started
  • Create the infrastructure
  • Add the function link to the Alice's skill
  • Test the skill
  • How to delete the resources you created

To create a skill for Alice using Terraform:

  1. Get your cloud ready.
  2. Create the infrastructure.
  3. Add the function link to the Alice's skill.
  4. Test the skill.

If you no longer need the resources you created, delete them.

Getting startedGetting started

Sign up for Yandex Cloud and create a billing account:

  1. Navigate to the management console and log in to Yandex Cloud or create a new account.
  2. On the Yandex Cloud Billing page, make sure you have a billing account linked and it has the ACTIVE or TRIAL_ACTIVE status. If you do not have a billing account, create one and link a cloud to it.

If you have an active billing account, you can create or select a folder for your infrastructure on the cloud page.

Learn more about clouds and folders here.

Create the infrastructureCreate the infrastructure

With Terraform, you can quickly create a cloud infrastructure in Yandex Cloud and manage it using configuration files. These files store the infrastructure description written in HashiCorp Configuration Language (HCL). If you change the configuration files, Terraform automatically detects which part of your configuration is already deployed, and what should be added or removed.

Terraform is distributed under the Business Source License. The Yandex Cloud provider for Terraform is distributed under the MPL-2.0 license.

For more information about the provider resources, see the guides on the Terraform website or its mirror.

To create an infrastructure with Terraform:

  1. Install Terraform, get the authentication credentials, and specify the Yandex Cloud provider source (see Configure your provider, Step 1).

  2. Set up your infrastructure description file:

    Ready-made configuration
    Manually
    1. Clone the repository containing the configuration files and function code examples:

      git clone https://github.com/yandex-cloud-examples/yc-serverless-alice-skill
      
    2. Navigate to the repository directory. It should now contain the following files:

      • alice-skill.tf: New infrastructure configuration.
      • alice-skill.auto.tfvars: User data.
      • parrot.py: File with the function code in Python.
      • index.js: File with the function code in Node.js.
    3. Prepare the code for the Alice's skill. To create a new function version, you will upload its code to Yandex Cloud Functions as a ZIP archive.

      Python
      Node.js

      Add the parrot.py file from the cloned repository to the parrot-py.zip archive.

      Add the index.js file from the cloned repository to the parrot-js.zip archive.

    1. Prepare the code for the Alice's skill. To create a new function version, you will upload its code to Yandex Cloud Functions as a ZIP archive.

      Python
      Node.js
      1. Download the parrot.py example file from the GitHub repo.
      2. Create a ZIP archive named parrot-py.zip with the parrot.py file.
      1. Download the index.js example file from the GitHub repo.
      2. Create a ZIP archive named parrot-js.zip with the index.js file.
    2. Create a folder for the infrastructure description file.

    3. Create a configuration file named alice-skill.tf in the folder:

      alice-skill.tf
      # Declaring variables
      
      variable "folder_id" {
        type = string
      }
      
      variable "file_path" {
        type = string
      }
      
      variable "language" {
        type = string
      }
      
      # Configuring the provider
      
      terraform {
        required_providers {
          yandex = {
            source = "yandex-cloud/yandex"
          }
        }
        required_version = ">= 0.13"
      }
      
      provider "yandex" {
        folder_id = var.folder_id
      }
      
      # Creating a function and a function version
      
      resource "yandex_function" "alice_parrot" {
        name               = "alice-parrot"
        description        = "Yandex Alice skill: Parrot (repeats user input)"
        runtime            = var.language == "python" ? "python312" : "nodejs18"
        entrypoint         = var.language == "python" ? "parrot.handler" : "index.handler"
        memory             = 128
        execution_timeout  = 2
      
        content {
          zip_filename = var.file_path
        }
      
        user_hash = filesha256(var.file_path)
      }
      
    4. In the folder, create a user data file named alice-skill.auto.tfvars:

      alice-skill.auto.tfvars
      folder_id         = "<folder_ID>"
      file_path         = "<local_path_to_function_code_archive>"
      language          = "<programming_language>"
      

    Learn more about the properties of resources used in Terraform in this provider guide.

  3. In the alice-skill.auto.tfvars file, set the following user-defined properties:

    • folder_id: Folder ID.

    • file_path: Local path to the archive file with the function code. Here is an example: /Users/myuser/Temp/parrot-py.zip.

    • language: Depending on the function language, specify:

      • python if using the Python example.
      • nodejs if using the Node.js example.
  4. Create the resources:

    1. In the terminal, navigate to the configuration file directory.

    2. Make sure the configuration is correct using this command:

      terraform validate
      

      If the configuration is valid, you will get this message:

      Success! The configuration is valid.
      
    3. Run this command:

      terraform plan
      

      You will see a list of resources and their properties. No changes will be made at this step. Terraform will show any errors in the configuration.

    4. Apply the configuration changes:

      terraform apply
      
    5. Type yes and press Enter to confirm the changes.

Add the function link to the Alice's skillAdd the function link to the Alice's skill

Yandex Dialogs UI
  1. Go to the Alice skill page in your dashboard.

  2. Click Skill for Alice and do the following in the window that opens:

    1. In the Skill name field, specify a unique name for the skill you are creating.

    2. In the Backend field, select Function in Yandex Cloud. Select the function you created earlier from the drop-down list.

      Warning

      The list shows the functions that you are allowed to view. To attach a function to a skill, you need permission to invoke the function. This permission comes with the functions.functionInvoker role or higher.

    3. Leave all the other parameter values unchanged and click Save at the top of the page.

The functions.functionInvoker role allows you to invoke functions. For more information on access management in Yandex Cloud, see this guide.

Test the skillTest the skill

Yandex Dialogs interface
  1. In your Yandex Dialogs account, select Testing in the left-hand menu on the page with the skill you created earlier.
  2. If everything is set up correctly, the Chat section will display a message inviting you to start a conversation: Hello! I'll repeat anything you say to me..
  3. Send a message with any text and make sure the response contains the same text.

How to delete the resources you createdHow to delete the resources you created

To stop paying for the resources you created:

  1. Open the alice-skill.tf file and delete your infrastructure description from it.

  2. Apply the changes:

    1. In the terminal, navigate to the configuration file directory.

    2. Make sure the configuration is correct using this command:

      terraform validate
      

      If the configuration is valid, you will get this message:

      Success! The configuration is valid.
      
    3. Run this command:

      terraform plan
      

      You will see a list of resources and their properties. No changes will be made at this step. Terraform will show any errors in the configuration.

    4. Apply the configuration changes:

      terraform apply
      
    5. Type yes and press Enter to confirm the changes.

A version contain the function code, execution parameters, as well as all required dependencies. You can use different versions of the same function at different development stages. For more information, see Function versions.

There are several ways to upload a function version code: in the editor in the management console, from local files and directories, or as an archive. For more information, see Code upload format.

Useful linksUseful links

  • Creating a skill for Alice using serverless technology via the management console, Yandex Cloud CLI, or API

Was the article helpful?

Previous
Management console, CLI, and API
Next
Building a skill for Alice and a website with authorization
© 2026 Direct Cursus Technology L.L.C.