Switch the active folder

Set the default folder-id for the active profile and check it with config list.

yc config set folder-id <id> && yc config list

tool
yc32 commands
tags
yccloudiam

More yc commands

  • yc config profile create prod && yc config profile activate prod

    Keep credentials separate for each environment; in CI, use yc --profile prod or YC_PROFILE.

  • export YC_TOKEN=$(yc iam create-token)

    Create an IAM token for the current profile (valid for about 12 hours) and pass it to the API or Terraform via YC_TOKEN.

  • yc iam service-account create --name sa-ci --description 'CI deployer'

    Create a service account for pipelines; grant it only the roles it needs in a separate step.

  • yc iam key create --service-account-name sa-ci --output key.json

    Save a JSON authorized key for non-interactive login; rotate it and keep it in a secret store.

  • yc resource-manager folder add-access-binding <id> --role editor --service-account-name sa-ci

    Bind a role at the folder level; narrow roles are safer than editor.

all 32 yc commands