Skip to content

Commit da97c6b

Browse files
committed
update docs
1 parent 2e113b1 commit da97c6b

6 files changed

Lines changed: 205 additions & 181 deletions

File tree

docs/data-sources/app.md

Lines changed: 29 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -10,61 +10,53 @@ description: |-
1010

1111
Retrieves details about an existing Spice.ai app by its ID.
1212

13-
Use this data source to access information about an existing app that you need to reference in your configuration.
14-
1513
## Example Usage
1614

17-
### Basic Usage
18-
1915
```terraform
16+
# Get details about an existing app by ID
2017
data "spiceai_app" "example" {
2118
id = "12345"
2219
}
2320
21+
# Use data from an existing app
2422
output "app_name" {
2523
description = "The name of the app"
2624
value = data.spiceai_app.example.name
2725
}
28-
```
2926
30-
### Reference App from Resource
27+
output "app_visibility" {
28+
description = "The visibility of the app"
29+
value = data.spiceai_app.example.visibility
30+
}
3131
32-
```terraform
33-
resource "spiceai_app" "example" {
34-
name = "my-app"
35-
description = "My Spice.ai app"
36-
visibility = "private"
32+
output "app_region" {
33+
description = "The region where the app is deployed"
34+
value = data.spiceai_app.example.region
3735
}
3836
37+
output "app_replicas" {
38+
description = "The number of replicas configured for the app"
39+
value = data.spiceai_app.example.replicas
40+
}
41+
42+
output "app_image_tag" {
43+
description = "The runtime image tag for the app"
44+
value = data.spiceai_app.example.image_tag
45+
}
46+
47+
# Reference an app created by another resource
3948
data "spiceai_app" "from_resource" {
4049
id = spiceai_app.example.id
4150
}
4251
52+
# Use data source to get app API key for other configurations
4353
output "app_api_key" {
4454
description = "The API key for the app"
4555
value = data.spiceai_app.from_resource.api_key
4656
sensitive = true
4757
}
4858
```
4959

50-
### Access Runtime Configuration
51-
52-
```terraform
53-
data "spiceai_app" "example" {
54-
id = "12345"
55-
}
56-
57-
output "app_config" {
58-
description = "The app's runtime configuration"
59-
value = {
60-
name = data.spiceai_app.example.name
61-
region = data.spiceai_app.example.region
62-
replicas = data.spiceai_app.example.replicas
63-
image_tag = data.spiceai_app.example.image_tag
64-
}
65-
}
66-
```
67-
6860
<!-- schema generated by tfplugindocs -->
6961
## Schema
7062

@@ -74,29 +66,16 @@ output "app_config" {
7466

7567
### Read-Only
7668

77-
#### Identity
78-
79-
- `name` (String) The name of the app.
80-
81-
#### Basic Configuration
82-
69+
- `api_key` (String, Sensitive) The API key for the app.
70+
- `cluster_id` (String) The Kubernetes cluster identifier where the app is deployed.
71+
- `created_at` (String) The timestamp when the app was created.
8372
- `description` (String) A description of the app.
84-
- `visibility` (String) The visibility of the app (`public` or `private`).
85-
- `production_branch` (String) The production branch for the app.
86-
87-
#### Spicepod Configuration
88-
89-
- `spicepod` (String) The spicepod configuration as a JSON string.
90-
91-
#### Runtime Configuration
92-
9373
- `image_tag` (String) The Spice.ai runtime image tag.
94-
- `replicas` (Number) The number of replicas.
74+
- `name` (String) The name of the app.
9575
- `node_group` (String) The node group for the app.
76+
- `production_branch` (String) The production branch for the app.
9677
- `region` (String) The region where the app is deployed.
78+
- `replicas` (Number) The number of replicas.
79+
- `spicepod` (String) The spicepod configuration as a JSON string.
9780
- `storage_claim_size_gb` (Number) The storage claim size in GB.
98-
99-
#### Metadata
100-
101-
- `created_at` (String) The timestamp when the app was created.
102-
- `api_key` (String, Sensitive) The API key for the app.
81+
- `visibility` (String) The visibility of the app (`public` or `private`).

docs/data-sources/apps.md

Lines changed: 21 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,31 @@ description: |-
1010

1111
Retrieves a list of all Spice.ai apps in the authenticated organization.
1212

13-
Use this data source to list all apps in your organization and access their configuration details.
14-
1513
## Example Usage
1614

17-
### List All Apps
18-
1915
```terraform
16+
# List all apps in the organization
2017
data "spiceai_apps" "all" {}
2118
19+
# Output the count of apps
2220
output "app_count" {
2321
description = "The total number of apps in the organization"
2422
value = length(data.spiceai_apps.all.apps)
2523
}
2624
25+
# Output all app names
2726
output "app_names" {
2827
description = "List of all app names"
2928
value = [for app in data.spiceai_apps.all.apps : app.name]
3029
}
31-
```
3230
33-
### Filter Apps by Visibility
34-
35-
```terraform
36-
data "spiceai_apps" "all" {}
31+
# Output all app IDs
32+
output "app_ids" {
33+
description = "List of all app IDs"
34+
value = [for app in data.spiceai_apps.all.apps : app.id]
35+
}
3736
37+
# Filter apps by visibility
3838
output "public_apps" {
3939
description = "List of public app names"
4040
value = [for app in data.spiceai_apps.all.apps : app.name if app.visibility == "public"]
@@ -44,31 +44,20 @@ output "private_apps" {
4444
description = "List of private app names"
4545
value = [for app in data.spiceai_apps.all.apps : app.name if app.visibility == "private"]
4646
}
47-
```
48-
49-
### Get Apps with Configuration Details
50-
51-
```terraform
52-
data "spiceai_apps" "all" {}
5347
48+
# Get apps with their configurations
5449
output "apps_with_config" {
55-
description = "Map of app names to their configuration"
50+
description = "Map of app names to their replica counts"
5651
value = {
5752
for app in data.spiceai_apps.all.apps : app.name => {
58-
id = app.id
5953
replicas = app.replicas
6054
image_tag = app.image_tag
6155
region = app.region
6256
}
6357
}
6458
}
65-
```
66-
67-
### Find a Specific App by Name
68-
69-
```terraform
70-
data "spiceai_apps" "all" {}
7159
60+
# Find a specific app by name
7261
locals {
7362
target_app_name = "my-app"
7463
target_app = [
@@ -95,30 +84,17 @@ output "found_app_id" {
9584

9685
Read-Only:
9786

98-
#### Identity
99-
100-
- `id` (String) The unique identifier of the app.
101-
- `name` (String) The name of the app.
102-
103-
#### Basic Configuration
104-
87+
- `api_key` (String, Sensitive) The API key for the app.
88+
- `cluster_id` (String) The Kubernetes cluster identifier where the app is deployed.
89+
- `created_at` (String) The timestamp when the app was created.
10590
- `description` (String) A description of the app.
106-
- `visibility` (String) The visibility of the app (`public` or `private`).
107-
- `production_branch` (String) The production branch for the app.
108-
109-
#### Spicepod Configuration
110-
111-
- `spicepod` (String) The spicepod configuration as a JSON string.
112-
113-
#### Runtime Configuration
114-
91+
- `id` (String) The unique identifier of the app.
11592
- `image_tag` (String) The Spice.ai runtime image tag.
116-
- `replicas` (Number) The number of replicas.
93+
- `name` (String) The name of the app.
11794
- `node_group` (String) The node group for the app.
95+
- `production_branch` (String) The production branch for the app.
11896
- `region` (String) The region where the app is deployed.
97+
- `replicas` (Number) The number of replicas.
98+
- `spicepod` (String) The spicepod configuration as a JSON string.
11999
- `storage_claim_size_gb` (Number) The storage claim size in GB.
120-
121-
#### Metadata
122-
123-
- `created_at` (String) The timestamp when the app was created.
124-
- `api_key` (String, Sensitive) The API key for the app.
100+
- `visibility` (String) The visibility of the app (`public` or `private`).

docs/index.md

Lines changed: 48 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,49 @@
11
---
22
# generated by https://github.com/hashicorp/terraform-plugin-docs
33
page_title: "spiceai Provider"
4-
subcategory: ""
54
description: |-
65
The Spice.ai provider allows you to manage Spice.ai Cloud resources.
6+
Authentication
7+
The provider uses OAuth client credentials for authentication. You can obtain these from the Spice.ai Cloud portal.
8+
Credentials can be provided via:
9+
Provider configuration blockEnvironment variables (recommended for CI/CD)
10+
Example Usage
11+
12+
provider "spiceai" {
13+
# Credentials can also be set via environment variables:
14+
# SPICEAI_CLIENT_ID and SPICEAI_CLIENT_SECRET
15+
client_id = var.spiceai_client_id
16+
client_secret = var.spiceai_client_secret
17+
}
718
---
819

9-
# Spice.ai Provider
20+
# spiceai Provider
1021

11-
The Spice.ai provider allows you to manage [Spice.ai Cloud](https://spice.ai) resources including apps and deployments.
22+
The Spice.ai provider allows you to manage Spice.ai Cloud resources.
1223

1324
## Authentication
1425

15-
The provider uses OAuth client credentials for authentication. You can obtain these credentials from the [Spice.ai Cloud portal](https://spice.ai).
26+
The provider uses OAuth client credentials for authentication. You can obtain these from the Spice.ai Cloud portal.
1627

1728
Credentials can be provided via:
1829
- Provider configuration block
1930
- Environment variables (recommended for CI/CD)
2031

2132
## Example Usage
2233

23-
### Using Environment Variables (Recommended)
34+
```hcl
35+
provider "spiceai" {
36+
# Credentials can also be set via environment variables:
37+
# SPICEAI_CLIENT_ID and SPICEAI_CLIENT_SECRET
38+
client_id = var.spiceai_client_id
39+
client_secret = var.spiceai_client_secret
40+
}
41+
```
42+
43+
## Example Usage
2444

2545
```terraform
46+
# Configure the Spice.ai provider
2647
terraform {
2748
required_providers {
2849
spiceai = {
@@ -32,46 +53,25 @@ terraform {
3253
}
3354
}
3455
35-
# Provider configuration using environment variables:
36-
# - SPICEAI_CLIENT_ID
37-
# - SPICEAI_CLIENT_SECRET
38-
provider "spiceai" {}
39-
40-
# Create an app with configuration
41-
resource "spiceai_app" "example" {
42-
name = "my-terraform-app"
43-
description = "Managed by Terraform"
44-
visibility = "private"
45-
46-
spicepod = <<-YAML
47-
version: v1beta1
48-
kind: Spicepod
49-
name: my-terraform-app
50-
datasets:
51-
- name: taxi_trips
52-
from: s3://spiceai-demo-datasets/taxi_trips/2024/
53-
params:
54-
file_format: parquet
55-
YAML
56-
57-
image_tag = "latest"
58-
replicas = 1
59-
}
60-
61-
# Deploy the app
62-
resource "spiceai_deployment" "example" {
63-
app_id = spiceai_app.example.id
64-
}
65-
```
66-
67-
### Using Variables
68-
69-
```terraform
56+
# Provider configuration using variables
7057
provider "spiceai" {
58+
# OAuth client credentials for authentication
59+
# These can also be set via environment variables:
60+
# SPICEAI_CLIENT_ID
61+
# SPICEAI_CLIENT_SECRET
7162
client_id = var.spiceai_client_id
7263
client_secret = var.spiceai_client_secret
64+
65+
# Optional: Custom API endpoint (defaults to https://api.spice.ai)
66+
# api_endpoint = "https://api.spice.ai"
67+
api_endpoint = "https://dev-api.spice.ai"
68+
69+
# Optional: Custom OAuth endpoint (defaults to https://spice.ai/api/oauth/token)
70+
# oauth_endpoint = "https://spice.ai/api/oauth/token"
71+
oauth_endpoint = "https://dev.spice.ai/api/oauth/token"
7372
}
7473
74+
# Variables for credentials
7575
variable "spiceai_client_id" {
7676
description = "OAuth client ID for Spice.ai API authentication"
7777
type = string
@@ -83,16 +83,14 @@ variable "spiceai_client_secret" {
8383
type = string
8484
sensitive = true
8585
}
86-
```
8786
88-
## Environment Variables
89-
90-
| Variable | Description |
91-
|----------|-------------|
92-
| `SPICEAI_CLIENT_ID` | OAuth client ID for authentication |
93-
| `SPICEAI_CLIENT_SECRET` | OAuth client secret for authentication |
94-
| `SPICEAI_API_ENDPOINT` | API endpoint (default: `https://api.spice.ai`) |
95-
| `SPICEAI_OAUTH_ENDPOINT` | OAuth token endpoint (default: `https://spice.ai/api/oauth/token`) |
87+
# Alternative: Provider configuration using environment variables only
88+
# provider "spiceai" {
89+
# # Credentials are automatically read from:
90+
# # - SPICEAI_CLIENT_ID
91+
# # - SPICEAI_CLIENT_SECRET
92+
# }
93+
```
9694

9795
<!-- schema generated by tfplugindocs -->
9896
## Schema
@@ -103,13 +101,4 @@ variable "spiceai_client_secret" {
103101
- `client_id` (String) The OAuth client ID for Spice.ai API authentication. Can also be set via the `SPICEAI_CLIENT_ID` environment variable.
104102
- `client_secret` (String, Sensitive) The OAuth client secret for Spice.ai API authentication. Can also be set via the `SPICEAI_CLIENT_SECRET` environment variable.
105103
- `oauth_endpoint` (String) The Spice.ai OAuth token endpoint. Defaults to `https://spice.ai/api/oauth/token`. Can also be set via the `SPICEAI_OAUTH_ENDPOINT` environment variable.
106-
107-
## Resources
108-
109-
- [spiceai_app](resources/app.md) - Manages a Spice.ai app and its configuration
110-
- [spiceai_deployment](resources/deployment.md) - Creates a deployment for a Spice.ai app
111-
112-
## Data Sources
113-
114-
- [spiceai_app](data-sources/app.md) - Retrieves details about an existing app
115-
- [spiceai_apps](data-sources/apps.md) - Lists all apps in the organization
104+
- `vercel_protection_bypass` (String, Sensitive) Optional bypass token for Vercel deployment protection. When set, adds the `x-vercel-protection-bypass` header to API requests. Can also be set via the `SPICEAI_VERCEL_PROTECTION_BYPASS` environment variable.

0 commit comments

Comments
 (0)