Snowflake-Labs / terraform-provider-snowflake

Terraform provider for managing Snowflake accounts
https://registry.terraform.io/providers/Snowflake-Labs/snowflake/latest
MIT License
552 stars 420 forks source link

[Bug]: snowflake_task (Resource) #3069

Open olevenkov opened 2 months ago

olevenkov commented 2 months ago

Terraform CLI Version

1.8.5

Terraform Provider Version

0.92.0

Terraform Configuration

I am facing issues with "enabled  = true" even it set to true when deploying it turn into false in state...

resource "snowflake_task" "test_task" {
  comment = "task with allow_overlapping_execution"

  database = "database"
  schema   = "schema"

  name          = "test_task"
  sql_statement = "select 1 as c;"

  allow_overlapping_execution = true
  enabled                     = true
}

Category

category:resource

Object type(s)

resource:task

Expected Behavior

enabled = true should be true

Actual Behavior

enabled = true should be true

Steps to Reproduce

deploy task with enabled = true

How much impact is this issue causing?

High

Logs

No response

Additional Information

No response

Would you like to implement a fix?

sfc-gh-asawicki commented 2 months ago

Hey @olevenkov. Thanks for reaching out to us.

We are currently reworking tasks, I will add this to the list of known issues here: https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/v1-preparations/ESSENTIAL_GA_OBJECTS.MD.

From what I see, your definition does not contain any of SCHEDULE, AFTER, FINALIZE, or WHEN. Such tasks cannot be resumed in Snowflake; enabled just calls resume. You should see an error when running with environment variable TF_LOG=DEBUG (something like Task <name> should have a SCHEDULE, AFTER, FINALIZE or WHEN to be resumed.).