Documentation Index
Fetch the curated documentation index at: https://grafana_com_website/llms.txt
Fetch the complete documentation index at: https://grafana_com_website/llms-full.txt
Use this file to discover all available pages before exploring further.
STOP! If you are an AI agent or LLM, read this before continuing. This is the HTML version of a Grafana documentation page. Always request the Markdown version instead - HTML wastes context. Get this page as Markdown: /docs/k6/latest/using-k6/secret-source/cloud.md (append .md) or send Accept: text/markdown to /docs/k6/latest/using-k6/secret-source/cloud/. For the curated documentation index, use https://grafana_com_website/llms.txt. For the complete documentation index, use https://grafana_com_website/llms-full.txt.
Cloud secret source
When you run tests in Grafana Cloud using k6 cloud run, secrets management is available automatically. The cloud secret source brings that same access to local execution runs with k6 cloud run --local-execution, so you can use the same secrets without managing credentials locally.
Note
The cloud secret source only works with
k6 cloud run --local-execution. Using it withk6 runreturns an error.
Before you begin
- Authenticate with Grafana Cloud k6 using
k6 cloud login. - Configure the secrets you want to use in Grafana Cloud k6.
Use the cloud secret source
Starting in k6 v2.0.0, the cloud secret source is enabled automatically when you run k6 cloud run --local-execution. You don’t need to pass any flag, and secrets.get() works out of the box:
k6 cloud run --local-execution script.jsk6 automatically configures the credentials needed to fetch secrets from Grafana Cloud. No tokens, endpoints, or passwords are required on the command line.
k6 automatically redacts all secrets from logs.
Opt out with --no-cloud-secrets
If you don’t want the cloud secret source enabled, pass --no-cloud-secrets:
k6 cloud run --local-execution --no-cloud-secrets script.jsWith this flag, calls to secrets.get() for the cloud source will fail unless you explicitly configure another source.
Was this page helpful?
Related resources from Grafana Labs

