Get a short-lived IAM 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.

export YC_TOKEN=$(yc iam create-token)

tool
yc32 commands
tags
yciamsecuritysecrets

More yc commands

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

  • yc managed-kubernetes cluster list --format json | jq -r '.[]|[.name,.status,.id]|@tsv'

    Print cluster name, status and ID as TSV for scripts and audits.

all 32 yc commands