Skip to content

Commit

Permalink
Fix grant import commands in templates
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-asawicki committed Nov 8, 2024
1 parent a7abfe9 commit e92cb4f
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 72 deletions.
30 changes: 15 additions & 15 deletions docs/resources/grant_privileges_to_account_role.md
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ Optional:

Import is supported using the following syntax:

`terraform import "<account_role_name>|<with_grant_option>|<always_apply>|<privileges>|<grant_type>|<grant_data>"`
`terraform import snowflake_grant_privileges_to_account_role.example '<account_role_name>|<with_grant_option>|<always_apply>|<privileges>|<grant_type>|<grant_data>'`

where:
- account_role_name - fully qualified identifier
Expand All @@ -359,62 +359,62 @@ where:
It has varying number of parts, depending on grant_type. All the possible types are:

### OnAccount
`terraform import "<account_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnAccount`
`terraform import snowflake_grant_privileges_to_account_role.example '<account_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnAccount'`

### OnAccountObject
`terraform import "<account_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnAccountObject|<object_type>|<object_name>`
`terraform import snowflake_grant_privileges_to_account_role.example '<account_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnAccountObject|<object_type>|<object_name>'`

### OnSchema

On schema contains inner types for all options.

#### OnSchema
`terraform import "<account_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnSchema|OnSchema|<schema_name>"`
`terraform import snowflake_grant_privileges_to_account_role.example '<account_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnSchema|OnSchema|<schema_name>'`

#### OnAllSchemasInDatabase
`terraform import "<account_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnSchema|OnAllSchemasInDatabase|<database_name>"`
`terraform import snowflake_grant_privileges_to_account_role.example '<account_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnSchema|OnAllSchemasInDatabase|<database_name>'`

#### OnFutureSchemasInDatabase
`terraform import "<account_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnSchema|OnFutureSchemasInDatabase|<database_name>"`
`terraform import snowflake_grant_privileges_to_account_role.example '<account_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnSchema|OnFutureSchemasInDatabase|<database_name>'`

### OnSchemaObject

On schema object contains inner types for all options.

#### OnObject
`terraform import "<account_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnSchemaObject|OnObject|<object_type>|<object_name>"`
`terraform import snowflake_grant_privileges_to_account_role.example '<account_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnSchemaObject|OnObject|<object_type>|<object_name>'`

#### OnAll

On all contains inner types for all options.

##### InDatabase
`terraform import "<account_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnSchemaObject|OnAll|<object_type_plural>|InDatabase|<identifier>"`
`terraform import snowflake_grant_privileges_to_account_role.example '<account_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnSchemaObject|OnAll|<object_type_plural>|InDatabase|<identifier>'`

##### InSchema
`terraform import "<account_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnSchemaObject|OnAll|<object_type_plural>|InSchema|<identifier>"`
`terraform import snowflake_grant_privileges_to_account_role.example '<account_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnSchemaObject|OnAll|<object_type_plural>|InSchema|<identifier>'`

#### OnFuture

On future contains inner types for all options.

##### InDatabase
`terraform import "<account_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnSchemaObject|OnFuture|<object_type_plural>|InDatabase|<identifier>"`
`terraform import snowflake_grant_privileges_to_account_role.example '<account_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnSchemaObject|OnFuture|<object_type_plural>|InDatabase|<identifier>'`

##### InSchema
`terraform import "<account_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnSchemaObject|OnFuture|<object_type_plural>|InSchema|<identifier>"`
`terraform import snowflake_grant_privileges_to_account_role.example '<account_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnSchemaObject|OnFuture|<object_type_plural>|InSchema|<identifier>'`

### Import examples

#### Grant all privileges OnAccountObject (Database)
`terraform import "\"test_db_role\"|false|false|ALL|OnAccountObject|DATABASE|\"test_db\""`
`terraform import snowflake_grant_privileges_to_account_role.example '"test_db_role"|false|false|ALL|OnAccountObject|DATABASE|"test_db"'`

#### Grant list of privileges OnAllSchemasInDatabase
`terraform import "\"test_db_role\"|false|false|CREATE TAG,CREATE TABLE|OnSchema|OnAllSchemasInDatabase|\"test_db\""`
`terraform import snowflake_grant_privileges_to_account_role.example '"test_db_role"|false|false|CREATE TAG,CREATE TABLE|OnSchema|OnAllSchemasInDatabase|"test_db"'`

#### Grant list of privileges on table
`terraform import "\"test_db_role\"|false|false|SELECT,DELETE,INSERT|OnSchemaObject|OnObject|TABLE|\"test_db\".\"test_schema\".\"test_table\""`
`terraform import snowflake_grant_privileges_to_account_role.example '"test_db_role"|false|false|SELECT,DELETE,INSERT|OnSchemaObject|OnObject|TABLE|"test_db"."test_schema"."test_table"'`

#### Grant list of privileges OnAll tables in schema
`terraform import "\"test_db_role\"|false|false|SELECT,DELETE,INSERT|OnSchemaObject|OnAll|TABLES|InSchema|\"test_db\".\"test_schema\""`
`terraform import snowflake_grant_privileges_to_account_role.example '"test_db_role"|false|false|SELECT,DELETE,INSERT|OnSchemaObject|OnAll|TABLES|InSchema|"test_db"."test_schema"'`

28 changes: 14 additions & 14 deletions docs/resources/grant_privileges_to_database_role.md
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ Optional:

Import is supported using the following syntax:

`terraform import "<database_role_name>|<with_grant_option>|<always_apply>|<privileges>|<grant_type>|<grant_data>"`
`terraform import snowflake_grant_privileges_to_database_role.example '<database_role_name>|<with_grant_option>|<always_apply>|<privileges>|<grant_type>|<grant_data>'`

where:
- database_role_name - fully qualified identifier
Expand All @@ -264,59 +264,59 @@ where:
It has varying number of parts, depending on grant_type. All the possible types are:

### OnDatabase
`terraform import "<database_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnDatabase|<database_name>"`
`terraform import snowflake_grant_privileges_to_database_role.example '<database_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnDatabase|<database_name>'`

### OnSchema

On schema contains inner types for all options.

#### OnSchema
`terraform import "<database_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnSchema|OnSchema|<schema_name>"`
`terraform import snowflake_grant_privileges_to_database_role.example '<database_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnSchema|OnSchema|<schema_name>'`

#### OnAllSchemasInDatabase
`terraform import "<database_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnSchema|OnAllSchemasInDatabase|<database_name>"`
`terraform import snowflake_grant_privileges_to_database_role.example '<database_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnSchema|OnAllSchemasInDatabase|<database_name>'`

#### OnFutureSchemasInDatabase
`terraform import "<database_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnSchema|OnFutureSchemasInDatabase|<database_name>"`
`terraform import snowflake_grant_privileges_to_database_role.example '<database_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnSchema|OnFutureSchemasInDatabase|<database_name>'`

### OnSchemaObject

On schema object contains inner types for all options.

#### OnObject
`terraform import "<database_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnSchemaObject|OnObject|<object_type>|<object_name>"`
`terraform import snowflake_grant_privileges_to_database_role.example '<database_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnSchemaObject|OnObject|<object_type>|<object_name>'`

#### OnAll

On all contains inner types for all options.

##### InDatabase
`terraform import "<database_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnSchemaObject|OnAll|<object_type_plural>|InDatabase|<identifier>"`
`terraform import snowflake_grant_privileges_to_database_role.example '<database_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnSchemaObject|OnAll|<object_type_plural>|InDatabase|<identifier>'`

##### InSchema
`terraform import "<database_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnSchemaObject|OnAll|<object_type_plural>|InSchema|<identifier>"`
`terraform import snowflake_grant_privileges_to_database_role.example '<database_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnSchemaObject|OnAll|<object_type_plural>|InSchema|<identifier>'`

#### OnFuture

On future contains inner types for all options.

##### InDatabase
`terraform import "<database_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnSchemaObject|OnFuture|<object_type_plural>|InDatabase|<identifier>"`
`terraform import snowflake_grant_privileges_to_database_role.example '<database_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnSchemaObject|OnFuture|<object_type_plural>|InDatabase|<identifier>'`

##### InSchema
`terraform import "<database_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnSchemaObject|OnFuture|<object_type_plural>|InSchema|<identifier>"`
`terraform import snowflake_grant_privileges_to_database_role.example '<database_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnSchemaObject|OnFuture|<object_type_plural>|InSchema|<identifier>'`

### Import examples

#### Grant all privileges OnDatabase
`terraform import "\"test_db\".\"test_db_role\"|false|false|ALL|OnDatabase|\"test_db\""`
`terraform import snowflake_grant_privileges_to_database_role.example '"test_db"."test_db_role"|false|false|ALL|OnDatabase|"test_db"'`

#### Grant list of privileges OnAllSchemasInDatabase
`terraform import "\"test_db\".\"test_db_role\"|false|false|CREATE TAG,CREATE TABLE|OnSchema|OnAllSchemasInDatabase|\"test_db\""`
`terraform import snowflake_grant_privileges_to_database_role.example '"test_db"."test_db_role"|false|false|CREATE TAG,CREATE TABLE|OnSchema|OnAllSchemasInDatabase|"test_db"'`

#### Grant list of privileges on table
`terraform import "\"test_db\".\"test_db_role\"|false|false|SELECT,DELETE,INSERT|OnSchemaObject|OnObject|TABLE|\"test_db\".\"test_schema\".\"test_table\""`
`terraform import snowflake_grant_privileges_to_database_role.example '"test_db"."test_db_role"|false|false|SELECT,DELETE,INSERT|OnSchemaObject|OnObject|TABLE|"test_db"."test_schema"."test_table"'`

#### Grant list of privileges OnAll tables in schema
`terraform import "\"test_db\".\"test_db_role\"|false|false|SELECT,DELETE,INSERT|OnSchemaObject|OnAll|TABLES|InSchema|\"test_db\".\"test_schema\""`
`terraform import snowflake_grant_privileges_to_database_role.example '"test_db"."test_db_role"|false|false|SELECT,DELETE,INSERT|OnSchemaObject|OnAll|TABLES|InSchema|"test_db"."test_schema"'`

14 changes: 7 additions & 7 deletions docs/resources/grant_privileges_to_share.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ resource "snowflake_grant_privileges_to_share" "example" {

Import is supported using the following syntax:

`terraform import "<share_name>|<privileges>|<grant_type>|<grant_identifier>"`
`terraform import snowflake_grant_privileges_to_share.example '<share_name>|<privileges>|<grant_type>|<grant_identifier>'`

where:
- share_name - fully qualified identifier
Expand All @@ -140,19 +140,19 @@ where:
- grant_identifier - fully qualified identifier

### OnDatabase
`terraform import "<share_name>|<privileges>|OnDatabase|<database_name>"`
`terraform import snowflake_grant_privileges_to_share.example '<share_name>|<privileges>|OnDatabase|<database_name>'`

### OnSchema
`terraform import "<share_name>|<privileges>|OnSchema|<database_name>.<schema_name>"`
`terraform import snowflake_grant_privileges_to_share.example '<share_name>|<privileges>|OnSchema|<database_name>.<schema_name>'`

### OnTable
`terraform import "<share_name>|<privileges>|OnTable|<database_name>.<schema_name>.<table_name>"`
`terraform import snowflake_grant_privileges_to_share.example '<share_name>|<privileges>|OnTable|<database_name>.<schema_name>.<table_name>'`

### OnSchema
`terraform import "<share_name>|<privileges>|OnAllTablesInSchema|<database_name>.<schema_name>"`
`terraform import snowflake_grant_privileges_to_share.example '<share_name>|<privileges>|OnAllTablesInSchema|<database_name>.<schema_name>'`

### OnTag
`terraform import "<share_name>|<privileges>|OnTag|<database_name>.<schema_name>.<tag_name>"`
`terraform import snowflake_grant_privileges_to_share.example '<share_name>|<privileges>|OnTag|<database_name>.<schema_name>.<tag_name>'`

### OnView
`terraform import "<share_name>|<privileges>|OnView|<database_name>.<schema_name>.<view_name>"`
`terraform import snowflake_grant_privileges_to_share.example '<share_name>|<privileges>|OnView|<database_name>.<schema_name>.<view_name>'`
30 changes: 15 additions & 15 deletions templates/resources/grant_privileges_to_account_role.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ description: |-

Import is supported using the following syntax:

`terraform import "<account_role_name>|<with_grant_option>|<always_apply>|<privileges>|<grant_type>|<grant_data>"`
`terraform import snowflake_grant_privileges_to_account_role.example '<account_role_name>|<with_grant_option>|<always_apply>|<privileges>|<grant_type>|<grant_data>'`

where:
- account_role_name - fully qualified identifier
Expand All @@ -55,62 +55,62 @@ where:
It has varying number of parts, depending on grant_type. All the possible types are:

### OnAccount
`terraform import "<account_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnAccount`
`terraform import snowflake_grant_privileges_to_account_role.example '<account_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnAccount'`

### OnAccountObject
`terraform import "<account_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnAccountObject|<object_type>|<object_name>`
`terraform import snowflake_grant_privileges_to_account_role.example '<account_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnAccountObject|<object_type>|<object_name>'`

### OnSchema

On schema contains inner types for all options.

#### OnSchema
`terraform import "<account_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnSchema|OnSchema|<schema_name>"`
`terraform import snowflake_grant_privileges_to_account_role.example '<account_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnSchema|OnSchema|<schema_name>'`

#### OnAllSchemasInDatabase
`terraform import "<account_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnSchema|OnAllSchemasInDatabase|<database_name>"`
`terraform import snowflake_grant_privileges_to_account_role.example '<account_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnSchema|OnAllSchemasInDatabase|<database_name>'`

#### OnFutureSchemasInDatabase
`terraform import "<account_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnSchema|OnFutureSchemasInDatabase|<database_name>"`
`terraform import snowflake_grant_privileges_to_account_role.example '<account_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnSchema|OnFutureSchemasInDatabase|<database_name>'`

### OnSchemaObject

On schema object contains inner types for all options.

#### OnObject
`terraform import "<account_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnSchemaObject|OnObject|<object_type>|<object_name>"`
`terraform import snowflake_grant_privileges_to_account_role.example '<account_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnSchemaObject|OnObject|<object_type>|<object_name>'`

#### OnAll

On all contains inner types for all options.

##### InDatabase
`terraform import "<account_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnSchemaObject|OnAll|<object_type_plural>|InDatabase|<identifier>"`
`terraform import snowflake_grant_privileges_to_account_role.example '<account_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnSchemaObject|OnAll|<object_type_plural>|InDatabase|<identifier>'`

##### InSchema
`terraform import "<account_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnSchemaObject|OnAll|<object_type_plural>|InSchema|<identifier>"`
`terraform import snowflake_grant_privileges_to_account_role.example '<account_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnSchemaObject|OnAll|<object_type_plural>|InSchema|<identifier>'`

#### OnFuture

On future contains inner types for all options.

##### InDatabase
`terraform import "<account_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnSchemaObject|OnFuture|<object_type_plural>|InDatabase|<identifier>"`
`terraform import snowflake_grant_privileges_to_account_role.example '<account_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnSchemaObject|OnFuture|<object_type_plural>|InDatabase|<identifier>'`

##### InSchema
`terraform import "<account_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnSchemaObject|OnFuture|<object_type_plural>|InSchema|<identifier>"`
`terraform import snowflake_grant_privileges_to_account_role.example '<account_role_name>|<with_grant_option>|<always_apply>|<privileges>|OnSchemaObject|OnFuture|<object_type_plural>|InSchema|<identifier>'`

### Import examples

#### Grant all privileges OnAccountObject (Database)
`terraform import "\"test_db_role\"|false|false|ALL|OnAccountObject|DATABASE|\"test_db\""`
`terraform import snowflake_grant_privileges_to_account_role.example '"test_db_role"|false|false|ALL|OnAccountObject|DATABASE|"test_db"'`

#### Grant list of privileges OnAllSchemasInDatabase
`terraform import "\"test_db_role\"|false|false|CREATE TAG,CREATE TABLE|OnSchema|OnAllSchemasInDatabase|\"test_db\""`
`terraform import snowflake_grant_privileges_to_account_role.example '"test_db_role"|false|false|CREATE TAG,CREATE TABLE|OnSchema|OnAllSchemasInDatabase|"test_db"'`

#### Grant list of privileges on table
`terraform import "\"test_db_role\"|false|false|SELECT,DELETE,INSERT|OnSchemaObject|OnObject|TABLE|\"test_db\".\"test_schema\".\"test_table\""`
`terraform import snowflake_grant_privileges_to_account_role.example '"test_db_role"|false|false|SELECT,DELETE,INSERT|OnSchemaObject|OnObject|TABLE|"test_db"."test_schema"."test_table"'`

#### Grant list of privileges OnAll tables in schema
`terraform import "\"test_db_role\"|false|false|SELECT,DELETE,INSERT|OnSchemaObject|OnAll|TABLES|InSchema|\"test_db\".\"test_schema\""`
`terraform import snowflake_grant_privileges_to_account_role.example '"test_db_role"|false|false|SELECT,DELETE,INSERT|OnSchemaObject|OnAll|TABLES|InSchema|"test_db"."test_schema"'`

Loading

0 comments on commit e92cb4f

Please sign in to comment.