Use Cases
- Database Configuration: Store host, port, username, and database name together
- API Configuration: Group related API settings (endpoint, version, timeout)
- Feature Flags: Store multiple feature toggles in one secret
- Environment Variables: Bundle related environment variables
- Application Settings: Group configuration that belongs together logically
Configuration Options
Dictionary secrets store key-value pairs where:All values in a dictionary secret are stored as strings. If you need to store JSON or complex data, use an Opaque secret instead.
Create a Dictionary Secret
- Console UI
- CLI
- Terraform
- Pulumi
1
Navigate to Secrets
In the Console, navigate to Secrets and click New, or use the Create dropdown in the top-right corner and select Secret.
2
Enter basic information
Enter a Name and optional Description.
3
Select secret type
Select Dictionary as the secret type.
4
Configure key-value pairs
Click Data in the left pane. Click Add to add key-value pairs, or drag and drop a file / click to import.
5
Create the secret
Click Create.
Injecting into Workloads
Individual Keys as Environment Variables
Reference specific keys from the dictionary:Mount as Directory
When mounted as a volume, each key becomes a file:/etc/config/DB_HOSTcontainingdb.example.com/etc/config/DB_PORTcontaining5432/etc/config/DB_NAMEcontainingmyapp_production/etc/config/DB_SSL_MODEcontainingrequire
Common Patterns
Database Configuration
Redis Configuration
External API Settings
Next Steps
Using Secrets in Workloads
Learn how to grant access and inject secrets
Opaque Secrets
Store single values or complex data