Skip to content

Commit

Permalink
Merge pull request #31 from Snowflake-Labs/sovereign-cloud-support
Browse files Browse the repository at this point in the history
Fix colon spacing on the for statements.
  • Loading branch information
sfc-gh-bkou authored Dec 17, 2024
2 parents 65e8a68 + d72ebc0 commit 1d98aea
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ module "storage_integration" {
env = var.env

# AWS
arn_format = var.arn_format
data_bucket_arns = var.data_bucket_arns

# Snowflake
Expand All @@ -15,6 +14,7 @@ module "storage_integration" {

providers = {
snowflake.storage_integration_role = snowflake.storage_integration_role
snowsql.storage_integration_role = snowsql.storage_integration_role
aws = aws
}
}
7 changes: 7 additions & 0 deletions examples/complete/snowsql_provider.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
provider "snowsql" {
alias = "storage_integration_role"

account = var.snowflake_account
role = var.snowflake_storage_integration_owner_role
username = "example_user"
}
9 changes: 7 additions & 2 deletions examples/complete/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 4.38.0"
version = "~> 5.72.0"
}

snowflake = {
source = "Snowflake-Labs/snowflake"
version = "~> 0.64.0"
version = "~> 0.73.0"
}

snowsql = {
source = "aidanmelen/snowsql"
version = "~> 1.3.3"
}
}
}
4 changes: 2 additions & 2 deletions storage_integration.tf
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ resource "snowsql_exec" "snowflake_storage_integration" {
}

locals {
storage_integration_user_arn = local.terraform_resource_provider == "snowflake" ? snowflake_storage_integration.this[0].storage_aws_iam_user_arn : [for map in jsondecode(nonsensitive(snowsql_exec.snowflake_storage_integration[0].read_results)): map if map.property == "STORAGE_AWS_IAM_USER_ARN"][0]["property_value"]
storage_integration_user_arn = local.terraform_resource_provider == "snowflake" ? snowflake_storage_integration.this[0].storage_aws_iam_user_arn : [for map in jsondecode(nonsensitive(snowsql_exec.snowflake_storage_integration[0].read_results)) : map if map.property == "STORAGE_AWS_IAM_USER_ARN"][0]["property_value"]

storage_integration_external_id = local.terraform_resource_provider == "snowflake" ? snowflake_storage_integration.this[0].storage_aws_external_id : [for map in jsondecode(nonsensitive(snowsql_exec.snowflake_storage_integration[0].read_results)): map if map.property == "STORAGE_AWS_EXTERNAL_ID"][0]["property_value"]
storage_integration_external_id = local.terraform_resource_provider == "snowflake" ? snowflake_storage_integration.this[0].storage_aws_external_id : [for map in jsondecode(nonsensitive(snowsql_exec.snowflake_storage_integration[0].read_results)) : map if map.property == "STORAGE_AWS_EXTERNAL_ID"][0]["property_value"]
}

resource "snowflake_integration_grant" "this" {
Expand Down

0 comments on commit 1d98aea

Please sign in to comment.