Giter Club home page Giter Club logo

Comments (3)

Aaron-K-T-Berry avatar Aaron-K-T-Berry commented on August 30, 2024

Can confirm this is still an issue. Currently you are unable to create a resource monitor with credit quota other than 0 with all other values resulting in the above error. #111 seems suspect as the cause of this issue.

from terraform-provider-snowflake.

NJAldwin avatar NJAldwin commented on August 30, 2024

We are also running into this.

If I'm understanding the original issue #109 correctly, even though this parameter is an int, it is returned from Snowflake as a float? Seems likely that the fix for both issues would be to use an int for the parameter, but to accept a float back from snowflake?

from terraform-provider-snowflake.

Aaron-K-T-Berry avatar Aaron-K-T-Berry commented on August 30, 2024

For anyone looking for a workaround to this problem in the mean time you can use a snowsql run via Terraform to update the credit quota after provisioning the resource monitor. Examples below.

locals {
  resource_monitor_name = "FOO_RESOURCE_MONITOR"
  credit_quote          = 100
  warehouse_name        = "FOO_WAREHOUSE"
}

resource "snowflake_resource_monitor" "resource_monitors" {
  lifecycle {
    ignore_changes = [
      # Ignore changes to credit quota as they are modified via a manual sql file
      credit_quota
    ]
  }

  name         = local.resource_monitor_name
  credit_quota = 0
}

resource "null_resource" "resource_monitor_credit_quotas" {
  depends_on = [snowflake_resource_monitor.resource_monitors]

  # Run the script every time apply is run
  triggers = {
    run_always = "${timestamp()}"
  }

  provisioner "local-exec" {
    command = "/usr/local/bin/snowsql -o variable_substitution=true  -f ${path.module}/update-quotas.sql --variable resource_monitor=${snowflake_resource_monitor.resource_monitors.name} --variable credit_quota=${local.credit_quote}"
  }
}

resource "snowflake_warehouse" "warehouses" {
  name             = local.warehouse_name
  resource_monitor = snowflake_resource_monitor.resource_monitors.name
}

And the update-quotas.sql looking something like.

ALTER RESOURCE MONITOR &resource_monitor SET CREDIT_QUOTA=&credit_quota;

from terraform-provider-snowflake.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.