Skip to main content

Yandex Cloud CLI

Terraform YC Provider                                                                                            
    YC Operations Guide Create compute_instance +Official.Guide Add SSH Key / Service Key Data Sources Labels
    Установка Yandex CLI                                                                                             

    Установка CLI в /opt/yc (~/.bashrc Неизменён)

    curl https://storage.yandexcloud.net/yandexcloud-yc/install.sh | \
        bash -s -- -i /opt/yc -n

    Добавление конфига в ~/.bashrc

    echo -e "\n# Yandex Cloud CLI\n\
    if [ -f '/opt/yc/path.bash.inc' ]; then source '/opt/yc/path.bash.inc'; fi\n\
    if [ -f '/opt/yc/completion.bash.inc' ]; then source '/opt/yc/completion.bash.inc'; fi\n\
    " >> ~/.bashrc
    
    # Применение ~/.bashrc
    . ~/.bashrc

    Service Key Activation

    yc config set service-account-key ~/.ssh/yc.service.key
    yc config set folder-id <>
    Управление Yandex Cloud
    Описание Команда
    Cписок ВМ yc compute instance list
    Полные данные о ВМ mon-do27 yc compute instance get --full mon-do27
    Список сервисных аккаунтов yc iam service-account --folder-id b1gtv3uhmd1feqdajugp list
    Список профилей yc config profile list
    Указать облако в профиле yc config set cloud-id b1gm6imb36aoic2km8d0
    Указать каталог в профиле yc config set folder-id b1gtv3uhmd1feqdajugp
    Запустить ВМ yc compute instance start mon-do27