Open toni-moreno opened 1 year ago
reviewing the error, seems like TIMESTAMP_OUTPUT_FORMAT is the default YYYY-MM-DD HH24:MI:SS.FF3 TZHTZM
and when the provider runs a SHOW RESOURCE MONITORS
here:
It gets the following timestamp
that is different than used in the resource this is becouse terraform thinks it has changed
# snowflake_resource_monitor.RM["RM_ETL"] will be updated in-place
~ resource "snowflake_resource_monitor" "RM" {
~ end_timestamp = "2023-11-01T05:00:00-07:00" -> "2023-11-01 12:00"
id = "RM_ETL"
name = "RM_ETL"
~ start_timestamp = "2023-04-14T05:00:00-07:00" -> "2023-04-14 12:00"
# (7 unchanged attributes hidden)
}
But the resource doesn't accept other format than "YYYY-MM-DD HH:MM" as input. when trying to change timestamp to the default output format
"RM_ETL" = {
quota = 100
frequency = "NEVER"
start_timestamp = "2023-29-03T05:00:00-07:00"
end_timestamp = "2023-11-01T05:00:00-07:00"
notify_triggers = [75, 100]
warehouses = ["ETL"]
}
this error happens.
Invalid date/time format string '2023-29-03T05:00:00-07:00': Invalid format: "2023-29-03T05:00:00-07:00" is malformed at "T05:00:00-07:00"
the solution seems to change TIMESTAMP_OUTPUT_FORMAT to the same format than supported in input before the SHOW RESOURCES MONITOR
in the current terraform opened session.
alter session set TIMESTAMP_OUTPUT_FORMAT = 'YYYY-MM-DD HH24:MI'
Provider & terraform Version
Describe the bug
Terraform is marking as changed a
snowflake_resource_monitor
resource but it didn't change.Expected behavior
When re-plan without changes it marks resource as changed , when re-apply it fails
Code samples and commands
When executing first
terraform apply
everything seems ok but in snowflake ui the time is not the same than expected form my terraform codeMy Snowflake account is in
switzerland-north.azure
and my timezone isEurope/Madrid
.When re-plan without changes the provider is showing me the resource as changed.
When re-apply ( force it ) it fails
Here there is 3 things to review .
1) what timezone is taking the provider by default 2) how can I change in the
end_timestamp
andstart_timestamp
parameters ? 3) ( the bug) why is talking about changed parameters that indeed didn't change 4) (the bug) why is failing when force re-apply.