astronomer / terraform-provider-astro

Astro Terraform Provider
https://registry.terraform.io/providers/astronomer/astro/latest
Other
11 stars 4 forks source link

Allow dynamic isDevelopmentMode for deployment resource #173

Closed vandyliu closed 5 days ago

vandyliu commented 6 days ago

Description

Customer wants to use isDevelopmentMode dynamically like so:

resource "astro_deployment" "team_1_dev_deployment" {
#     original_astro_runtime_version = "11.3.0"
  name                    = "team-1-dev-deployment3"
  description             = "Team 1 Dev Deployment"
  type                    = "STANDARD"
  cloud_provider          = "AWS"
  region                  = "us-east-1"
  contact_emails          = []
  default_task_pod_cpu    = "0.25"
  default_task_pod_memory = "0.5Gi"
  executor                = "CELERY"
  is_cicd_enforced        = true
  is_dag_deploy_enabled   = true
  is_development_mode     = var.environment_name == "prd" ? true : false
  is_high_availability    = false
  resource_quota_cpu      = "10"
  resource_quota_memory   = "20Gi"
  scheduler_size          = "SMALL"
  workspace_id            = astro_workspace.team_1_workspace.id
  environment_variables   = []
  worker_queues = [{
    name               = "default"
    is_default         = true
    astro_machine      = "A5"
    max_worker_count   = 10
    min_worker_count   = 0
    worker_concurrency = 1
  }]
  scaling_spec = var.environment_name == "prd" ? null : {
    hibernation_spec = {
      schedules = [{
        hibernate_at_cron    = "1 * * * *"
        is_enabled           = true
        wake_at_cron         = "59 * * * *"
      }]
    }
  }
}

variable "environment_name" {
  type    = string
  default = "prd"
}

Our static validation does not allow this so I removed it.

🧪 Functional Testing