gcloud secrets versions add my-api-key --data-file=key.txt

Category: Google Cloud & Workspace

gcloud secrets versions add my-api-key --data-file=key.txt

Add a new version to a secret

Stores the contents of key.txt as the newest version of my-api-key, replacing what latest points to. Old versions remain accessible by their version number, enabling instant rollback. Use --data-file=- to read the value from stdin.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.