terraform-provider-snowflake icon indicating copy to clipboard operation
terraform-provider-snowflake copied to clipboard

Issue with port resolution when using host param

Open phelios opened this issue 3 years ago • 2 comments

Provider Version

0.33.1

Terraform Version

1.1.7

Describe the bug

I'm trying to use the new host param in the provider setup to redirect our connection through a proxy. I think the problem is the parsing from the host to the url/connection host that doesn't work quite right. Note that the proxy is working fine when tested using the Python connector (outside of Terraform).

Here are some examples:

  • When I include protocol in the host, the port is reported as missing. host="https://our.proxy.com"
    • Same behaviour when I include the port in the url like host="https://our.proxy.com:443"
Error: 260004: failed to parse a port number. port: 
  • When I don't include the protocol, the routing failed in our proxy. host="our.proxy.com"
Error: 261004 (08004): failed to auth for unknown reason. HTTP: 405, URL: https://our.proxy.com:443/se...
  • When I include the port in the host, it says that the port became 443:443. host="our.proxy.com:443"
Error: 260004: failed to parse a port number. port: 443:443

Expected behavior I'm not sure how to configure this to make this work. Any helps will be appreciated. Also it would be helpful if someone can give me some pointers on how host works and some examples.

Code samples and commands

Sample provider setup

# Snowflake Providers
provider "snowflake" {
  username = var.snowflake_username
  password = data.password
  account  = var.snowflake_account
  region   = var.snowflake_region
  host = var.snowflake_host # this is where I tried a different format of the host

  role = "SOMEROLE"
}

phelios avatar May 10 '22 06:05 phelios

Did you ever identify a workaround?

indy-jonesy avatar Feb 08 '23 03:02 indy-jonesy

Is your account param formatted correctly? It should just be the Locator code for you Snowflake account (ex. ABC12345) and not a full URL.

I got this confusing port error Error: open snowflake connection: 260004: failed to parse a port number when I had the account param formatted as a full URL like https://abcdef-abc12345.snowflakecomputing.com, but changing the acount param to just the account locator fixed this and I didn't need to specify the port param at all.

davidzajac1 avatar Feb 08 '24 19:02 davidzajac1

We are closing this issue as part of a cleanup described in announcement. If you believe that the issue is still valid in v0.89.0, please open a new ticket.

sfc-gh-asawicki avatar Apr 30 '24 17:04 sfc-gh-asawicki