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

# Secrets

> Create and manage secret resources in a Datum project, from the Cloud Portal or with datumctl.

![Secrets](https://mintcdn.com/datum-4926dda5/9pdr37W0ZlTfIFim/images/secrets.png?fit=max\&auto=format\&n=9pdr37W0ZlTfIFim\&q=85\&s=6bcfb0ec852ccc95b5e69393b1e8fdf4)

## Create a Secret with datumctl

A Secret is a Kubernetes-style resource, so you create it with a manifest and `datumctl apply`. To create a Secret, follow these steps:

1. Save the following manifest as `api-secrets.yaml`:

   ```yaml theme={null}
   apiVersion: v1
   kind: Secret
   metadata:
     name: api-secrets
   type: Opaque
   stringData:
     db-password: PASSWORD
   ```

   Replace `PASSWORD` with the value to store.

2. To create the Secret in your active project, run the following command:

   ```bash theme={null}
   datumctl apply -f api-secrets.yaml
   ```

To target a different project, add `--project PROJECT_ID`. For more information, see [Contexts and scoping](https://datum.net/docs/datumctl/contexts-and-scoping.md).

> [!WARNING]
>
> A manifest with `stringData` holds the secret value in plain text. Don't commit it to source control.

## List and inspect Secrets

To list the Secrets in your project, run the following command:

```bash theme={null}
datumctl get secrets
```

To inspect one Secret, run the following command:

```bash theme={null}
datumctl describe secret api-secrets
```

## Update or delete a Secret

To change a Secret, edit the manifest and run `datumctl apply -f` again. To delete it, run the following command:

```bash theme={null}
datumctl delete secret api-secrets
```

## Use a Secret

Compute workloads can read a Secret as environment variables or as files. For more information, see [Configuration](https://datum.net/docs/compute/configuration.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.