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

feat: Allow setting resource monitor on account #768

Merged
merged 7 commits into from
Nov 30, 2021
Merged

feat: Allow setting resource monitor on account #768

merged 7 commits into from
Nov 30, 2021

Conversation

gouline
Copy link
Contributor

@gouline gouline commented Nov 26, 2021

Allow setting resource monitor on the account scope.

Fixes #721

Test Plan

  • acceptance tests

References

@alldoami
Copy link
Contributor

/ok-to-test sha=4bb6820

@github-actions
Copy link

Integration tests failure for 4bb6820

@alldoami
Copy link
Contributor

=== CONT  TestAcc_ResourceMonitor
    resource_monitor_acceptance_test.go:16: ImportStateVerify attributes not equivalent. Difference is shown below. Top is actual, bottom is expected.
        
        (map[string]string) {
        }
        
        
        (map[string]string) (len=1) {
         (string) (len=15) "set_for_account": (string) (len=4) "true"
        }
--- FAIL: TestAcc_ResourceMonitor (6.76s)

@gouline
Copy link
Contributor Author

gouline commented Nov 30, 2021

Hopefully this fixes it. Not quite sure what's causing it and cannot reproduce locally (without a test Snowflake account), so best I can do is get it as close to network_policy_attachment_acceptance_test.go that it's based on as possible.

@alldoami
Copy link
Contributor

/ok-to-test sha=a8644ca

@github-actions
Copy link

Integration tests failure for a8644ca

@gouline
Copy link
Contributor Author

gouline commented Nov 30, 2021

I think I understand now: network_policy_attachment just disables ImportStateVerify because it doesn't read the resource state and hence has no way to verify it. Resource monitors have a level column that's set to ACCOUNT when set_for_account is true, so I added that to ReadResourceMonitor.

Does this look right?

@alldoami
Copy link
Contributor

/ok-to-test sha=fe10649

@github-actions
Copy link

Integration tests success for fe10649

@alldoami
Copy link
Contributor

/ok-to-test sha=5cfe055

@github-actions
Copy link

Integration tests success for 5cfe055

@alldoami
Copy link
Contributor

Thank you!

@alldoami alldoami merged commit 2613aa3 into Snowflake-Labs:main Nov 30, 2021
@gouline gouline deleted the account-resource-monitor branch December 8, 2021 11:49
daniepett pushed a commit to daniepett/terraform-provider-snowflake that referenced this pull request Feb 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Question] Assign resource monitor to account level?
2 participants