-
Notifications
You must be signed in to change notification settings - Fork 426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
resource_monitor trying to update existing start_timestamp #1957
Comments
Thank you for bringing this to my attention. Snowflake uses session parameters for determining which timezone to use. Terraform performs the create successfully, and the result of the read is different than what was used for the create, meaning that Terraform thinks a diff is necessary. I would recommend changing your user session parameters to be consistent with that of the UTC timezone. Alternatively, your workaround is also valid. I am not sure what the best solution to fixing this in Terraform is in the long term. Perhaps a more intelligent diff calculation that takes into consideration timezones from user vs account. Or perhaps recommending to set session parameters at the provider level, which will be used for all session timezone calculations. I will need to think about it. It affects some other resources as well, which is why we need a general solution. |
I also am experiencing this issue on The formatting of the time stamp seems to differ between the provider, snowflake, and state. For example, to create a resource it is documented as:
Its saved in the state file as:
However, you cannot do as you suggest and use the same format as the state file to create/update the resource:
|
In addition, you cannot change either the
|
Also on |
Hey @VickyWinner, @kalinon. Thanks for creating the issue. We have recently merge #2214 touching dates in the snowflake_resource_monitor resource. It was the part of v0.80.0. Could you check if the issue still persists? |
@sfc-gh-asawicki unfortunately we are blocked from upgrading our provider until #2169 is fixed |
@kalinon, please check out this comment #2169 (comment). This is the current behavior, which we won't be altering shortly. It is aligned with the underlying gosnowflake driver. Please define |
I will give that a try |
Hey @kalinon, I will close this issue; please open a new one if you are experiencing this problem in the more recent versions of the provider. |
Provider Version
Terraform Version
Terraform v1.5.1
on windows_amd64
The version of Terraform you were using when the bug was encountered.
Terraform v1.5.1
on windows_amd64
Describe the bug
I am passing start_timestamp in UTC per doc and the resource gets created successfully. However, when I run
terraform plan
again, It says there is an in-place-upgrade.A clear and concise description of what the bug is.
Expected behavior
Running
terraform plan
should say "No infrastructure changes".Code samples and commands
https://registry.terraform.io/providers/Snowflake-Labs/snowflake/latest/docs/resources/resource_monitor#example-usage
Additional context
Upon checking, It looks like the current timestamp is being converted to EST (my local timezone) and comparing with the HCL. But it fails when
terraform apply
is run because the input time is already passed.There is another issue in resource_monitor. When I try to change the input start_timestamp to modify the resource monitor to a new date/time, It wouldn't accept new input and throws below error. I am forced to delete and re-create the whole resource. Is this by design?
workaround
By adding
lifecycle
block under the resource_monitor.lifecycle {
ignore_changes = [
start_timestamp,
]
}
The text was updated successfully, but these errors were encountered: