Comments (4)
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.
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.
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.
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)
- snowflake_table: Add support for virtual columns HOT 1
- snowflake_grant_privileges_to_role doesn't work with for_each role HOT 1
- SQL compilation error when single quotes are present in snowflake_role comments HOT 1
- snowflake_function cannot be declared IMMUTABLE HOT 1
- Enable change_tracking on view HOT 1
- Crash when creating stream referencing only the schema and name HOT 2
- The snowflake_grant_privileges_to_role resource does not include an enable_multiple_grants flag HOT 3
- snowflake warehouses break if not enterprise because of query_acceleration_max_scale_factor HOT 1
- snowflake_object_parameter resource import has missing fields HOT 1
- snowflake_schema crashing when importing HOT 2
- Event Table resource missing? HOT 2
- grant_privileges_to_role doesn't recognize changes to `with_grant_option` that were made outside of Terraform HOT 15
- snowflake roles appear as deleted after upgrading from provider 0.84.1 to 0.85.0 HOT 8
- Failed to instantiate provider "registry.terraform.io/snowflake-labs/snowflake" HOT 2
- Managed account broken after rename in 0.85 HOT 2
- snowflake_grant_privileges_to_role all_privileges=true not updating the DB state correctly HOT 8
- [Docs]: Resource migration guide should inform about new capabilities in terraform 1.7 HOT 1
- Test
- test2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from terraform-provider-snowflake.