diff --git a/docs/resources/deployment.md b/docs/resources/deployment.md index b6a79ea8..2f36ef43 100644 --- a/docs/resources/deployment.md +++ b/docs/resources/deployment.md @@ -89,6 +89,34 @@ resource "astro_deployment" "hybrid" { }] } +resource "astro_deployment" "hybrid_celery" { + original_astro_runtime_version = "11.3.0" + name = "my hybrid celery deployment" + description = "an example deployment with celery executor" + type = "HYBRID" + cluster_id = "clnp86ly5000401ndagu20g81" + contact_emails = ["example@astronomer.io"] + executor = "CELERY" + is_cicd_enforced = true + is_dag_deploy_enabled = true + scheduler_replicas = 1 + scheduler_au = 5 + workspace_id = "clnp86ly5000401ndaga20g81" + environment_variables = [{ + key = "key1" + value = "value1" + is_secret = false + }] + worker_queues = [{ + name = "default" + is_default = true + node_pool_id = "clnp86ly5000301ndzfxz895w" + max_worker_count = 10 + min_worker_count = 0 + worker_concurrency = 1 + }] +} + // Import an existing deployment import { id = "clv17vgft000801kkydsws63x" // ID of the existing deployment @@ -147,7 +175,7 @@ resource "astro_deployment" "imported_deployment" { - `scheduler_replicas` (Number) Deployment scheduler replicas - required for 'HYBRID' deployments - `scheduler_size` (String) Deployment scheduler size - required for 'STANDARD' and 'DEDICATED' deployments - `task_pod_node_pool_id` (String) Deployment task pod node pool identifier - required if executor is 'KUBERNETES' and type is 'HYBRID' -- `worker_queues` (Attributes Set) Deployment worker queues - required for deployments with 'CELERY' executor (see [below for nested schema](#nestedatt--worker_queues)) +- `worker_queues` (Attributes Set) Deployment worker queues - required for deployments with 'CELERY' executor. For 'STANDARD' and 'DEDICATED' deployments, use astro_machine. For 'HYBRID' deployments, use node_pool_id. (see [below for nested schema](#nestedatt--worker_queues)) ### Read-Only diff --git a/examples/resources/astro_deployment/resource.tf b/examples/resources/astro_deployment/resource.tf index a7649976..08940c4c 100644 --- a/examples/resources/astro_deployment/resource.tf +++ b/examples/resources/astro_deployment/resource.tf @@ -74,6 +74,34 @@ resource "astro_deployment" "hybrid" { }] } +resource "astro_deployment" "hybrid_celery" { + original_astro_runtime_version = "11.3.0" + name = "my hybrid celery deployment" + description = "an example deployment with celery executor" + type = "HYBRID" + cluster_id = "clnp86ly5000401ndagu20g81" + contact_emails = ["example@astronomer.io"] + executor = "CELERY" + is_cicd_enforced = true + is_dag_deploy_enabled = true + scheduler_replicas = 1 + scheduler_au = 5 + workspace_id = "clnp86ly5000401ndaga20g81" + environment_variables = [{ + key = "key1" + value = "value1" + is_secret = false + }] + worker_queues = [{ + name = "default" + is_default = true + node_pool_id = "clnp86ly5000301ndzfxz895w" + max_worker_count = 10 + min_worker_count = 0 + worker_concurrency = 1 + }] +} + // Import an existing deployment import { id = "clv17vgft000801kkydsws63x" // ID of the existing deployment diff --git a/internal/provider/schemas/deployment.go b/internal/provider/schemas/deployment.go index 6315a4a8..7f8ce52c 100644 --- a/internal/provider/schemas/deployment.go +++ b/internal/provider/schemas/deployment.go @@ -214,7 +214,7 @@ func DeploymentResourceSchemaAttributes() map[string]resourceSchema.Attribute { NestedObject: resourceSchema.NestedAttributeObject{ Attributes: WorkerQueueResourceSchemaAttributes(), }, - MarkdownDescription: "Deployment worker queues - required for deployments with 'CELERY' executor", + MarkdownDescription: "Deployment worker queues - required for deployments with 'CELERY' executor. For 'STANDARD' and 'DEDICATED' deployments, use astro_machine. For 'HYBRID' deployments, use node_pool_id.", Validators: []validator.Set{ // Dynamic validation with 'executor' done in the resource.ValidateConfig function setvalidator.SizeAtLeast(1),