From e5b0b4b95bde9e0d29c0066278393a572dccd825 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Cie=C5=9Blak?= Date: Wed, 8 May 2024 13:22:59 +0200 Subject: [PATCH] chore: Add small adjustments (#2783) Done in the pr: - Added CREATE NOTEBOOKS privilege (and other missing privileges) based on https://docs.snowflake.com/en/sql-reference/sql/grant-privilege#syntax - Added references to the FAQ in issue templates --- .github/ISSUE_TEMPLATE/01-bug.yml | 3 +- .github/ISSUE_TEMPLATE/02-general-usage.yml | 3 +- .github/ISSUE_TEMPLATE/03-documentation.yml | 2 +- .github/ISSUE_TEMPLATE/04-feature-request.yml | 2 +- .github/ISSUE_TEMPLATE/config.yml | 11 ++++-- pkg/sdk/privileges.go | 39 +++++++++++-------- 6 files changed, 34 insertions(+), 26 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/01-bug.yml b/.github/ISSUE_TEMPLATE/01-bug.yml index 42a3bfd82d..bfb0ede485 100644 --- a/.github/ISSUE_TEMPLATE/01-bug.yml +++ b/.github/ISSUE_TEMPLATE/01-bug.yml @@ -5,8 +5,6 @@ labels: ["bug"] body: - type: markdown attributes: - # TODO(SNOW-1003360): Link doc how to submit issues and FAQ - # - [Frequently Asked Questions](https://github.com/Snowflake-Labs/) value: | # Thank you for raising a bug report! @@ -16,6 +14,7 @@ body: If you would like to contribute to the project, please let us know and refer to the [contribution guide](https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/CONTRIBUTING.md) for tips on getting started. Here's a list of useful links that may help you with your issue: + - [Guide on creating issues + FAQ + Commonly Known Issues](https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/CREATING_ISSUES.md) - If you would like to create a GitHub issue, please read our guide first. It contains useful links, FAQ, and commonly known issues with solutions that may already solve your case. - [Migration Guide](https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/MIGRATION_GUIDE.md) - when introducing breaking changes, we note them in the migration guide and describe how to upgrade to the next version. If you recently upgraded the provider version, please check if you applied all the needed changes. - type: markdown diff --git a/.github/ISSUE_TEMPLATE/02-general-usage.yml b/.github/ISSUE_TEMPLATE/02-general-usage.yml index d14fc630c4..dd25831fb2 100644 --- a/.github/ISSUE_TEMPLATE/02-general-usage.yml +++ b/.github/ISSUE_TEMPLATE/02-general-usage.yml @@ -5,8 +5,6 @@ labels: ["general-usage"] body: - type: markdown attributes: - # TODO(SNOW-1003360): Link doc how to submit issues and FAQ - # - [Frequently Asked Questions](https://github.com/Snowflake-Labs/) value: | # Thank you for raising an issue! @@ -20,6 +18,7 @@ body: This helps to keep all relevant information in one place, including any potential workarounds. Here's a list of useful links that may help you with your issue: + - [Guide on creating issues + FAQ + Commonly Known Issues](https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/CREATING_ISSUES.md) - If you would like to create a GitHub issue, please read our guide first. It contains useful links, FAQ, and commonly known issues with solutions that may already solve your case. - [Migration Guide](https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/MIGRATION_GUIDE.md) - when introducing breaking changes, we note them in the migration guide and describe how to upgrade to the next version. If you recently upgraded the provider version, please check if you applied all the needed changes. - type: markdown diff --git a/.github/ISSUE_TEMPLATE/03-documentation.yml b/.github/ISSUE_TEMPLATE/03-documentation.yml index 2ca1b0b709..e580ad84ed 100644 --- a/.github/ISSUE_TEMPLATE/03-documentation.yml +++ b/.github/ISSUE_TEMPLATE/03-documentation.yml @@ -3,13 +3,13 @@ description: Issues or feature requests for the documentation. title: "[Docs]: " labels: ["docs"] body: - # TODO(SNOW-1003360): Link doc how to submit issues and FAQ - type: markdown attributes: value: | # Thank you for raising a documentation issue! This form is meant to alert the maintainers to an issue with any of documentation connected with the provider, especially in: + - [Guide on creating issues + FAQ + Commonly Known Issues](https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/CREATING_ISSUES.md) - If you would like to create a GitHub issue, please read our guide first. It contains useful links, FAQ, and commonly known issues with solutions that may already solve your case. - [Terraform Registry](https://registry.terraform.io/providers/hashicorp/snowflake/latest) (such as resource and data source documentation, guides and examples). - [Project README](https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/README.md). - [Contribution Guide](https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/CONTRIBUTING.md). diff --git a/.github/ISSUE_TEMPLATE/04-feature-request.yml b/.github/ISSUE_TEMPLATE/04-feature-request.yml index 61ead6bfa1..d236caade7 100644 --- a/.github/ISSUE_TEMPLATE/04-feature-request.yml +++ b/.github/ISSUE_TEMPLATE/04-feature-request.yml @@ -3,7 +3,6 @@ description: Something is missing or could be improved. title: "[Feature]: " labels: ["feature-request"] body: - # TODO(SNOW-1003360): Link doc how to submit issues and FAQ - type: markdown attributes: value: | @@ -17,6 +16,7 @@ body: If you would like to contribute to the project, please let us know and refer to the [contribution guide](https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/CONTRIBUTING.md) for tips on getting started. Here's a list of useful links that may answer your question: + - [Guide on creating issues + FAQ + Commonly Known Issues](https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/CREATING_ISSUES.md) - If you would like to create a GitHub issue, please read our guide first. It contains useful links, FAQ, and commonly known issues with solutions that may already solve your case. - [Provider Roadmap](https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/ROADMAP.md) - id: use-case diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index b5616ef94b..db5c7a00f5 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -8,7 +8,10 @@ contact_links: url: https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/MIGRATION_GUIDE.md about: Migration Guide that presents breaking changes between the versions with actions needed during upgrading. -# TODO(SNOW-1003360): Link FAQ -#- name: Frequently Asked Questions / Common issues with solutions -# url: https://github.com/Snowflake-Labs/terraform-provider-snowflake/ -# about: A list of common provider question and issues with workarounds or solutions for them. + - name: Migrating from deprecated resources + url: https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/docs/technical-documentation/resource_migration.md + about: This guide may help you with migrating your deprecated resources to the newer counter-parts. It also presents different strategies on importing already existing Snowflake infrastructure into Terraform. + + - name: Guide on creating issues + FAQ + Commonly Known Issues + url: https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/CREATING_ISSUES.md + about: If you would like to create a GitHub issue, please read our guide first. It contains useful links, FAQ, and commonly known issues with solutions that may already solve your case. diff --git a/pkg/sdk/privileges.go b/pkg/sdk/privileges.go index 56b7a96752..eb0a3ba97e 100644 --- a/pkg/sdk/privileges.go +++ b/pkg/sdk/privileges.go @@ -17,6 +17,10 @@ const ( GlobalPrivilegeCreateUser GlobalPrivilege = "CREATE USER" GlobalPrivilegeCreateWarehouse GlobalPrivilege = "CREATE WAREHOUSE" + GlobalPrivilegeAttachPolicy GlobalPrivilege = "ATTACH POLICY" + GlobalPrivilegeAudit GlobalPrivilege = "AUDIT" + GlobalPrivilegeBindServiceEndpoint GlobalPrivilege = "BIND SERVICE ENDPOINT" + GlobalPrivilegeApplyAggregationPolicy GlobalPrivilege = "APPLY AGGREGATION POLICY" GlobalPrivilegeApplyAuthenticationPolicy GlobalPrivilege = "APPLY AUTHENTICATION POLICY" GlobalPrivilegeApplyMaskingPolicy GlobalPrivilege = "APPLY MASKING POLICY" @@ -27,18 +31,18 @@ const ( GlobalPrivilegeApplySessionPolicy GlobalPrivilege = "APPLY SESSION POLICY" GlobalPrivilegeApplyTag GlobalPrivilege = "APPLY TAG" - GlobalPrivilegeAttachPolicy GlobalPrivilege = "ATTACH POLICY" - GlobalPrivilegeAudit GlobalPrivilege = "AUDIT" - GlobalPrivilegeBindServiceEndpoint GlobalPrivilege = "BIND SERVICE ENDPOINT" - - GlobalPrivilegeExecuteAlert GlobalPrivilege = "EXECUTE ALERT" - GlobalPrivilegeExecuteTask GlobalPrivilege = "EXECUTE TASK" + GlobalPrivilegeExecuteAlert GlobalPrivilege = "EXECUTE ALERT" + GlobalPrivilegeExecuteDataMetricFunction GlobalPrivilege = "EXECUTE DATA METRIC FUNCTION" + GlobalPrivilegeExecuteTask GlobalPrivilege = "EXECUTE TASK" GlobalPrivilegeImportShare GlobalPrivilege = "IMPORT SHARE" - GlobalPrivilegeManageGrants GlobalPrivilege = "MANAGE GRANTS" - GlobalPrivilegeManageListingAutoFulfillment GlobalPrivilege = "MANAGE LISTING AUTO FULFILLMENT" - GlobalPrivilegeManageWarehouses GlobalPrivilege = "MANAGE WAREHOUSES" + GlobalPrivilegeManageAccountSupportCases GlobalPrivilege = "MANAGE ACCOUNT SUPPORT CASES" + GlobalPrivilegeManageGrants GlobalPrivilege = "MANAGE GRANTS" + GlobalPrivilegeManageListingAutoFulfillment GlobalPrivilege = "MANAGE LISTING AUTO FULFILLMENT" + GlobalPrivilegeManageOrganizationSupportCases GlobalPrivilege = "MANAGE ORGANIZATION SUPPORT CASES" + GlobalPrivilegeManageUserSupportCases GlobalPrivilege = "MANAGE USER SUPPORT CASES" + GlobalPrivilegeManageWarehouses GlobalPrivilege = "MANAGE WAREHOUSES" GlobalPrivilegeModifyLogLevel GlobalPrivilege = "MODIFY LOG LEVEL" GlobalPrivilegeModifyTraceLevel GlobalPrivilege = "MODIFY TRACE LEVEL" @@ -119,14 +123,10 @@ const ( SchemaPrivilegeAddSearchOptimization SchemaPrivilege = "ADD SEARCH OPTIMIZATION" SchemaPrivilegeApplyBudget SchemaPrivilege = "APPLYBUDGET" SchemaPrivilegeCreateAlert SchemaPrivilege = "CREATE ALERT" - SchemaPrivilegeCreateDynamicTable SchemaPrivilege = "CREATE DYNAMIC TABLE" - SchemaPrivilegeCreateExternalTable SchemaPrivilege = "CREATE EXTERNAL TABLE" SchemaPrivilegeCreateFileFormat SchemaPrivilege = "CREATE FILE FORMAT" SchemaPrivilegeCreateFunction SchemaPrivilege = "CREATE FUNCTION" - SchemaPrivilegeCreateHybridTable SchemaPrivilege = "CREATE HYBRID TABLE" + SchemaPrivilegeCreateGitRepository SchemaPrivilege = "CREATE GIT REPOSITORY" SchemaPrivilegeCreateImageRepository SchemaPrivilege = "CREATE IMAGE REPOSITORY" - SchemaPrivilegeCreateIcebergTable SchemaPrivilege = "CREATE ICEBERG TABLE" - SchemaPrivilegeCreateMaterializedView SchemaPrivilege = "CREATE MATERIALIZED VIEW" SchemaPrivilegeCreateModel SchemaPrivilege = "CREATE MODEL" SchemaPrivilegeCreateNetworkRule SchemaPrivilege = "CREATE NETWORK RULE" SchemaPrivilegeCreatePipe SchemaPrivilege = "CREATE PIPE" @@ -139,22 +139,29 @@ const ( SchemaPrivilegeCreateProjectionPolicy SchemaPrivilege = "CREATE PROJECTION POLICY" SchemaPrivilegeCreateRowAccessPolicy SchemaPrivilege = "CREATE ROW ACCESS POLICY" SchemaPrivilegeCreateSessionPolicy SchemaPrivilege = "CREATE SESSION POLICY" - SchemaPrivilegeCreateService SchemaPrivilege = "CREATE SERVICE" SchemaPrivilegeCreateSecret SchemaPrivilege = "CREATE SECRET" SchemaPrivilegeCreateSequence SchemaPrivilege = "CREATE SEQUENCE" + SchemaPrivilegeCreateService SchemaPrivilege = "CREATE SERVICE" + SchemaPrivilegeCreateSnapshot SchemaPrivilege = "CREATE SNAPSHOT" SchemaPrivilegeCreateStage SchemaPrivilege = "CREATE STAGE" SchemaPrivilegeCreateStream SchemaPrivilege = "CREATE STREAM" SchemaPrivilegeCreateStreamlit SchemaPrivilege = "CREATE STREAMLIT" SchemaPrivilegeCreateSnowflakeCoreBudget SchemaPrivilege = "CREATE SNOWFLAKE.CORE.BUDGET" SchemaPrivilegeCreateSnowflakeMlAnomalyDetection SchemaPrivilege = "CREATE SNOWFLAKE.ML.ANOMALY_DETECTION" SchemaPrivilegeCreateSnowflakeMlForecast SchemaPrivilege = "CREATE SNOWFLAKE.ML.FORECAST" - SchemaPrivilegeCreateTag SchemaPrivilege = "CREATE TAG" + SchemaPrivilegeCreateDynamicTable SchemaPrivilege = "CREATE DYNAMIC TABLE" + SchemaPrivilegeCreateExternalTable SchemaPrivilege = "CREATE EXTERNAL TABLE" + SchemaPrivilegeCreateHybridTable SchemaPrivilege = "CREATE HYBRID TABLE" + SchemaPrivilegeCreateIcebergTable SchemaPrivilege = "CREATE ICEBERG TABLE" SchemaPrivilegeCreateTable SchemaPrivilege = "CREATE TABLE" + SchemaPrivilegeCreateTag SchemaPrivilege = "CREATE TAG" SchemaPrivilegeCreateTask SchemaPrivilege = "CREATE TASK" + SchemaPrivilegeCreateMaterializedView SchemaPrivilege = "CREATE MATERIALIZED VIEW" SchemaPrivilegeCreateView SchemaPrivilege = "CREATE VIEW" SchemaPrivilegeModify SchemaPrivilege = "MODIFY" SchemaPrivilegeMonitor SchemaPrivilege = "MONITOR" SchemaPrivilegeUsage SchemaPrivilege = "USAGE" + SchemaPrivilegeCreateNotebook SchemaPrivilege = "CREATE NOTEBOOK" ) func (p SchemaPrivilege) String() string {