Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions terraform/common_db_schema.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
import {
to = snowflake_warehouse.xs_wh
id = "XS_WH"
}

resource "snowflake_warehouse" "xs_wh" {
provider = snowflake.sysadmin
name = "XS_WH"
warehouse_size = "XSMALL"
auto_suspend = 60
auto_resume = true
enable_query_acceleration = false
query_acceleration_max_scale_factor = 0
}

resource "snowflake_database" "common_db" {
provider = snowflake.sysadmin
name = "COMMON"
Expand Down
43 changes: 43 additions & 0 deletions terraform/import_shares_logical_grouping.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
module "logical_import_layer" {
source = "github.com/inovex/snowform_logical_import_layer.git?ref=0.0.2"


# Location for the stored procedure
procedure_database = "COMMON"
procedure_schema = "COMMON"

# Map source objects to logical layer targets
source_to_target_mappings = {
"CUSTOMER_LEADS_IMPORTED_DB.SNOWFORM_SCHEMA.CUSTOMER_LEADS" = {
target_database = "IMPORTED_INOVEX"
target_schema = "CUSTOMER_DATA"
target_name = "CUSTOMER_LEADS"
}
"CUSTOMER_LEADS_IMPORTED_DB.SNOWFORM_SCHEMA.CUSTOMER_LOCATION" = {
target_database = "IMPORTED_INOVEX"
target_schema = "CUSTOMER_DATA"
target_name = "CUSTOMER_LOCATION"
}
"CUSTOMER_LEADS_IMPORTED_DB.SNOWFORM_SCHEMA.INOVEX_LOCATIONS" = {
target_database = "IMPORTED_INOVEX"
target_schema = "LOCATION_DATA"
target_name = "INOVEX_LOCATIONS"
}
}

# Grant read access to roles
database_role_grants = {
"IMPORTED_INOVEX" = [
"SYSADMIN",
],
}

providers = {
snowflake.sysadmin = snowflake.sysadmin
snowflake.securityadmin = snowflake.securityadmin
}

depends_on = [
snowflake_warehouse.xs_wh,
]
}
2 changes: 1 addition & 1 deletion terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ terraform {
required_providers {
snowflake = {
source = "snowflakedb/snowflake"
version = "~> 2.7.0"
version = "~> 2.14.0"
}
}
}
5 changes: 3 additions & 2 deletions terraform/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ provider "snowflake" {
alias = "sysadmin"
authenticator = "SNOWFLAKE_JWT"
driver_tracing = "debug"
preview_features_enabled = ["snowflake_notification_integration_resource", "snowflake_procedure_sql_resource"]
preview_features_enabled = ["snowflake_notification_integration_resource", "snowflake_procedure_sql_resource", "snowflake_procedure_python_resource"]
warehouse = "XS_WH"
}

provider "snowflake" {
Expand All @@ -36,5 +37,5 @@ provider "snowflake" {
alias = "securityadmin"
authenticator = "SNOWFLAKE_JWT"
driver_tracing = "debug"
preview_features_enabled = ["snowflake_procedure_sql_resource", "snowflake_network_rule_resource", "snowflake_network_policy_attachment_resource", "snowflake_authentication_policy_resource", "snowflake_user_authentication_policy_attachment_resource"]
preview_features_enabled = ["snowflake_procedure_sql_resource", "snowflake_network_policy_attachment_resource", "snowflake_authentication_policy_resource", "snowflake_user_authentication_policy_attachment_resource"]
}
Loading