-
Notifications
You must be signed in to change notification settings - Fork 416
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
858cd36
commit c5db8d6
Showing
7 changed files
with
199 additions
and
12 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
33 changes: 33 additions & 0 deletions
33
pkg/resources/testdata/TestAcc_ExternalTable_TagsUpdate/1/test.tf
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,33 @@ | ||
resource "snowflake_storage_integration" "i" { | ||
name = var.name | ||
storage_allowed_locations = [var.location] | ||
storage_provider = "S3" | ||
storage_aws_role_arn = var.aws_arn | ||
} | ||
|
||
resource "snowflake_stage" "test" { | ||
name = var.name | ||
url = var.location | ||
database = var.database | ||
schema = var.schema | ||
storage_integration = snowflake_storage_integration.i.name | ||
} | ||
|
||
resource "snowflake_external_table" "test_table" { | ||
name = var.name | ||
database = var.database | ||
schema = var.schema | ||
comment = "Terraform acceptance test" | ||
column { | ||
name = "column1" | ||
type = "STRING" | ||
as = "TO_VARCHAR(TO_TIMESTAMP_NTZ(value:unix_timestamp_property::NUMBER, 3), 'yyyy-mm-dd-hh')" | ||
} | ||
column { | ||
name = "column2" | ||
type = "TIMESTAMP_NTZ(9)" | ||
as = "($1:\"CreatedDate\"::timestamp)" | ||
} | ||
file_format = "TYPE = CSV" | ||
location = "@\"${var.database}\".\"${var.schema}\".\"${snowflake_stage.test.name}\"" | ||
} |
19 changes: 19 additions & 0 deletions
19
pkg/resources/testdata/TestAcc_ExternalTable_TagsUpdate/1/variables.tf
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,19 @@ | ||
variable "name" { | ||
type = string | ||
} | ||
|
||
variable "location" { | ||
type = string | ||
} | ||
|
||
variable "aws_arn" { | ||
type = string | ||
} | ||
|
||
variable "database" { | ||
type = string | ||
} | ||
|
||
variable "schema" { | ||
type = string | ||
} |
43 changes: 43 additions & 0 deletions
43
pkg/resources/testdata/TestAcc_ExternalTable_TagsUpdate/2/test.tf
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,43 @@ | ||
resource "snowflake_storage_integration" "i" { | ||
name = var.name | ||
storage_allowed_locations = [var.location] | ||
storage_provider = "S3" | ||
storage_aws_role_arn = var.aws_arn | ||
} | ||
|
||
resource "snowflake_stage" "test" { | ||
name = var.name | ||
url = var.location | ||
database = var.database | ||
schema = var.schema | ||
storage_integration = snowflake_storage_integration.i.name | ||
} | ||
|
||
resource "snowflake_tag" "tag" { | ||
name = "test_tag" | ||
database = var.database | ||
schema = var.schema | ||
} | ||
|
||
resource "snowflake_external_table" "test_table" { | ||
name = var.name | ||
database = var.database | ||
schema = var.schema | ||
comment = "Terraform acceptance test" | ||
column { | ||
name = "column1" | ||
type = "STRING" | ||
as = "TO_VARCHAR(TO_TIMESTAMP_NTZ(value:unix_timestamp_property::NUMBER, 3), 'yyyy-mm-dd-hh')" | ||
} | ||
column { | ||
name = "column2" | ||
type = "TIMESTAMP_NTZ(9)" | ||
as = "($1:\"CreatedDate\"::timestamp)" | ||
} | ||
file_format = "TYPE = CSV" | ||
location = "@\"${var.database}\".\"${var.schema}\".\"${snowflake_stage.test.name}\"" | ||
tag { | ||
name = "\"${var.database}\".\"${var.schema}\".\"test_tag\"" | ||
value = "tag_value" | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
pkg/resources/testdata/TestAcc_ExternalTable_TagsUpdate/2/variables.tf
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,19 @@ | ||
variable "name" { | ||
type = string | ||
} | ||
|
||
variable "location" { | ||
type = string | ||
} | ||
|
||
variable "aws_arn" { | ||
type = string | ||
} | ||
|
||
variable "database" { | ||
type = string | ||
} | ||
|
||
variable "schema" { | ||
type = string | ||
} |
33 changes: 33 additions & 0 deletions
33
pkg/resources/testdata/TestAcc_ExternalTable_TagsUpdate/3/test.tf
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,33 @@ | ||
resource "snowflake_storage_integration" "i" { | ||
name = var.name | ||
storage_allowed_locations = [var.location] | ||
storage_provider = "S3" | ||
storage_aws_role_arn = var.aws_arn | ||
} | ||
|
||
resource "snowflake_stage" "test" { | ||
name = var.name | ||
url = var.location | ||
database = var.database | ||
schema = var.schema | ||
storage_integration = snowflake_storage_integration.i.name | ||
} | ||
|
||
resource "snowflake_external_table" "test_table" { | ||
name = var.name | ||
database = var.database | ||
schema = var.schema | ||
comment = "Terraform acceptance test" | ||
column { | ||
name = "column1" | ||
type = "STRING" | ||
as = "TO_VARCHAR(TO_TIMESTAMP_NTZ(value:unix_timestamp_property::NUMBER, 3), 'yyyy-mm-dd-hh')" | ||
} | ||
column { | ||
name = "column2" | ||
type = "TIMESTAMP_NTZ(9)" | ||
as = "($1:\"CreatedDate\"::timestamp)" | ||
} | ||
file_format = "TYPE = CSV" | ||
location = "@\"${var.database}\".\"${var.schema}\".\"${snowflake_stage.test.name}\"" | ||
} |
19 changes: 19 additions & 0 deletions
19
pkg/resources/testdata/TestAcc_ExternalTable_TagsUpdate/3/variables.tf
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,19 @@ | ||
variable "name" { | ||
type = string | ||
} | ||
|
||
variable "location" { | ||
type = string | ||
} | ||
|
||
variable "aws_arn" { | ||
type = string | ||
} | ||
|
||
variable "database" { | ||
type = string | ||
} | ||
|
||
variable "schema" { | ||
type = string | ||
} |