---
title: "Secrets, buckets and clusters"
description: "What a task gets when it names secrets, buckets, clusters or a registry repository, as its bot."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.ezghcloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Secrets, buckets and clusters

A task that names a resource is given access to it before its script starts, as the task's
[bot](/build/bots-and-trust). **Naming a resource grants nothing**: the bot's policies must allow
it. When they don't, the task fails before its script starts, and its log names the missing
permission.

Each of `secrets`, `buckets` and `clusters` needs `bot` on the task.

## Secrets

```yaml
tasks:
  test:
    image: hub/library/golang:1.25
    bot: ci-tester
    secrets:
      DATABASE_URL: staging-db#url
      API_TOKEN: partner-token
    run: go test -tags=integration ./...
```

`secrets` maps an environment variable to a [secret](/secrets) in the connection's project, by name
or ID: `name` for a secret with one value, `name#field` for one field. The value is read as the bot
when the task starts and is masked as `***` in the task's log.

A secret's value isn't part of the task's [key](/build/skipping): rotating it reruns nothing.

## The registry

A task with a `bot` has Docker's login for the project's registry host (`$EZGH_REGISTRY`) set up,
as the bot (`DOCKER_CONFIG`). Pushing needs the bot to be allowed to push.

## Buckets

```yaml
tasks:
  publish:
    image: hub/amazon/aws-cli:2
    bot: site-publisher
    buckets: [site-assets]
    inputs: ["public/**"]
    run: aws s3 sync public "s3://site-assets/"
```

`buckets` lists [Object Storage](/object-storage) buckets by name. The task gets
`AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_ENDPOINT_URL`, `AWS_REGION` and
`AWS_DEFAULT_REGION` for an access key owned by the bot. The key expires by itself shortly after the
task's `timeout`.

## Clusters

```yaml
tasks:
  rollout:
    image: hub/bitnami/kubectl:1.33
    bot: prod-deployer
    clusters: [production]
    cache: false
    inputs: []
    run: kubectl rollout status deployment/app --timeout=5m
```

`clusters` lists [Kubernetes](/kubernetes) clusters by name. The task gets `KUBECONFIG` with one
context for each, signed in as the bot.

**The bot needs an access entry on the cluster**, as any bot or user does: see [kubectl
access](/kubernetes/kubectl-access). A task that names `clusters` must also write `cache`, `true`
or `false`.

Source: https://docs.ezghcloud.com/build/resources/index.mdx
