Terraform Module for Managing Snowflake Stages
This Terraform module is designed to create a Snowflake Stage. A stage in Snowflake is a temporary storage area where data files are loaded before being processed into operational tables. The module allows you to customize various aspects of the stage.
Here's a brief overview of the variables in the module:
name
: The unique identifier for the stage within the database and schema.database
: The name of the database in which the stage will be created.schema
: The name of the schema in which the stage will be created.comment
: An optional comment for the stage.copy_options
: Optional copy options for the stage.credentials
: Sensitive credentials for the stage.directory
: Optional directory settings for the stage.encryption
: Optional encryption settings for the stage.file_format
: Optional file format for the stage.
The module creates a snowflake_stage resource with these variables. The resource represents the stage in Snowflake.
To use the module, you call it from your main Terraform configuration, providing values for the variables. The module then creates the stage in Snowflake according to your specifications.
Example CICD with BitBucket
and Codefresh
:
The bare minimum you need to reference to use the module are the required variables. In this case, they are name, database, and schema. Here's how you can use the module with just these variables:
module "snowflake_stage" {
source = "git::https://github.com/Richard-Barrett/terraform-snowflake-stages.git?ref=0.0.1"
name = "my_stage"
database = "my_database"
schema = "my_schema"
}
To use this Terraform module, you need to call it from your main Terraform configuration file. Here's an example of how you can do this:
module "snowflake_stage" {
source = "git::https://github.com/Richard-Barrett/terraform-snowflake-stages.git?ref=0.0.1"
name = "my_stage"
database = "my_database"
schema = "my_schema"
comment = "This is my stage"
copy_options = "COPY_OPTION"
credentials = "SENSITIVE_CREDENTIALS"
directory = "DIRECTORY_SETTING"
encryption = "ENCRYPTION_SETTING"
file_format = "FILE_FORMAT"
}
In this example, replace the values of name, database, schema, comment, copy_options, credentials, directory, encryption, and file_format with your actual values. Also, replace ./modules/snowflake_stage with the actual path to your module.
After setting up the module call, you can initialize your Terraform configuration with the command terraform init, and then apply it with the command terraform apply.
This Terraform module creates a Snowflake Stage with customizable properties like name, database, schema, comment, copy options, credentials, directory, encryption, and file format. You call it from your main Terraform configuration, providing values for these variables.
Name | Version |
---|---|
terraform | >= 1.3.6 |
snowflake | ~> 0.90.0 |
Name | Version |
---|---|
snowflake | 0.90.0 |
No modules.
Name | Type |
---|---|
snowflake_stage.this | resource |
Name | Description | Type | Default | Required |
---|---|---|---|---|
comment | Specifies a comment for the stage. | string |
null |
no |
copy_options | Specifies the copy options for the stage. | string |
null |
no |
credentials | Specifies the credentials for the stage. | string |
null |
no |
database | The database in which to create the stage. | string |
n/a | yes |
directory | Specifies the directory settings for the stage. | string |
null |
no |
encryption | Specifies the encryption settings for the stage. | string |
null |
no |
file_format | Specifies the file format for the stage. | string |
null |
no |
name | Specifies the identifier for the stage; must be unique for the database and schema in which the stage is created. | string |
n/a | yes |
schema | The schema in which to create the stage. | string |
n/a | yes |
No outputs.