This is documentation for the next version of Grafana k6 documentation. For the latest stable release, go to the latest version.

Open source

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 --secret-source=cloud. Using it with k6 run returns 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

Pass --secret-source=cloud when running your test with k6 cloud run --local-execution:

Bash
k6 cloud run --local-execution --secret-source=cloud script.js

k6 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.