Create service account

    1. Select the folder.

    2. Select the Service accounts tab.

    3. Click Create service account.

    4. Enter the name of the service account.

    5. You can immediately assign the service account the role for the folder where it is created. To do this, click Add role and select a role.

      To assign a role for another resource, use the CLI or API following the instructions Assign role to service account.

    6. Click Add.

    Create a service account in your default folder:

    yc iam service-account create --name <SERVICE-ACCOUNT-NAME>
    

    where:

    • <SERVICE-ACCOUNT-NAME> is the name of the service account.

      The name must be unique within the folder. The name may contain lowercase Latin letters, numbers, and hyphens. The first character must be a letter. The last character can't be a hyphen. The maximum name length is 63 characters.

    You can create a service account in another folder using the -- folder-id or folder-name flags:

    yc iam service-account create --name my-robot \
        --folder-name yet-another-folder
    

    You can add any description to the service account using the -- description flag:

    yc iam service-account create --name my-robot \
        --description "this is my favorite service account"
    

    To create a service account, use the Create method for the ServiceAccount resource.