> For the complete documentation index, see [llms.txt](https://docs.pritunl.com/kb/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pritunl.com/kb/cloud/components/secrets.md).

# Secrets

Storage for API keys or custom JSON formatted data

Secrets are used to authenticate access to the cloud provider APIs or store secrets. This is done with the *AWS*, *Cloudflare* and *Oracle Cloud* types. These secrets can then be used for certificates or domains to allow for automated certificates or automated DNS management. When using secrets with pods it's recommended to use the JSON type even for cloud API keys.

### JSON Secrets

JSON secrets allow storing key value pairs in one secret that are easily accessible from pod scripts using the `pci` command. Below is an example JSON secret with 3 values.

<figure><img src="https://1205480171-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7VFD0Okoikbws6fRiMFC%2Fuploads%2FAmIvT9W5cSKuaLFJvPE0%2Fcloud_secret_json0.png?alt=media&amp;token=0443b42b-5814-4999-b73e-8b772d3e1620" alt=""><figcaption></figcaption></figure>

This can then be added to a pod by including it in the spec as shown below. The secret organization must match the pods organization.

```yaml
secrets:
    - +/secret/api-key
```

Then this secret can be retrieved from the pod using the command below. Newlines were added to the output below for legibility the command will not add newlines to the output.

```sh
[cloud@dev-unit ~]$ sudo pci get +/secret/api-key/data.secret
test
[cloud@dev-unit ~]$ sudo pci get +/secret/test/data.number
34
```

Currently the only supported values are `string, number, boolean and null` this will be improved in future releases. Secrets can be added or modified and will be updated on the IMDS system within 1-5 seconds.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.pritunl.com/kb/cloud/components/secrets.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
