-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgcp_infrastructure.tf
55 lines (41 loc) · 1.04 KB
/
gcp_infrastructure.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
variable "region" {
type = string
}
variable "project_id" {
type = string
}
provider "google" {
project = var.project_id
region = var.region
}
resource "google_storage_bucket" "tasks_bucket" {
name = "carbon-aware-tasks"
location = var.region
storage_class = "STANDARD"
public_access_prevention = "enforced"
}
resource "google_pubsub_topic" "carbon_aware_tasks_to_schedule" {
name = "carbon-aware-tasks-to-schedule"
labels = {
usage = "carbon-aware-scheduler"
}
message_retention_duration = "7200s"
}
resource "google_pubsub_subscription" "carbon_aware_tasks_to_schedule_subscription" {
name = "carbon-aware-tasks-to-schedule-subscription"
topic = google_pubsub_topic.carbon_aware_tasks_to_schedule.id
labels = {
usage = "carbon-aware-scheduler"
}
# 20 minutes
message_retention_duration = "7200s"
retain_acked_messages = false
ack_deadline_seconds = 60
expiration_policy {
ttl = ""
}
retry_policy {
minimum_backoff = "10s"
}
enable_message_ordering = true
}