diff --git a/docs/resources/query.md b/docs/resources/query.md index cc8bc90ed..351fe3471 100644 --- a/docs/resources/query.md +++ b/docs/resources/query.md @@ -34,7 +34,7 @@ The following arguments are available: * `catalog` - (Optional, String) Name of the catalog where this query will be executed. * `schema` - (Optional, String) Name of the schema where this query will be executed. * `description` - (Optional, String) General description that conveys additional information about this query such as usage notes. -* `run_as_mode` - (Optional, String) Sets the "Run as" role for the object. +* `run_as_mode` - (Optional, String) Sets the "Run as" role for the object. Should be one of `OWNER`, `VIEWER`. * `tags` - (Optional, List of strings) Tags that will be added to the query. * `parameter` - (Optional, Block) Query parameter definition. Consists of following attributes (one of `*_value` is required): * `name` - (Required, String) Literal parameter marker that appears between double curly braces in the query text. diff --git a/sql/resource_query.go b/sql/resource_query.go index 120353c17..bccd7a053 100644 --- a/sql/resource_query.go +++ b/sql/resource_query.go @@ -32,9 +32,7 @@ func (QueryStruct) CustomizeSchema(m *common.CustomizableSchema) *common.Customi m.SchemaPath("warehouse_id").SetRequired().SetValidateFunc(validation.StringIsNotWhiteSpace) m.SchemaPath("parent_path").SetCustomSuppressDiff(common.WorkspaceOrEmptyPathPrefixDiffSuppress).SetForceNew() m.SchemaPath("owner_user_name").SetSuppressDiff() - m.SchemaPath("run_as_mode").SetSuppressDiff() - //m.SchemaPath("").SetSuppressDiff() - //m.SchemaPath("").SetSuppressDiff() + m.SchemaPath("run_as_mode").SetSuppressDiff().SetValidateFunc(validation.StringInSlice([]string{"VIEWER", "OWNER"}, false)) m.SchemaPath("id").SetReadOnly() m.SchemaPath("create_time").SetReadOnly() m.SchemaPath("lifecycle_state").SetReadOnly()