-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroot.tf
95 lines (82 loc) · 1.84 KB
/
root.tf
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
terraform {
required_version = ">= 1.5.0"
cloud {
organization = "kittenbot"
workspaces {
name = "main"
}
}
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.16.2"
}
}
}
provider "aws" {
default_tags {
tags = {
project = "KittenBot"
}
}
}
module "infra" {
source = "./infra"
dezgo_key = var.dezgo_key
domain = var.domain
image_tag = var.image_tag
prompts = var.prompts
reddit_client_id = var.reddit_client_id
reddit_client_secret = var.reddit_client_secret
reddit_password = var.reddit_password
reddit_username = var.reddit_username
}
variable "dezgo_key" {
type = string
description = "Dezgo.com API key"
validation {
condition = length(var.dezgo_key) > 6 && substr(var.dezgo_key, 0, 6) == "DEZGO-"
error_message = "Must start with 'DEZGO-'"
}
sensitive = true
}
variable "domain" {
type = string
description = "Domain name"
}
variable "image_tag" {
type = string
description = "Image tag for lambda"
default = "latest"
}
variable "prompts" {
type = list(object({
model = string
prompt = string
}))
description = "Models and prompts"
validation {
condition = length(var.prompts) > 1
error_message = "List of models/prompts must not be empty"
}
}
variable "reddit_client_id" {
type = string
description = "Reddit API client ID"
sensitive = true
}
variable "reddit_client_secret" {
type = string
description = "Reddit API client secret"
sensitive = true
}
variable "reddit_password" {
type = string
description = "Reddit API password"
sensitive = true
}
variable "reddit_username" {
type = string
description = "Reddit API username"
sensitive = true
}