-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add Support for snowflake destination
- Loading branch information
Showing
11 changed files
with
352 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Snowflake | ||
|
||
Configuration in this directory creates kinesis firehose stream with Direct Put as source and Snowflake as destination. | ||
|
||
This example can be tested with Demo Data in Kinesis Firehose Console. | ||
|
||
## Usage | ||
|
||
To run this example you need to execute: | ||
|
||
```bash | ||
$ terraform init | ||
$ terraform plan | ||
$ terraform apply | ||
``` | ||
|
||
Note that this example may create resources which cost money. Run `terraform destroy` when you don't need these resources. | ||
|
||
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK --> | ||
## Requirements | ||
|
||
| Name | Version | | ||
|------|---------| | ||
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 | | ||
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | ~> 5.0 | | ||
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 2.0 | | ||
|
||
## Providers | ||
|
||
| Name | Version | | ||
|------|---------| | ||
| <a name="provider_aws"></a> [aws](#provider\_aws) | ~> 5.0 | | ||
| <a name="provider_random"></a> [random](#provider\_random) | >= 2.0 | | ||
|
||
## Modules | ||
|
||
| Name | Source | Version | | ||
|------|--------|---------| | ||
| <a name="module_firehose"></a> [firehose](#module\_firehose) | ../../../ | n/a | | ||
|
||
## Resources | ||
|
||
| Name | Type | | ||
|------|------| | ||
| [aws_kms_key.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/kms_key) | resource | | ||
| [aws_s3_bucket.s3](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket) | resource | | ||
| [random_pet.this](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/pet) | resource | | ||
|
||
## Inputs | ||
|
||
| Name | Description | Type | Default | Required | | ||
|------|-------------|------|---------|:--------:| | ||
| <a name="input_name_prefix"></a> [name\_prefix](#input\_name\_prefix) | Name prefix to use in resources | `string` | `"firehose-to-snowflake"` | no | | ||
|
||
## Outputs | ||
|
||
| Name | Description | | ||
|------|-------------| | ||
| <a name="output_firehose_role"></a> [firehose\_role](#output\_firehose\_role) | Firehose Role | | ||
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
resource "random_pet" "this" { | ||
length = 2 | ||
} | ||
|
||
resource "aws_s3_bucket" "s3" { | ||
bucket = "${var.name_prefix}-dest-bucket-${random_pet.this.id}" | ||
force_destroy = true | ||
} | ||
|
||
resource "aws_kms_key" "this" { | ||
description = "${var.name_prefix}-kms-key" | ||
deletion_window_in_days = 7 | ||
} | ||
|
||
module "firehose" { | ||
source = "../../../" | ||
name = "${var.name_prefix}-delivery-stream" | ||
destination = "snowflake" | ||
snowflake_account_identifier = "demo" | ||
snowflake_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDIQEU9NvCE4EyK0QZtFBLYWX6KAnNmel4zHsNJ4WEjNzY/YEASrJ9YtHjxItVig4kQqumn8FWkbPoKLUYUqIq9UBIvtjzlsTgMJ7GznShsm0M/n1Bszqmxwm1AwFAPfH21h2MNIzXkHitg/2BN3bkTGctmySF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cPAoGBAKeZPBmSbWCwYplvsB/tuU8AWsVDIUO96dFgwnXj5O5c9SLDn/+c3ULIxcTQAo/CkVbHVK9nVxQciilYZ16vLn9AumGJ07XXL4KxHX0/FhuLpq2mw0DP4YdJi6W8hZ/EhVAuazy0Gd4TjHkY9Hz/upHqB0mNfHvbpH8jzxYBujFhAoGBAMn0LHHuaajivswiK9QpM95qv2tk1wC7spZQXh2Ky4TYcTo3S83datye7Uk85NKYt4790anaGjegA6cTbuky8FgnGm1+iqVhyGxfUMPwREgWOZ3km0DeQGHxApYHiVx2xD6oZzTVpgxM7S6pCX2YxxWQolq7mIfOg5h6U6b5GmiT" | ||
snowflake_user = "user" | ||
snowflake_database = "database" | ||
snowflake_schema = "schema" | ||
snowflake_table = "table" | ||
snowflake_data_loading_option = "VARIANT_CONTENT_AND_METADATA_MAPPING" | ||
snowflake_metadata_column_name = "test" | ||
snowflake_content_column_name = "test" | ||
snowflake_role_configuration_enabled = true | ||
snowflake_role_configuration_role = "snowflake_role" | ||
s3_backup_mode = "FailedOnly" | ||
s3_backup_prefix = "backup/" | ||
s3_backup_bucket_arn = aws_s3_bucket.s3.arn | ||
s3_backup_buffering_interval = 100 | ||
s3_backup_buffering_size = 100 | ||
s3_backup_compression = "GZIP" | ||
s3_backup_enable_encryption = true | ||
s3_backup_kms_key_arn = aws_kms_key.this.arn | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
output "firehose_role" { | ||
description = "Firehose Role" | ||
value = module.firehose.kinesis_firehose_role_arn | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
variable "name_prefix" { | ||
description = "Name prefix to use in resources" | ||
type = string | ||
default = "firehose-to-snowflake" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
terraform { | ||
required_version = ">= 0.13.1" | ||
|
||
required_providers { | ||
aws = { | ||
source = "hashicorp/aws" | ||
version = "~> 5.0" | ||
} | ||
random = { | ||
source = "hashicorp/random" | ||
version = ">= 2.0" | ||
} | ||
} | ||
} |
Oops, something went wrong.