Skip to content

Commit

Permalink
feat: Add timeouts block to cortex (#3004)
Browse files Browse the repository at this point in the history
These services can take well over 30 minutes to create and sometimes
many hours. Add a timeout block so consumers can extend the default 30
minute timeout.

Patterned after the timeouts block on the existing `tag_association`
object.

PTAL @sfc-gh-asawicki @sfc-gh-mloring
  • Loading branch information
chris-codaio authored Aug 21, 2024
1 parent 5053f8b commit 34d764b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/resources/cortex_search_service.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,22 @@ resource "snowflake_cortex_search_service" "test" {

- `attributes` (Set of String) Specifies the list of columns in the base table to enable filtering on when issuing queries to the service.
- `comment` (String) Specifies a comment for the Cortex search service.
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `created_on` (String) Creation date for the given Cortex search service.
- `fully_qualified_name` (String) Fully qualified name of the resource. For more information, see [object name resolution](https://docs.snowflake.com/en/sql-reference/name-resolution).
- `id` (String) The ID of this resource.

<a id="nestedblock--timeouts"></a>
### Nested Schema for `timeouts`

Optional:

- `create` (String)
- `update` (String)

## Import

Import is supported using the following syntax:
Expand Down
5 changes: 5 additions & 0 deletions pkg/resources/cortex_search_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"errors"
"fmt"
"log"
"time"

"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/helpers"
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/internal/provider"
Expand Down Expand Up @@ -89,6 +90,10 @@ func CortexSearchService() *schema.Resource {
Importer: &schema.ResourceImporter{
StateContext: schema.ImportStatePassthroughContext,
},
Timeouts: &schema.ResourceTimeout{
Create: schema.DefaultTimeout(60 * time.Minute),
Update: schema.DefaultTimeout(60 * time.Minute),
},
}
}

Expand Down

0 comments on commit 34d764b

Please sign in to comment.