Quickstart: Snowflake terraform and private key password

I’m working through the quickstart guide and have reached another roadblock. The snowflake terraform script is asking me for a password for my private key. I did not create a private key with a password. I have been able to successfully access the snowflake API using the same key, so I am certain the problem is not the key.

This is the error I’m getting:

Terraform planned the following actions, but then encountered a problem:
│ Error: could not build dsn for snowflake connection: Private Key could not be parsed: Private key requires a passphrase, but private_key_passphrase was not supplied

Hey @scelerat the current quick-start for Snowflake is a little out of date from our latest way of operating (its in my backlog to get the guides updated!).

If you look at the latest version of the loader you will see what I mean: GitHub - snowplow-devops/terraform-aws-snowflake-loader-ec2

We have moved away from maintaining Terraform code for setting up the Snowflake elements and instead now just require a few lines of SQL to be executed for the setup part. Would you be able to give that a try and see if you can get the quick-start working in that way?

That helped! I was able to set up the snowflake resources as specified in the link you set.

Now I’m trying to figure out what the collector dns is so I can send my first event. Not finding anything :thinking:

So the quickstart should have deployed a load balancer for the collector - that would be what you send data to.

Specifically this output: quickstart-examples/outputs.tf at main · snowplow/quickstart-examples · GitHub

So when I run terraform plan, I get a message that says

collector_dns_name = (known after apply)

When I run apply, I get a bunch of Errors (because resources have already been created), but I never see a real value for the collector_dns. Is it hidden somewhere in a config file?

So the apply should not fail - it will only display after a successful apply.

All of the errors I’m getting are “already exists” errors. So I interpreted that as things have been created successfully at one point, and the repeated run of ‘apply’ is resulting in an error. Is there a way to tear down the resources and start over from terraform, or do I just need to do that manually through the AWS console?

terraform destroy :slight_smile:

Got it. But… destroy doesn’t seem to destroy all the resources apply created. I’'m so lost.

After running destroy, I get

Destroy complete! Resources: 16 destroyed.

But then I run apply again and have messages like

│ Error: Error import KeyPair: InvalidKeyPair.Duplicate: The keypair already exists
│ 	status code: 400, request id: 6136b342-9a7a-4ed6-80e1-968cdd4086db
│   with aws_key_pair.pipeline,
│   on main.tf line 45, in resource "aws_key_pair" "pipeline":
│   45: resource "aws_key_pair" "pipeline" {

│ Error: Unable to create stream: ResourceInUseException: Stream sp-bad-1-stream under account 478156707454 already exists.
│   with module.bad_1_stream.aws_kinesis_stream.stream,
│   on .terraform/modules/bad_1_stream/main.tf line 12, in resource "aws_kinesis_stream" "stream":
│   12: resource "aws_kinesis_stream" "stream" {

Hi Josh, I wonder if there is any way you can help. I’m at a dead end. I have started fresh from a new AWS account, trying to follow the snowplow quickstart instructions, and I still get these “resource already created” errors when I run terraform apply. I don’t know how to get around this

Have responded on your most recent post @scelerat - I am sure we can get it working.

1 Like