-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvariables.tf
More file actions
110 lines (90 loc) · 3.6 KB
/
variables.tf
File metadata and controls
110 lines (90 loc) · 3.6 KB
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# ------------------------------------------------------------------------------
# Required
# ------------------------------------------------------------------------------
variable "project_id" {
description = "The GCP project ID to deploy resources into."
type = string
}
variable "region" {
description = "The GCP region to deploy the Cloud Function and Storage Bucket."
type = string
}
variable "function_source_dir" {
description = "The local directory path containing the Cloud Function source code to be zipped and deployed."
type = string
}
variable "pubsub_topic_id" {
description = "The fully-qualified Pub/Sub topic ID that triggers the Cloud Function (e.g. projects/my-project/topics/my-topic)."
type = string
}
# ------------------------------------------------------------------------------
# Storage Bucket
# ------------------------------------------------------------------------------
variable "function_bucket_name" {
description = "The base name of the GCS bucket used to store the function source code. The project_id will be appended to ensure global uniqueness."
type = string
default = "cloud-function-source"
}
variable "bucket_lifecycle_age_days" {
description = "Number of days after which old function archives are automatically deleted from the bucket."
type = number
default = 30
}
# ------------------------------------------------------------------------------
# Cloud Function Configuration
# ------------------------------------------------------------------------------
variable "function_name" {
description = "The name of the Cloud Function."
type = string
default = "pubsub-triggered-function"
}
variable "function_description" {
description = "The description of the Cloud Function."
type = string
default = "Cloud Function triggered by Pub/Sub messages"
}
variable "function_runtime" {
description = "The runtime environment for the Cloud Function (e.g. go125, python311, nodejs20)."
type = string
default = "go125"
}
variable "function_entry_point" {
description = "The name of the function to execute when the Cloud Function is triggered."
type = string
}
# ------------------------------------------------------------------------------
# Service Configuration
# ------------------------------------------------------------------------------
variable "max_instance_count" {
description = "The maximum number of function instances that can run simultaneously."
type = number
default = 3
}
variable "available_memory" {
description = "The amount of memory available for the function (e.g. 256Mi, 512Mi, 1Gi)."
type = string
default = "512Mi"
}
variable "timeout_seconds" {
description = "The maximum amount of time the function can run before timing out (in seconds)."
type = number
default = 60
}
variable "environment_variables" {
description = "A map of environment variables to pass to the Cloud Function."
type = map(string)
default = {}
}
# ------------------------------------------------------------------------------
# Event Trigger
# ------------------------------------------------------------------------------
variable "event_trigger_type" {
description = "The type of event that triggers the function."
type = string
default = "google.cloud.pubsub.topic.v1.messagePublished"
}
variable "retry_policy" {
description = "The retry policy for failed function executions (RETRY_POLICY_RETRY or RETRY_POLICY_DO_NOT_RETRY)."
type = string
default = "RETRY_POLICY_DO_NOT_RETRY"
}