@@ -8,83 +8,93 @@ terraform {
88 }
99}
1010
11- # Provider configuration using environment variables
12- # Set SPICEAI_CLIENT_ID and SPICEAI_CLIENT_SECRET before running
13- provider "spiceai" {}
11+ # Provider configuration
12+ provider "spiceai" {
13+ # Optional: Custom API endpoint (defaults to https://api.spice.ai)
14+ # api_endpoint = "https://api.spice.ai"
15+ api_endpoint = " https://dev-api.spice.ai"
16+
17+ # Optional: Custom OAuth endpoint (defaults to https://spice.ai/api/oauth/token)
18+ # oauth_endpoint = "https://spice.ai/api/oauth/token"
19+ oauth_endpoint = " https://dev.spice.ai/api/oauth/token"
20+
21+ # Optional: Vercel protection bypass token for preview deployments
22+ # vercel_protection_bypass = "cgWEL8HZ32wB6byCBh96gQepmx4HskWd"
23+ }
1424
1525# Create a test app with full configuration
1626resource "spiceai_app" "test" {
1727 name = " terraform-test-app"
1828 description = " Test app for Terraform provider validation"
1929 visibility = " private"
2030
21- # Spicepod configuration
22- spicepod = <<- YAML
23- version: v1beta1
24- kind: Spicepod
25- name: terraform-test-app
26- datasets:
27- - name: test_dataset
28- from: s3://spiceai-demo-datasets/taxi_trips/2024/
29- params:
30- file_format: parquet
31- YAML
32-
33- # Runtime configuration
34- image_tag = " latest"
35- replicas = 1
36- production_branch = " main"
31+ # # Spicepod configuration
32+ # spicepod = <<-YAML
33+ # version: v1beta1
34+ # kind: Spicepod
35+ # name: terraform-test-app
36+ # datasets:
37+ # - name: test_dataset
38+ # from: s3://spiceai-demo-datasets/taxi_trips/2024/
39+ # params:
40+ # file_format: parquet
41+ # YAML
42+
43+ # # Runtime configuration
44+ # image_tag = "latest"
45+ # replicas = 1
46+ # production_branch = "main"
3747}
3848
39- # Create a deployment for the test app
40- resource "spiceai_deployment" "test" {
41- app_id = spiceai_app. test . id
49+ # # Create a deployment for the test app
50+ # resource "spiceai_deployment" "test" {
51+ # app_id = spiceai_app.test.id
4252
43- # Use app defaults
44- debug = false
45- }
53+ # # Use app defaults
54+ # debug = false
55+ # }
4656
47- # Data source: Read back the app we created
48- data "spiceai_app" "test" {
49- id = spiceai_app. test . id
50- }
57+ # # Data source: Read back the app we created
58+ # data "spiceai_app" "test" {
59+ # id = spiceai_app.test.id
60+ # }
5161
52- # Data source: List all apps
53- data "spiceai_apps" "all" {}
62+ # # Data source: List all apps
63+ # data "spiceai_apps" "all" {}
5464
55- # Outputs for verification
56- output "app_id" {
57- description = " The ID of the test app"
58- value = spiceai_app. test . id
59- }
65+ # # Outputs for verification
66+ # output "app_id" {
67+ # description = "The ID of the test app"
68+ # value = spiceai_app.test.id
69+ # }
6070
61- output "app_name" {
62- description = " The name of the test app"
63- value = spiceai_app. test . name
64- }
71+ # output "app_name" {
72+ # description = "The name of the test app"
73+ # value = spiceai_app.test.name
74+ # }
6575
66- output "app_api_key" {
67- description = " The API key for the test app"
68- value = spiceai_app. test . api_key
69- sensitive = true
70- }
76+ # output "app_api_key" {
77+ # description = "The API key for the test app"
78+ # value = spiceai_app.test.api_key
79+ # sensitive = true
80+ # }
7181
72- output "deployment_id" {
73- description = " The ID of the deployment"
74- value = spiceai_deployment. test . id
75- }
82+ # output "deployment_id" {
83+ # description = "The ID of the deployment"
84+ # value = spiceai_deployment.test.id
85+ # }
7686
77- output "deployment_status" {
78- description = " The status of the deployment"
79- value = spiceai_deployment. test . status
80- }
87+ # output "deployment_status" {
88+ # description = "The status of the deployment"
89+ # value = spiceai_deployment.test.status
90+ # }
8191
82- output "data_source_app_name" {
83- description = " App name from data source"
84- value = data. spiceai_app . test . name
85- }
92+ # output "data_source_app_name" {
93+ # description = "App name from data source"
94+ # value = data.spiceai_app.test.name
95+ # }
8696
87- output "all_apps_count" {
88- description = " Total number of apps in the organization"
89- value = length (data. spiceai_apps . all . apps )
90- }
97+ # output "all_apps_count" {
98+ # description = "Total number of apps in the organization"
99+ # value = length(data.spiceai_apps.all.apps)
100+ # }
0 commit comments