Giter Club home page Giter Club logo

Comments (4)

jasonicarter avatar jasonicarter commented on August 30, 2024

Another issue similar to this was fixed for me with this merge #1873
Based on the snippet, you probably want X4LARGE or 4X-LARGE to get it working

func ToWarehouseSize(s string) (WarehouseSize, error) {
s = strings.ToUpper(s)
switch s {
case "XSMALL", "X-SMALL":
return WarehouseSizeXSmall, nil
case "SMALL":
return WarehouseSizeSmall, nil
case "MEDIUM":
return WarehouseSizeMedium, nil
case "LARGE":
return WarehouseSizeLarge, nil
case "XLARGE", "X-LARGE":
return WarehouseSizeXLarge, nil
case "XXLARGE", "X2LARGE", "2X-LARGE":
return WarehouseSizeXXLarge, nil
case "XXXLARGE", "X3LARGE", "3X-LARGE":
return WarehouseSizeXXXLarge, nil
case "X4LARGE", "4X-LARGE":
return WarehouseSizeX4Large, nil
case "X5LARGE", "5X-LARGE":
return WarehouseSizeX5Large, nil
case "X6LARGE", "6X-LARGE":
return WarehouseSizeX6Large, nil
default:
return "", fmt.Errorf("invalid warehouse size: %s", s)
}
}

from terraform-provider-snowflake.

askldjd avatar askldjd commented on August 30, 2024

I am already using 4X-LARGE in my code.

from terraform-provider-snowflake.

sfc-gh-klim avatar sfc-gh-klim commented on August 30, 2024

Could repro the issue, using any warehouse size above LARGE.

from terraform-provider-snowflake.

sfc-gh-swinkler avatar sfc-gh-swinkler commented on August 30, 2024

It appears like you have an invalid warehouse size saved in your state file, which causes you to be stuck in validation. 4XLARGE is not a valid size as per: https://docs.snowflake.com/en/sql-reference/sql/create-warehouse#optional-properties-objectproperties. I am wondering even how you were able to get in this state.

In any case, it is a simple enough fix. We can just add 4XLARGE to the ToWarehouseSize(s string) function

	case "X4LARGE", "4X-LARGE", "4XLARGE":
		return WarehouseSizeX4Large, nil

and might as well do the same for other potential misspellings. @sfc-gh-pbosak has a PR to fix this, i was able to verify it works by first creating a warehouse with 4X-LARGE, then editing the state manually to 4XLARGE, then running terraform plan and it showed no diff, whereas without the change it would return the error you described.

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.