How snowflakedb/terraform-provider-snowflake works
This is the Snowflake Terraform provider: Terraform configuration is planned and applied through the provider to manage Snowflake objects using SQL. The main workflow is configuration → provider resource or data-source handling → SDK request/query operations → Snowflake, with returned state or queried objects exposed to Terraform. The tree also shows storage-integration variants and lifecycle policies, including an attachment resource. The detailed source excerpts focus on these storage features; broader resource coverage is documented by the README, while most provider registration and other resource implementations were not sampled.
Main entry points: storage_integrations_gen.go Storage operations · provider.go Object resources · storage_lifecycle_policies_gen.go Lifecycle operations · storage_integrations.go Storage queries
Components 19
Terraform provider
- Provider entry
main.go - Provider configuration
pkg/provider/provider.go - Object resources
pkg/provider/provider.go - Object data sources
pkg/provider/provider.go - Preview controls
pkg/provider/previewfeatures/preview_features.go
Storage management
- Storage integrations
pkg/resources/storage_integration.go - AWS integration
pkg/resources/storage_integration_aws.go - Azure integration
pkg/resources/storage_integration_azure.go - GCS integration
pkg/resources/storage_integration_gcs.go - Lifecycle policies
pkg/resources/storage_lifecycle_policy.go - Policy attachment
pkg/resources/table_storage_lifecycle_policy_attachment.go - Storage queries
pkg/datasources/storage_integrations.go - Lifecycle queries
pkg/datasources/storage_lifecycle_policies.go
Snowflake SDK
- Storage operations
pkg/sdk/storage_integrations_gen.go - Lifecycle operations
pkg/sdk/storage_lifecycle_policies_gen.go - SQL definitions
pkg/sdk/generator/defs/storage_integrations_def.go - Storage schemas
pkg/schemas/storage_integration_all_details_gen.go
Other components
- Terraform CLI
- Snowflake account
Connections 22
- Terraform CLI → Provider entry: starts provider
README.md - Provider entry → Provider configuration: loads configuration
main.go - Terraform CLI → Object resources: plans and applies
README.md - Terraform CLI → Object data sources: queries objects
README.md - Object resources → Storage integrations: handles integration
- Object resources → Lifecycle policies: handles policy
- Object resources → Policy attachment: handles attachment
- Object data sources → Storage queries: exposes query
- Object data sources → Lifecycle queries: exposes query
- Storage integrations → Storage operations: builds requests
pkg/resources/storage_integration.go - AWS integration → Storage operations: builds requests
pkg/resources/storage_integration_aws.go - Azure integration → Storage operations: builds requests
pkg/resources/storage_integration_azure.go - GCS integration → Storage operations: uses SDK
- Lifecycle policies → Lifecycle operations: uses SDK
pkg/resources/storage_lifecycle_policy.go - Policy attachment → Lifecycle operations: uses SDK
pkg/resources/table_storage_lifecycle_policy_attachment.go - Storage queries → Storage operations: shows objects
pkg/datasources/storage_integrations.go - Storage queries → Storage schemas: converts results
pkg/datasources/storage_integrations.go - Lifecycle queries → Lifecycle operations: shows objects
pkg/datasources/storage_lifecycle_policies.go - Storage operations → Snowflake account: executes SQL
README.md - Lifecycle operations → Snowflake account: executes SQL
- SQL definitions → Storage operations: defines operations
- Preview controls → Storage integrations: gates features