Skip to content

Commit

Permalink
fix: update dependencies for snowflake modules to ensure proper resou…
Browse files Browse the repository at this point in the history
…rce creation order
  • Loading branch information
dgniewek committed Nov 13, 2024
1 parent 700a29b commit 2057a8c
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,6 @@ module "snowflake_default_role" {
database_grants = lookup(each.value, "database_grants", {})
schema_grants = lookup(each.value, "schema_grants", [])
schema_objects_grants = lookup(each.value, "schema_objects_grants", {})

depends_on = [
snowflake_database.this
]
}

module "snowflake_custom_role" {
Expand All @@ -89,10 +85,6 @@ module "snowflake_custom_role" {
database_grants = lookup(each.value, "database_grants", {})
schema_grants = lookup(each.value, "schema_grants", [])
schema_objects_grants = lookup(each.value, "schema_objects_grants", {})

depends_on = [
snowflake_database.this
]
}

module "snowflake_schema" {
Expand Down Expand Up @@ -139,11 +131,6 @@ module "snowflake_schema" {
roles = each.value.roles

create_default_roles = coalesce(each.value.create_default_roles, var.create_default_roles)

# depends_on = [
# module.snowflake_default_role,
# module.snowflake_custom_role
# ]
}

resource "snowflake_grant_ownership" "database_ownership" {
Expand All @@ -158,6 +145,8 @@ resource "snowflake_grant_ownership" "database_ownership" {

# In order to create all resources before transferring ownership
depends_on = [
module.snowflake_schema
module.snowflake_default_role,
module.snowflake_custom_role,
module.snowflake_schema,
]
}

0 comments on commit 2057a8c

Please sign in to comment.