Recently Written · git

subplz-web

git clone https://github.com/equwal/subplz-web

Log | Files | Refs


infra/burst/state/outputs.tf (1883 bytes)

1 # What the worker modules read (through terraform_remote_state).
2 output "worker" {
3   description = "Settings of a burst worker, on any cloud."
4   sensitive   = true
5   value = {
6     web_server_ip      = var.web_server_ip
7     ssh_port           = var.ssh_port
8     known_hosts        = local.known_hosts
9     tunnel_private_key = tls_private_key.tunnel.private_key_openssh
10     database_url       = local.database_url
11     redis_url          = local.redis_url
12     bucket             = cloudflare_r2_bucket.files.name
13     s3_prefix          = "jobs/"
14     storage_env        = local.storage_env
15   }
16 }
17 
18 # The lines to add to /opt/subplz-web/.env on the web server when burst mode goes on.
19 output "web_env" {
20   description = "Settings of the app on the web server (append to /opt/subplz-web/.env)."
21   sensitive   = true
22   value       = <<-EOT
23     SUBPLZ_WEB_QUEUE_BACKEND=redis
24     SUBPLZ_WEB_REDIS_URL=${local.redis_url}
25     SUBPLZ_WEB_DATABASE_URL=${local.database_url}
26     SUBPLZ_WEB_STORAGE_BACKEND=s3
27     SUBPLZ_WEB_S3_BUCKET=${cloudflare_r2_bucket.files.name}
28     SUBPLZ_WEB_S3_PREFIX=jobs/
29   EOT
30 }
31 
32 # boto3 reads these from the process environment, not from .env: they go to
33 # /etc/subplz-storage.env, which the systemd units load.
34 output "storage_env" {
35   description = "Storage keys for the web server (write to /etc/subplz-storage.env, mode 0600)."
36   sensitive   = true
37   value       = local.storage_env
38 }
39 
40 output "rclone_env" {
41   description = "Environment for rclone: the one-time copy of the files, and the nightly Postgres backup."
42   sensitive   = true
43   value       = <<-EOT
44     RCLONE_CONFIG_R2_TYPE=s3
45     RCLONE_CONFIG_R2_PROVIDER=Cloudflare
46     RCLONE_CONFIG_R2_ENDPOINT=${local.s3_endpoint}
47     RCLONE_CONFIG_R2_ACCESS_KEY_ID=${local.s3_key_id}
48     RCLONE_CONFIG_R2_SECRET_ACCESS_KEY=${local.s3_secret}
49   EOT
50 }
51 
52 output "bucket" {
53   value = cloudflare_r2_bucket.files.name
54 }