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

snowflake_failover_group object types showing changes on every run #2517

Closed
gdelia-pm opened this issue Feb 16, 2024 · 3 comments · Fixed by #2513
Closed

snowflake_failover_group object types showing changes on every run #2517

gdelia-pm opened this issue Feb 16, 2024 · 3 comments · Fixed by #2513
Labels
bug Used to mark issues with provider's incorrect behavior

Comments

@gdelia-pm
Copy link

gdelia-pm commented Feb 16, 2024

Terraform CLI and Provider Versions

 .\terraform.exe version
Terraform v1.7.3
on windows_amd64
+ provider registry.terraform.io/snowflake-labs/snowflake v0.86.0

Terraform Configuration

resource "snowflake_failover_group" "SOURCE_FAILOVER_GROUP" {
  depends_on = [snowflake_database.DB, snowflake_storage_integration.AZURE_STORAGE_INTEGRATION_DEV, snowflake_role.FUNCTIONAL_ROLES, snowflake_warehouse.WH,]

  name                      = "FAILOVER_GROUP1"
  object_types              = ["ACCOUNT PARAMETERS", "DATABASES", "INTEGRATIONS", "NETWORK POLICIES", "RESOURCE MONITORS", "ROLES", "USERS", "WAREHOUSES"]
  allowed_accounts          = ["ACCOUNT.CORE1", "ACCOUNT.CORE_DR1"]
  allowed_integration_types = ["SECURITY INTEGRATIONS", "STORAGE INTEGRATIONS"]
  allowed_databases         = toset([for db in snowflake_database.DB : db.name])

  replication_schedule {
    interval = 15 # minutes
  }
}

Expected Behavior

After the initial apply no further plan should be generated.

Actual Behavior

On every plan, object type PARAMETERS is detected as removed, while ACCOUNT PARAMETERS is set to be added.
This seems to be a result of how snowflake stores the account parameter option, as it's noted as just parameter when running show failover groups. I think the tf provider is reading the parameters on each load and seeing that as different than the accepted object type of account parameters.

I can work around this by creating the group with the "ACCOUNT PARAMETERS" object type, applying the config, then changing my object type to "PARAMETERS" to suppress the change, but if I have to make another change that breaks things.

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # snowflake_failover_group.SOURCE_FAILOVER_GROUP will be updated in-place
  ~ resource "snowflake_failover_group" "SOURCE_FAILOVER_GROUP" {
        id                        = "FAILOVER_GROUP1"
        name                      = "FAILOVER_GROUP1"
      ~ object_types              = [
          - "PARAMETERS",
          + "ACCOUNT PARAMETERS",
            # (7 unchanged elements hidden)
        ]
        # (5 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

Steps to Reproduce

  1. add the failover resource with object type "ACCOUNT PARAMETERS"
  2. terraform apply
  3. terraform apply will show an unexpected change
  4. changing the object type on the failover resource to "PARAMETERS" will stop detecting a new change
  5. terraform destroy
  6. terraform apply will fail with the PARAMETERS object type set for a new resource

How much impact is this issue causing?

Medium

Logs

No response

Additional Information

No response

@gdelia-pm gdelia-pm added the bug Used to mark issues with provider's incorrect behavior label Feb 16, 2024
sfc-gh-asawicki added a commit that referenced this issue Feb 19, 2024
@sfc-gh-asawicki
Copy link
Collaborator

Hey @gdelia-pm. Thanks for reaching out to us.

I confirmed that this is undocumented Snowflake behavior (returning PARAMETERS instead of ACCOUNT PARAMETERS). I have adjusted the SDK logic in #2522. It should be merged before 0.87.0 release.

sfc-gh-asawicki added a commit that referenced this issue Feb 19, 2024
Add to migration guide

Remove comment
sfc-gh-asawicki added a commit that referenced this issue Feb 20, 2024
- `SHOW FAILOVER GROUPS` return `PARAMETERS` instead of `ACCOUNT
PARAMETERS`
- acceptance tests were unskipped by adding environment variable
- SDK integration tests still stay skipped

References: #2517
sfc-gh-jcieslak pushed a commit that referenced this issue Feb 28, 2024
🤖 I have created a release *beep* *boop*
---


##
[0.87.0](v0.86.0...v0.87.0)
(2024-02-28)


### 🎉 **What's new:**

* Add network rule to the sdk
([#2526](#2526))
([b379565](b379565))
* supports collation of table column
([#2496](#2496))
([56771f1](56771f1))


### 🔧 **Misc**

* Clean up environment variables in tests and on CI
([#2543](#2543))
([9a10cb1](9a10cb1))
* replace warning in new grant resources with info log
([#2521](#2521))
([c3014b9](c3014b9))


### 🐛 **Bug fixes:**

* data retention days follow up
([#2566](#2566))
([7aba384](7aba384))
* data retention time parameters
([#2502](#2502))
([76abf21](76abf21))
* data retention time parameters follow-up
([#2530](#2530))
([5544544](5544544))
* Demote warning to info and set volatility for procedures and functions
([#2567](#2567))
([abaad7c](abaad7c)),
closes
[#2536](#2536)
* Fix ACCOUNT PARAMETERS option failover group resource
([#2522](#2522))
([61883f3](61883f3)),
closes
[#2517](#2517)
* Fix failover group alter syntax and suppression for pipe statement
([#2562](#2562))
([24d76c3](24d76c3))
* Fix few tests
([#2515](#2515))
([a523a6b](a523a6b))
* Fix provider config hierarchy
([#2551](#2551))
([677a12b](677a12b))
* Fix query_results in unsafe_execute resource
([#2512](#2512))
([94ca158](94ca158)),
closes
[#2491](#2491)
* Fix replication for database resource
([#2524](#2524))
([767fbce](767fbce)),
closes
[#2021](#2021)
* Fix show by id for external functions
([#2531](#2531))
([d910a84](d910a84)),
closes
[#2528](#2528)
* Fix various small problems
([#2552](#2552))
([f558ce6](f558ce6))
* Granting database roles
([#2511](#2511))
([dc27d64](dc27d64)),
closes
[#2402](#2402)
* grants on external volumes
([#2538](#2538))
([1de9a29](1de9a29))
* Handle old reference for table_id in table constraint resource
([#2558](#2558))
([d1e8912](d1e8912)),
closes
[#2535](#2535)
* loosen identifier field validation for account object identifiers
([#2564](#2564))
([a5ed8cd](a5ed8cd))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: snowflake-release-please[bot] <105954990+snowflake-release-please[bot]@users.noreply.github.com>
@sfc-gh-asawicki
Copy link
Collaborator

Hey @gdelia-pm . We have released the fix as part of v0.87.0 release. Please follow the migration guide during the update. Please confirm that the issue is resolved in the newest version. Thanks!

@gdelia-pm
Copy link
Author

Confirming this is fixed in 0.87. Thanks!

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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants