diff --git a/internal/provider/resources/resource_deployment_test.go b/internal/provider/resources/resource_deployment_test.go index f6eb1cd3..c76d7398 100644 --- a/internal/provider/resources/resource_deployment_test.go +++ b/internal/provider/resources/resource_deployment_test.go @@ -446,7 +446,7 @@ resource "astro_deployment" "%v" { %v %v %v -} + } `, input.Name, input.Name, utils.TestResourceDescription, input.Name, input.Name, input.Description, input.ClusterId, input.Executor, input.SchedulerAu, input.Name, envVarsStr(input.IncludeEnvironmentVariables), wqStr, taskPodNodePoolIdStr) @@ -468,6 +468,23 @@ func standardDeployment(input standardDeploymentInput) string { if input.Executor == string(platform.DeploymentExecutorCELERY) { wqStr = workerQueuesStr("") } + var scalingSpecStr string + + if input.IsDevelopmentMode == true { + scalingSpecStr = `scaling_spec = { + hibernation_spec = { + schedules = [{ + hibernate_at_cron = "1 * * * *" + is_enabled = true + wake_at_cron = "59 * * * *" + }] + override = { + is_hibernating = true + override_until = "2025-04-25T12:58:00+05:30" + } + } + }` + } return fmt.Sprintf(` resource "astro_workspace" "%v_workspace" { name = "%s" @@ -495,10 +512,11 @@ resource "astro_deployment" "%v" { workspace_id = astro_workspace.%v_workspace.id %v %v + %v } `, input.Name, input.Name, utils.TestResourceDescription, input.Name, input.Name, input.Description, input.Region, input.CloudProvider, input.Executor, input.IsDevelopmentMode, input.SchedulerSize, input.Name, - envVarsStr(input.IncludeEnvironmentVariables), wqStr) + envVarsStr(input.IncludeEnvironmentVariables), wqStr, scalingSpecStr) } func standardDeploymentWithVariableName(input standardDeploymentInput) string {