Create a named profile

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

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

tool
yc32 commands
tags
yccloudci

More yc commands

  • 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.

  • yc managed-kubernetes cluster get-credentials <name> --external --force

    Add the cluster's external endpoint to kubeconfig; drop --external to use the internal VPC address.

all 32 yc commands