Skip to content
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

New resource monitor SDK unexpected behavior #1990

Closed
dlouseiro opened this issue Aug 1, 2023 · 5 comments
Closed

New resource monitor SDK unexpected behavior #1990

dlouseiro opened this issue Aug 1, 2023 · 5 comments
Assignees
Labels
bug Used to mark issues with provider's incorrect behavior category:resource resource:resource_monitor Issue connected to the snowflake_resource_monitor resource

Comments

@dlouseiro
Copy link

dlouseiro commented Aug 1, 2023

Provider Version

0.69.0

Terraform Version

1.5.4

Describe the bug

After upgrading the provider to version 0.69.0 (where the new resource monitor SDK starts being used), my terraform plan fails with Error: object does not exist or not authorized when the object exists in the account.

Expected behavior

For the terraform plan not to fail.

Code samples and commands

Resource monitor definition:

resource "snowflake_resource_monitor" "monthly" {
  name            = "MONTHLY"
  credit_quota    = 12000
  notify_triggers = [100]
  set_for_account = true
}
@dlouseiro dlouseiro added the bug Used to mark issues with provider's incorrect behavior label Aug 1, 2023
@dlouseiro
Copy link
Author

Update on this topic: Removing the resource from the state and re-importing solves the issue!

@sfc-gh-jcieslak sfc-gh-jcieslak added category:resource resource:resource_monitor Issue connected to the snowflake_resource_monitor resource labels May 20, 2024
@sfc-gh-jcieslak
Copy link
Collaborator

Hey 👋
I'm currently working on the resource monitor as part of preparing GA objects for V1, so a lot may change, and the improvements are coming. I'll let you know when the updated resource is available. I may know where the issue lies; it shouldn't happen in the new resource monitor.

@sfc-gh-jcieslak
Copy link
Collaborator

sfc-gh-jcieslak commented Sep 5, 2024

Update: I just tested it, and this issue won't occur in the upcoming version of the provider. This case may happen when a resource monitor doesn't exist on the Snowflake side (e.g., due to manual removal), but the provider thinks otherwise and tries to read its configuration from Snowflake.

@sfc-gh-jcieslak sfc-gh-jcieslak self-assigned this Sep 5, 2024
sfc-gh-jcieslak added a commit that referenced this issue Sep 11, 2024
## Changes
- Add ValuePresent assert to our custom assertions
- Add ToConfigValues function for every model
- Update Resource Monitor SDK + unit and integration tests
- Update Resource Monitor Resource + acc tests
- Handle issues connected to the resource monitor (mostly timestamp
format difference causing infinite plan or only trigger updates causing
SQL compilation error):
  -  #1500 
  - #1624 
  - #1716 
  - #1754 
  - #1821 
  - #1832 
  - #1990

## Next pr
- Adjust examples and update migration notes
- Data source (impl, tests, examples, migration notes)

## References
* [CREATE RESOURCE
MONITOR](https://docs.snowflake.com/en/sql-reference/sql/create-resource-monitor)
sfc-gh-fbudzynski pushed a commit that referenced this issue Sep 19, 2024
## Changes
- Add ValuePresent assert to our custom assertions
- Add ToConfigValues function for every model
- Update Resource Monitor SDK + unit and integration tests
- Update Resource Monitor Resource + acc tests
- Handle issues connected to the resource monitor (mostly timestamp
format difference causing infinite plan or only trigger updates causing
SQL compilation error):
  -  #1500 
  - #1624 
  - #1716 
  - #1754 
  - #1821 
  - #1832 
  - #1990

## Next pr
- Adjust examples and update migration notes
- Data source (impl, tests, examples, migration notes)

## References
* [CREATE RESOURCE
MONITOR](https://docs.snowflake.com/en/sql-reference/sql/create-resource-monitor)
@sfc-gh-jcieslak
Copy link
Collaborator

Hey 👋
The new and refactored resource monitor was released yesterday in version 0.96.0 of the provider. Please migrate with migration guide and let me know if the issue has been resolved so we could close the ticket. Thanks in advance 🙏.

@sfc-gh-jcieslak
Copy link
Collaborator

Closing due to long inactivity. Please, create another issue if you think the problem is still not resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Used to mark issues with provider's incorrect behavior category:resource resource:resource_monitor Issue connected to the snowflake_resource_monitor resource
Projects
None yet
Development

No branches or pull requests

2 participants