-
Notifications
You must be signed in to change notification settings - Fork 0
/
2_deployment_template.tf.txt
45 lines (39 loc) · 1.23 KB
/
2_deployment_template.tf.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
terraform {
required_providers {
theta = {
source = "hashicorp.com/edu/theta"
version = "0.1.0"
}
}
}
provider "theta" {
email = var.email
password = var.password
}
# Fetch the list of organizations
data "theta_organizations" "org_list" {}
# Fetch the list of projects for the first organization
data "theta_projects" "projects" {
organization_id = data.theta_organizations.org_list.organizations[0].id
}
# Use a valid project ID from the fetched projects to create a deployment template
resource "theta_deployment_template" "my_first_tf_managed_template" {
name = "stable-diffusion-service"
project_id = data.theta_projects.projects.projects[0].id
description = "Image generation service "
container_images = ["thetalabsorg/sketch_to_3d:v0.0.1"]
container_port = 7861
container_args = []
env_vars = {
HUGGING_FACE_HUB_TOKEN = var.hf_token
}
tags = ["ImageGen", "CodeGen"]
icon_url = ""
}
output "deployment_template_id" {
value = theta_deployment_template.my_first_tf_managed_template.id
}
# Fetch the list of deployment templates for the first project
data "theta_deployment_templates" "templates" {
project_id = data.theta_projects.projects.projects[0].id
}