Giter Club home page Giter Club logo

Comments (4)

ToxicCypher avatar ToxicCypher commented on August 30, 2024 1

Thank you for the response @sfc-gh-asawicki, I literally just figured out what was wrong and it had everything to do with how the private key was being stored in AWS Secrets Manager and all is working as expected now!

Moving this issue to closed.

from terraform-provider-snowflake.

ToxicCypher avatar ToxicCypher commented on August 30, 2024

I am wondering if there is some form of pre-processing that must be done to the private key before passing it to the Snowflake provider configuration. We typically perform some processing when using the python connector with a private key but to my knowledge this is using the go gosnowflake library.

from terraform-provider-snowflake.

ToxicCypher avatar ToxicCypher commented on August 30, 2024

Removing new lines from the private key body stops complaining about the RSA key not being in a PEM format, but then compains about the JWT being invalid.

Sample Key:

-----BEGIN PRIVATE KEY-----
MIIJJwIBAAKCAgBbKusUIihl3myn27+OKsV1xpuRv9ik9wTNhbJOPl8+I5b1zjsQ...GwZ92w+osBZvR0qia2xYuJUpoS8NaJSlS2GCYigNKoldaN3QDEfHvm7Kxw==
-----END PRIVATE KEY-----

│ Error: open snowflake connection: 390144 (08004): JWT token is invalid. [ff4e4855-9e30-4213-b0b6-edcc5d94f200]
│ 
│   with provider["[registry.terraform.io/snowflake-labs/snowflake](http://registry.terraform.io/snowflake-labs/snowflake)"],
│   on [main.tf](http://main.tf/) line 36, in provider "snowflake":
│   36: provider "snowflake" {
│ 
╵

from terraform-provider-snowflake.

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

Hey @ToxicCypher. Thanks for reporting the issue.

At first glance, it does not look like a problem with the provider. The error code 08004 indicates that the connection was rejected. The error 390144 is mentioned here: https://docs.snowflake.com/en/user-guide/key-pair-auth-troubleshooting#list-of-errors with possible troubleshooting:

390144 JWT_TOKEN_INVALID There is a general issue with the JWT token. For possible solutions, see Common Errors and Solutions.

Please make sure that your key is generated correctly according to docs.
You should copy the exact content from the generated key file.

Also, you can try using private_key with terraform file function like:

private_key = file("<filepath>")

where <filepath> points to your private key file.

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.