---
metadata:
  - name: generator
    content: Diplodoc Platform v5.54.2
alternate:
  - https://sourcecraft.dev/portal/docs/en/sourcecraft/ci-cd-ref/tokens.md
  - https://sourcecraft.dev/portal/docs/ru/sourcecraft/ci-cd-ref/tokens.md
  - href: en/sourcecraft/ci-cd-ref/tokens.md
    type: text/markdown
    title: Markdown version
  - href: ../../llms.txt
    type: text/markdown
    title: llms.txt
---
> **Documentation Index:** Fetch the complete configuration index at https://sourcecraft.dev/portal/docs/en/llms.txt

# Service connections (tokens)

Under `tokens`, you can configure [service connections](https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/service-connections.md) that will be used in the repository's CI/CD processes.

<!-- source: en/_includes/sourcecraft/service-connection-info.md -->
_Service connections_ allow you to securely integrate your SourceCraft projects with the Yandex Cloud resources.

With service connections, you can get access to the Yandex Cloud [API](https://yandex.cloud/en/docs/api-design-guide/concepts/general) from inside of your SourceCraft repository's [CI/CD](https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/ci-cd.md) workflows. For example, you can request a [secret](https://yandex.cloud/en/docs/lockbox/concepts/secret) from Yandex Lockbox, upload files to a Yandex Object Storage [bucket](https://yandex.cloud/en/docs/storage/concepts/bucket), deploy a [virtual machine](https://yandex.cloud/en/docs/compute/concepts/vm) in Yandex Compute Cloud, etc.

You do not have to keep any long-lived tokens or access keys in repository [secrets](https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/index.md#secrets), let alone your code. You get authenticated in Yandex Cloud via a short-lived Yandex Identity and Access Management [IAM token](https://yandex.cloud/en/docs/iam/concepts/authorization/iam-token) which is requested within each individual CI/CD [task](https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/ci-cd.md#tasks).
<!-- endsource: en/_includes/sourcecraft/service-connection-info.md -->

`tokens` section structure:

```yaml
tokens:
  # Token name (can be any).
  <token_name>:
    # Name of the service connection you created earlier.
    service_connection: <service_connection_name>
    # Requested access scope:
    # org: All repositories
    # repo: Specific repository
    # ref: Branch or tag
    scope: repo
```

#### Useful links {#see-also}

* [Service connections SourceCraft](https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/service-connections.md)
* [Configuring a service connection to Yandex Cloud in SourceCraft](https://sourcecraft.dev/portal/docs/en/sourcecraft/operations/service-connections.md)
