Skip to content

Commit

Permalink
Merge branch 'main' into docs-refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
yanmastin-astro authored Dec 6, 2024
2 parents 76ddd32 + d1333d4 commit 4a76ae3
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 2 deletions.
30 changes: 29 additions & 1 deletion docs/resources/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ["[email protected]"]
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
Expand Down Expand Up @@ -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

Expand Down
28 changes: 28 additions & 0 deletions examples/resources/astro_deployment/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ["[email protected]"]
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
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/schemas/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 4a76ae3

Please sign in to comment.