Created
July 26, 2023 10:14
-
-
Save evoxmusic/418382e953e2e18a950a31547a9f7596 to your computer and use it in GitHub Desktop.
Qovery - Terraform Export for Windmill
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
terraform { | |
required_providers { | |
qovery = { | |
source = "qovery/qovery" | |
version = "0.18.0" | |
} | |
} | |
} | |
provider "qovery" { | |
token = var.qovery_access_token | |
} | |
resource "qovery_organization" "organization_z51937012" { | |
name = "Qovery Prod" | |
plan = "BUSINESS" | |
description = "Production organization used for Qovery core and related services ✨" | |
} | |
resource "qovery_aws_credentials" "aws_creds_z5b99737b" { | |
organization_id = qovery_organization.organization_z51937012.id | |
name = "Qovery Prod" | |
access_key_id = var.access_key_id | |
secret_access_key = var.secret_access_key | |
} | |
resource "qovery_cluster" "cluster_zcb13209d" { | |
organization_id = qovery_organization.organization_z51937012.id | |
credentials_id = qovery_aws_credentials.aws_creds_z5b99737b.id | |
name = "Qovery Prod Backend" | |
cloud_provider = "AWS" | |
region = "us-east-2" | |
instance_type = "t3a.2xlarge" | |
min_running_nodes = 3 | |
max_running_nodes = 10 | |
state = "DEPLOYED" | |
features = { | |
vpc_subnet = "10.0.0.0/16" | |
static_ip = "false" | |
} | |
routing_table = [ | |
] | |
advanced_settings_json = jsonencode( | |
{ | |
"registry.image_retention_time" : 31536000, | |
"load_balancer.size" : "lb-s", | |
"pleco.resources_ttl" : -1, | |
"loki.log_retention_in_week" : 12, | |
"aws.iam.admin_group" : "Admins", | |
"aws.vpc.enable_s3_flow_logs" : true, | |
"aws.vpc.flow_logs_retention_days" : 365, | |
"aws.cloudwatch.eks_logs_retention_days" : 365, | |
"aws.eks.ec2.metadata_imds" : "optional", | |
"cloud_provider.container_registry.tags" : {}, | |
"database.postgresql.deny_public_access" : true, | |
"database.mysql.deny_public_access" : true, | |
"database.mongodb.deny_public_access" : true, | |
"database.redis.deny_public_access" : true, | |
"database.postgresql.allowed_cidrs" : ["10.0.0.0/16"], | |
"database.mysql.allowed_cidrs" : ["10.0.0.0/16"], | |
"database.mongodb.allowed_cidrs" : ["10.0.0.0/16"], | |
"database.redis.allowed_cidrs" : ["10.0.0.0/16"] | |
} | |
) | |
} | |
resource "qovery_project" "project_z2e51a3dc" { | |
organization_id = qovery_organization.organization_z51937012.id | |
name = "Data Eng / Windmill" | |
description = "Windmill is an open source tool written in Rust to replace Airflow" | |
} | |
resource "qovery_environment" "environment_z0fc4f959" { | |
project_id = qovery_project.project_z2e51a3dc.id | |
cluster_id = qovery_cluster.cluster_zcb13209d.id | |
name = "production" | |
mode = "PRODUCTION" | |
environment_variables = [ | |
{ | |
key = "METRICS_ADDR" | |
value = "false" | |
}, | |
{ | |
key = "RUST_LOG" | |
value = "info" | |
}, | |
{ | |
key = "WM_BASE_URL" | |
value = "https://{{WINDMILL_SERVER_HOST}}" | |
} | |
] | |
} | |
resource "qovery_database" "database_z7ffdb63c" { | |
environment_id = qovery_environment.environment_z0fc4f959.id | |
name = "db" | |
type = "POSTGRESQL" | |
version = "14" | |
mode = "MANAGED" | |
accessibility = "PRIVATE" | |
storage = 50 | |
instance_type = "db.t3.medium" | |
deployment_stage_id = qovery_deployment_stage.deployment_stage_ze428a4f3.id | |
} | |
resource "qovery_application" "application_z53db3515" { | |
environment_id = qovery_environment.environment_z0fc4f959.id | |
name = "windmill-worker" | |
git_repository = { | |
url = "https://github.com/Qovery/windmill.git" | |
branch = "main" | |
root_path = "/" | |
} | |
cpu = 500 | |
memory = 512 | |
min_running_instances = 3 | |
max_running_instances = 6 | |
auto_preview = false | |
build_mode = "DOCKER" | |
dockerfile_path = "Dockerfile" | |
deployment_stage_id = qovery_deployment_stage.deployment_stage_z3ecd4f41.id | |
healthchecks = { | |
readiness_probe = { | |
type = { | |
} | |
initial_delay_seconds = 30 | |
period_seconds = 10 | |
timeout_seconds = 5 | |
failure_threshold = 9 | |
success_threshold = 1 | |
} | |
liveness_probe = { | |
type = { | |
} | |
initial_delay_seconds = 30 | |
period_seconds = 10 | |
timeout_seconds = 5 | |
failure_threshold = 9 | |
success_threshold = 1 | |
} | |
} | |
ports = [ | |
] | |
storage = [ | |
] | |
custom_domains = [ | |
] | |
environment_variables = [ | |
{ | |
key = "KEEP_JOB_DIR" | |
value = "false" | |
}, | |
{ | |
key = "DISABLE_SERVER" | |
value = "true" | |
}, | |
{ | |
key = "NUM_WORKERS" | |
value = "1" | |
} | |
] | |
advanced_settings_json = jsonencode( | |
{ | |
"deployment.delay_start_time_sec" : 30, | |
"deployment.termination_grace_period_seconds" : 60, | |
"deployment.custom_domain_check_enabled" : true, | |
"deployment.update_strategy.type" : "RollingUpdate", | |
"deployment.update_strategy.rolling_update.max_unavailable_percent" : 25, | |
"deployment.update_strategy.rolling_update.max_surge_percent" : 25, | |
"build.timeout_max_sec" : 1800, | |
"build.cpu_max_in_milli" : 4000, | |
"build.ram_max_in_gib" : 8, | |
"network.ingress.proxy_body_size_mb" : 100, | |
"network.ingress.enable_cors" : false, | |
"network.ingress.cors_allow_origin" : "*", | |
"network.ingress.cors_allow_methods" : "GET, PUT, POST, DELETE, PATCH, OPTIONS", | |
"network.ingress.cors_allow_headers" : "DNT,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization", | |
"network.ingress.proxy_buffer_size_kb" : 4, | |
"network.ingress.keepalive_time_seconds" : 3600, | |
"network.ingress.keepalive_timeout_seconds" : 60, | |
"network.ingress.send_timeout_seconds" : 60, | |
"network.ingress.proxy_connect_timeout_seconds" : 60, | |
"network.ingress.proxy_send_timeout_seconds" : 60, | |
"network.ingress.proxy_read_timeout_seconds" : 60, | |
"network.ingress.grpc_send_timeout_seconds" : 60, | |
"network.ingress.grpc_read_timeout_seconds" : 60, | |
"network.ingress.enable_sticky_session" : false, | |
"network.ingress.whitelist_source_range" : "0.0.0.0/0", | |
"network.ingress.denylist_source_range" : "", | |
"network.ingress.basic_auth_env_var" : "", | |
"hpa.cpu.average_utilization_percent" : 60, | |
"security.service_account_name" : "" | |
} | |
) | |
} | |
resource "qovery_application" "application_z91b63569" { | |
environment_id = qovery_environment.environment_z0fc4f959.id | |
name = "windmill-server" | |
git_repository = { | |
url = "https://github.com/Qovery/windmill.git" | |
branch = "main" | |
root_path = "/" | |
} | |
cpu = 1000 | |
memory = 1024 | |
min_running_instances = 1 | |
max_running_instances = 1 | |
auto_preview = false | |
build_mode = "DOCKER" | |
dockerfile_path = "Dockerfile" | |
deployment_stage_id = qovery_deployment_stage.deployment_stage_z3ecd4f41.id | |
healthchecks = { | |
readiness_probe = { | |
type = { | |
tcp = { | |
port = 8000 | |
} | |
} | |
initial_delay_seconds = 30 | |
period_seconds = 10 | |
timeout_seconds = 1 | |
failure_threshold = 3 | |
success_threshold = 1 | |
} | |
liveness_probe = { | |
type = { | |
tcp = { | |
port = 8000 | |
} | |
} | |
initial_delay_seconds = 30 | |
period_seconds = 10 | |
timeout_seconds = 5 | |
failure_threshold = 3 | |
success_threshold = 1 | |
} | |
} | |
ports = [ | |
{ | |
internal_port = 8000 | |
is_default = true | |
publicly_accessible = true | |
external_port = 443 | |
name = "p8000" | |
protocol = "HTTP" | |
} | |
] | |
storage = [ | |
] | |
custom_domains = [ | |
{ | |
domain = "https://windmill.qovery.com" | |
} | |
] | |
environment_variables = [ | |
{ | |
key = "NUM_WORKERS" | |
value = "0" | |
}, | |
{ | |
key = "DISABLE_SERVER" | |
value = "false" | |
}, | |
{ | |
key = "BASIC_AUTH_CREDENTIALS" | |
value = "qovery:$apr1$iJmyJw2E$YEwbIc0mp6z.KQ5UxZ24V." | |
} | |
] | |
advanced_settings_json = jsonencode( | |
{ | |
"deployment.delay_start_time_sec" : 30, | |
"deployment.termination_grace_period_seconds" : 60, | |
"deployment.custom_domain_check_enabled" : true, | |
"deployment.update_strategy.type" : "RollingUpdate", | |
"deployment.update_strategy.rolling_update.max_unavailable_percent" : 25, | |
"deployment.update_strategy.rolling_update.max_surge_percent" : 25, | |
"build.timeout_max_sec" : 1800, | |
"build.cpu_max_in_milli" : 4000, | |
"build.ram_max_in_gib" : 8, | |
"network.ingress.proxy_body_size_mb" : 100, | |
"network.ingress.enable_cors" : false, | |
"network.ingress.cors_allow_origin" : "*", | |
"network.ingress.cors_allow_methods" : "GET, PUT, POST, DELETE, PATCH, OPTIONS", | |
"network.ingress.cors_allow_headers" : "DNT,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization", | |
"network.ingress.proxy_buffer_size_kb" : 4, | |
"network.ingress.keepalive_time_seconds" : 3600, | |
"network.ingress.keepalive_timeout_seconds" : 60, | |
"network.ingress.send_timeout_seconds" : 60, | |
"network.ingress.proxy_connect_timeout_seconds" : 60, | |
"network.ingress.proxy_send_timeout_seconds" : 60, | |
"network.ingress.proxy_read_timeout_seconds" : 60, | |
"network.ingress.grpc_send_timeout_seconds" : 60, | |
"network.ingress.grpc_read_timeout_seconds" : 60, | |
"network.ingress.enable_sticky_session" : false, | |
"network.ingress.whitelist_source_range" : "0.0.0.0/0", | |
"network.ingress.denylist_source_range" : "", | |
"network.ingress.basic_auth_env_var" : "BASIC_AUTH_CREDENTIALS", | |
"hpa.cpu.average_utilization_percent" : 60, | |
"security.service_account_name" : "" | |
} | |
) | |
} | |
resource "qovery_application" "application_zd3816100" { | |
environment_id = qovery_environment.environment_z0fc4f959.id | |
name = "windmill-lsp" | |
git_repository = { | |
url = "https://github.com/Qovery/windmill.git" | |
branch = "main" | |
root_path = "/" | |
} | |
cpu = 500 | |
memory = 512 | |
min_running_instances = 1 | |
max_running_instances = 1 | |
auto_preview = false | |
build_mode = "DOCKER" | |
dockerfile_path = "Dockerfile.lsp" | |
deployment_stage_id = qovery_deployment_stage.deployment_stage_z3ecd4f41.id | |
healthchecks = { | |
readiness_probe = { | |
type = { | |
tcp = { | |
port = 3001 | |
} | |
} | |
initial_delay_seconds = 30 | |
period_seconds = 10 | |
timeout_seconds = 1 | |
failure_threshold = 3 | |
success_threshold = 1 | |
} | |
liveness_probe = { | |
type = { | |
tcp = { | |
port = 3001 | |
} | |
} | |
initial_delay_seconds = 30 | |
period_seconds = 10 | |
timeout_seconds = 5 | |
failure_threshold = 3 | |
success_threshold = 1 | |
} | |
} | |
ports = [ | |
{ | |
internal_port = 3001 | |
is_default = true | |
publicly_accessible = true | |
external_port = 443 | |
name = "p3001" | |
protocol = "HTTP" | |
} | |
] | |
storage = [ | |
] | |
custom_domains = [ | |
] | |
advanced_settings_json = jsonencode( | |
{ | |
"deployment.delay_start_time_sec" : 30, | |
"deployment.termination_grace_period_seconds" : 60, | |
"deployment.custom_domain_check_enabled" : true, | |
"deployment.update_strategy.type" : "RollingUpdate", | |
"deployment.update_strategy.rolling_update.max_unavailable_percent" : 25, | |
"deployment.update_strategy.rolling_update.max_surge_percent" : 25, | |
"build.timeout_max_sec" : 1800, | |
"build.cpu_max_in_milli" : 4000, | |
"build.ram_max_in_gib" : 8, | |
"network.ingress.proxy_body_size_mb" : 100, | |
"network.ingress.enable_cors" : false, | |
"network.ingress.cors_allow_origin" : "*", | |
"network.ingress.cors_allow_methods" : "GET, PUT, POST, DELETE, PATCH, OPTIONS", | |
"network.ingress.cors_allow_headers" : "DNT,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization", | |
"network.ingress.proxy_buffer_size_kb" : 4, | |
"network.ingress.keepalive_time_seconds" : 3600, | |
"network.ingress.keepalive_timeout_seconds" : 60, | |
"network.ingress.send_timeout_seconds" : 60, | |
"network.ingress.proxy_connect_timeout_seconds" : 60, | |
"network.ingress.proxy_send_timeout_seconds" : 60, | |
"network.ingress.proxy_read_timeout_seconds" : 60, | |
"network.ingress.grpc_send_timeout_seconds" : 60, | |
"network.ingress.grpc_read_timeout_seconds" : 60, | |
"network.ingress.enable_sticky_session" : false, | |
"network.ingress.whitelist_source_range" : "0.0.0.0/0", | |
"network.ingress.denylist_source_range" : "", | |
"network.ingress.basic_auth_env_var" : "", | |
"hpa.cpu.average_utilization_percent" : 60, | |
"security.service_account_name" : "" | |
} | |
) | |
} | |
resource "qovery_job" "job_z956377f7" { | |
environment_id = qovery_environment.environment_z0fc4f959.id | |
name = "init-db" | |
cpu = 200 | |
memory = 128 | |
max_nb_restart = 0 | |
max_duration_seconds = 300 | |
auto_preview = false | |
source = { | |
docker = { | |
git_repository = { | |
url = "https://github.com/Qovery/windmill.git" | |
branch = "main" | |
root_path = "/init/" | |
} | |
dockerfile_path = "Dockerfile" | |
} | |
} | |
schedule { | |
on_start = { | |
arguments = ["it"] | |
entrypoint = "null" | |
} | |
} | |
deployment_stage_id = qovery_deployment_stage.deployment_stage_zf6f678ba.id | |
healthchecks = { | |
readiness_probe = { | |
type = { | |
} | |
initial_delay_seconds = 30 | |
period_seconds = 10 | |
timeout_seconds = 5 | |
failure_threshold = 9 | |
success_threshold = 1 | |
} | |
liveness_probe = { | |
type = { | |
} | |
initial_delay_seconds = 30 | |
period_seconds = 10 | |
timeout_seconds = 5 | |
failure_threshold = 9 | |
success_threshold = 1 | |
} | |
} | |
environment_variables = [ | |
{ | |
key = "RESTORE_METHOD" | |
value = "psql" | |
} | |
] | |
advanced_settings_json = jsonencode( | |
{ | |
"build.timeout_max_sec" : 1800, | |
"build.cpu_max_in_milli" : 4000, | |
"build.ram_max_in_gib" : 8, | |
"deployment.termination_grace_period_seconds" : 60, | |
"job.delete_ttl_seconds_after_finished" : null, | |
"cronjob.concurrency_policy" : "Forbid", | |
"cronjob.failed_jobs_history_limit" : 1, | |
"cronjob.success_jobs_history_limit" : 1, | |
"security.service_account_name" : "" | |
} | |
) | |
} | |
resource "qovery_deployment_stage" "deployment_stage_ze428a4f3" { | |
environment_id = qovery_environment.environment_z0fc4f959.id | |
name = "db stage" | |
} | |
resource "qovery_deployment_stage" "deployment_stage_zf6f678ba" { | |
environment_id = qovery_environment.environment_z0fc4f959.id | |
name = "init db stage" | |
is_after = qovery_deployment_stage.deployment_stage_ze428a4f3.id | |
} | |
resource "qovery_deployment_stage" "deployment_stage_z3ecd4f41" { | |
environment_id = qovery_environment.environment_z0fc4f959.id | |
name = "windmill apps" | |
is_after = qovery_deployment_stage.deployment_stage_zf6f678ba.id | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variable "qovery_access_token" { | |
type = string | |
} | |
variable "access_key_id" { | |
type = string | |
} | |
variable "secret_access_key" { | |
type = string | |
} | |
variable "QOVERY_POSTGRESQL_Z7FFDB63C_PASSWORD" { | |
type = string | |
} | |
variable "QOVERY_POSTGRESQL_Z7FFDB63C_DATABASE_URL" { | |
type = string | |
} | |
variable "QOVERY_POSTGRESQL_Z7FFDB63C_DATABASE_URL_INTERNAL" { | |
type = string | |
} | |
variable "DATABASE_URL" { | |
type = string | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment