resource "env0_environment_scheduling" does not pass destroy_cron=null on updates
away168 opened this issue · comments
Describe the bug
When using env0_environment_scheduling resource with a
destroycron=null
on a subsequent update to the resource we get this error:
Error: could not create or update environment scheduling: 400 Bad Request: /body/destroy must have required property 'cron', /body/destroy must be null, /body/destroy must match a schema in anyOf
How To Reproduce
- tofu apply env0_environment_scheduling on an existing environment.
terraform {
required_providers {
env0 = {
source = "env0/env0"
version = "~> 1.18.5"
}
}
}
locals {
environment_id = "63a4a4e1-501f-4617-8b41-a46a7238c73c"
}
resource "env0_environment_scheduling" "environment_scheduling" {
environment_id = local.environment_id
deploy_cron = "45 21 * * 0,2,7"
destroy_cron = null
}
- modify the env0_environment_scheduling deploy_cron to something else.
resource "env0_environment_scheduling" "environment_scheduling" {
environment_id = local.environment_id
deploy_cron = "45 21 * * *"
destroy_cron = null
}
- Run tofu apply again ^
- Get error from backend.
Expected behavior
Resource should get updated without errors.
Provider Version
1.18.5
Additional context
n/a