Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
  • Blog
  • Pricing
  • Documentation
Yandex project
© 2025 Yandex.Cloud LLC
Command line interface
  • Getting started with the CLI
    • All guides
    • CLI installation
    • CLI update
      • Creating a profile
      • Managing profile parameters
      • Getting profile information
      • Activating a profile
      • Deleting a profile
  • CLI releases
  • Troubleshooting

In this article:

  • Creating an empty profile and adding parameters manually
  • Wizard-based profile creation with basic parameters
  1. Step-by-step guides
  2. Profile management
  3. Creating a profile

Creating a profile

Written by
Yandex Cloud
Updated at February 6, 2025
  • Creating an empty profile and adding parameters manually
  • Wizard-based profile creation with basic parameters

There are two ways to create a profile:

  • Creating an empty profile and adding parameters manually.

    This creates and activates an empty profile: you have to add all the parameters separately.

  • Wizard-based profile creation with basic parameters.

    The CLI suggests setting the basic profile parameters step-by-step. You can use this method to redefine the parameters of an existing profile. This method doesn't work for service accounts.

Creating an empty profile and adding parameters manuallyCreating an empty profile and adding parameters manually

Create a profile named test:

  1. Run this command:

    yc config profile create test
    

    Result:

    Profile 'test' created and activated
    
  2. Add the necessary profile parameters, such as a folder:

    yc config set folder-id <Folder ID>
    

    View the full list of profile parameters and learn how to manage them.

You can view an example of this type of profile when getting started.

Wizard-based profile creation with basic parametersWizard-based profile creation with basic parameters

If you use the wizard to create a profile, the CLI prompts you to enter the basic profile parameters step-by-step:

  • Profile name.
  • OAuth token (for a Yandex account).
  • The cloud you have access rights to.
  • Default folder.
  • Default availability zone where Yandex Compute Cloud resources are created.

You can stop profile creation at any time. All the settings you entered before stopping are saved to the profile.

If you are not connected to the management console yet, log in to the console and accept the user agreement by clicking Log in.

Yandex account
Federated account

To get authenticated using a Yandex account:

  1. Get an OAuth token in Yandex ID:

    1. Click the link. If the application requests access to data, permit it. You need to do this to get a token.

    2. Copy the token to the clipboard or save it.

  2. If authenticating for the first time, go to the cloud console. Accept the terms of the license agreement and privacy policy.

  3. To initialize CLI profile setup, run this command:

    yc init
    
  4. Select the profile you want to set up authentication for or create a new one. If it is your first time running the yc init command, this step will be skipped.

    Pick desired action:
    [1] Re-initialize this profile 'default' with new settings
    [2] Create a new profile
    Please enter your numeric choice: 1
    
  5. Enter the previously obtained OAuth token when prompted by the command:

    Please go to https://oauth.yandex.com/authorize?response_type=token&client_id=1a6990aa636648e9b2ef855fa7bec2fb
    in order to obtain OAuth token.
    
    Please enter OAuth token: y0_AgA ... wvs7N4
    
  6. Select one of the clouds from the list of those you have access to:

    Please select cloud to use:
     [1] cloud1 (id = aoe2bmdcvata********)
     [2] cloud2 (id = dcvatao4faoe********)
    Please enter your numeric choice: 2
    

    If there is only one cloud available, it will be selected automatically.

  7. Select the default folder:

    Please choose a folder to use:
     [1] folder1 (id = cvatao4faoe2********)
     [2] folder2 (id = tao4faoe2cva********)
     [3] Create a new folder
    Please enter your numeric choice: 1
    
  8. To select the default availability zone for Compute Cloud, type Y. To skip the setup, type n.

    Do you want to configure a default Yandex Compute Cloud availability zone? [Y/n] Y
    

    If you chose Y, select the availability zone:

    Which zone do you want to use as a profile default?
     [1] ru-central1-a
     [2] ru-central1-b
     [3] ru-central1-d
     [4] Do not set default zone
    Please enter your numeric choice: 2
    
  9. View your CLI profile settings:

    yc config list
    

    Result:

    token: y0_AgA...wvs7N4
    cloud-id: b1g159pa15cd********
    folder-id: b1g8o9jbt58********
    compute-default-zone: ru-central1-b
    

To authenticate using a SAML-compatible identity federation:

  1. Get your federation ID from your administrator.

  2. Launch the profile creation wizard:

    yc init \
       --federation-endpoint auth.cloud.yandex.com \
       --federation-id <federation_ID>
    
  3. Select the profile you want to set up authentication for or create a new one.

    Welcome! This command will take you through the configuration process.
    Pick desired action:
    [1] Re-initialize this profile 'default' with new settings
    [2] Create a new profile
    
  4. The CLI prompts you to continue authentication in the browser. Press Enter to continue.

    You are going to be authenticated via federation-id 'aje1f0hsgds3a********'.
    Your federation authentication web site will be opened.
    After your successful authentication, you will be redirected to 'https://console.yandex.cloud'.
    
    Press 'enter' to continue...
    

    On successful authentication, the IAM token is saved in the profile. This token is used to authenticate each operation until the token expires. After that, the CLI again displays a prompt to authenticate in the browser.

  5. Go back to the command line interface to finish creating the profile.

  6. Select one of the clouds from the list of those you have access to:

    Please select cloud to use:
     [1] cloud1 (id = aoe2bmdcvata********)
     [2] cloud2 (id = dcvatao4faoe********)
    Please enter your numeric choice: 2
    

    If there is only one cloud available, it will be selected automatically.

  7. Select the default folder:

    Please choose a folder to use:
     [1] folder1 (id = cvatao4faoe2********)
     [2] folder2 (id = tao4faoe2cva********)
     [3] Create a new folder
    Please enter your numeric choice: 1
    
  8. To select the default availability zone for Compute Cloud, type Y. To skip the setup, type n.

    Do you want to configure a default Yandex Compute Cloud availability zone? [Y/n] Y
    

    If you typed Y, select the availability zone:

    Which zone do you want to use as a profile default?
     [1] ru-central1-a
     [2] ru-central1-b
     [3] ru-central1-d
     [4] Do not set default zone
    Please enter your numeric choice: 2
    
  9. View your CLI profile settings:

    yc config list
    

    Result:

    federation-id: aje1f0hs6oja********
    cloud-id: b1g159pa15cd********
    folder-id: b1g8o9jbt58********
    compute-default-zone: ru-central1-b
    

Was the article helpful?

Previous
Authenticating as a federated user
Next
Managing profile parameters
Yandex project
© 2025 Yandex.Cloud LLC