Skip to content

Commit ae1cfe4

Browse files
authored
Merge pull request #64 from tivrobo/aivashyna/add-skipvalidation-parameter
Add skip_validation parameter to adx_function resource
2 parents ed2bd28 + a1ab4ea commit ae1cfe4

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## v0.0.32
2+
3+
* Fixed #45. Add `skip_validation` parameter to `adx_function` resource
4+
15
## v0.0.31
26

37
* Bugfix: add `adx_table_ingestion_time_policy` to provider init

adx/resource_adx_function.go

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"fmt"
66
"regexp"
77
"strings"
8+
"strconv"
89

910
"github.com/Azure/azure-kusto-go/kusto"
1011
"github.com/Azure/azure-kusto-go/kusto/unsafe"
@@ -16,11 +17,12 @@ import (
1617
)
1718

1819
type ADXFunction struct {
19-
Name string
20-
Parameters string
21-
Body string
22-
Folder string
23-
DocString string
20+
Name string
21+
Parameters string
22+
Body string
23+
Folder string
24+
DocString string
25+
SkipValidation bool
2426
}
2527

2628
func resourceADXFunction() *schema.Resource {
@@ -76,6 +78,11 @@ func resourceADXFunction() *schema.Resource {
7678
Type: schema.TypeString,
7779
Optional: true,
7880
},
81+
82+
"skip_validation": {
83+
Type: schema.TypeBool,
84+
Optional: true,
85+
},
7986
},
8087
CustomizeDiff: clusterConfigCustomDiff,
8188
}
@@ -108,6 +115,9 @@ func resourceADXFunctionCreateUpdate(ctx context.Context, d *schema.ResourceData
108115
if folder, ok := d.GetOk("folder"); ok {
109116
withParams = append(withParams, fmt.Sprintf("folder='%s'", folder))
110117
}
118+
if skip_validation, ok := d.Get("skip_validation").(bool); ok {
119+
withParams = append(withParams, fmt.Sprintf("skipvalidation=%s", strconv.FormatBool(skip_validation)))
120+
}
111121

112122
withClause := ""
113123
if len(withParams) > 0 {

docs/resources/adx_function.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ resource "adx_function" "test" {
3030
- **parameters** (String, Optional) Function parameters enclosed in parenthesis (myLimit:long)
3131
- **folder** (String, Optional) Name of the folder in which to place this entity
3232
- **docstring** (String, Optional) Free text describing the entity to be added. This string is presented in various UX settings next to the entity names.
33+
- **skip_validation** (Bool, Optional) Determines whether or not to run validation logic on the function and fail the process if the function isn't valid. The default is `false`. *Note*: If a function involves cross-cluster queries and you plan to recreate the function using a [Kusto Query Language script](https://learn.microsoft.com/en-us/azure/data-explorer/database-script), set `skip_validation` to `true`.
3334
- **cluster** (Optional) `cluster` Configuration block (defined below) for the target cluster (overrides any config specified in the provider)
3435

3536
`cluster` Configuration block for connection details about the target ADX cluster

0 commit comments

Comments
 (0)