| page_title | spiceai_api_keys Data Source - spiceai |
|---|---|
| subcategory | |
| description | Retrieves the API keys for a Spice.ai app. Each app has two API keys to support key rotation. |
Retrieves the API keys for a Spice.ai app. Each app has two API keys to support key rotation.
# Get API keys for an app
data "spiceai_api_keys" "example" {
app_id = spiceai_app.example.id
}
# Use the primary API key
output "primary_api_key" {
description = "The primary API key for the app"
value = data.spiceai_api_keys.example.api_key
sensitive = true
}
# Use the secondary API key (useful for key rotation)
output "secondary_api_key" {
description = "The secondary API key for the app"
value = data.spiceai_api_keys.example.api_key_2
sensitive = true
}app_id(String) The unique identifier of the app.
api_key(String, Sensitive) The primary API key for the app.api_key_2(String, Sensitive) The secondary API key for the app.