-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
azurerm_sentinel_watchlist
- Add required property item_search_key
#15861
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,7 @@ type WatchlistModel struct { | |
Description string `tfschema:"description"` | ||
Labels []string `tfschema:"labels"` | ||
DefaultDuration string `tfschema:"default_duration"` | ||
ItemSearchKey string `tfschema:"item_search_key"` | ||
} | ||
|
||
func (r WatchlistResource) Arguments() map[string]*pluginsdk.Schema { | ||
|
@@ -50,6 +51,12 @@ func (r WatchlistResource) Arguments() map[string]*pluginsdk.Schema { | |
ForceNew: true, | ||
ValidateFunc: validation.StringIsNotEmpty, | ||
}, | ||
"item_search_key": { | ||
Type: pluginsdk.TypeString, | ||
Required: true, | ||
ForceNew: true, | ||
ValidateFunc: validation.StringIsNotEmpty, | ||
}, | ||
"description": { | ||
Type: pluginsdk.TypeString, | ||
Optional: true, | ||
|
@@ -124,10 +131,11 @@ func (r WatchlistResource) Create() sdk.ResourceFunc { | |
// The only supported provider for now is "Microsoft" | ||
Provider: utils.String("Microsoft"), | ||
|
||
// The "source" and "contentType" represent the source file name which contains the watchlist items and its content type. | ||
// The "source" represent the source file name which contains the watchlist items. | ||
// Setting them here is merely to make the API happy. | ||
Source: securityinsight.Source("a.csv"), | ||
ContentType: utils.String("Text/Csv"), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. how come we are removing this? should it not be in schema with a default? |
||
Source: securityinsight.Source("a.csv"), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the possible values from the SDK here are: // Source enumerates the values for source.
type Source string
const (
// SourceLocalfile ...
SourceLocalfile Source = "Local file"
// SourceRemotestorage ...
SourceRemotestorage Source = "Remote storage"
)
// PossibleSourceValues returns an array of possible values for the Source const type.
func PossibleSourceValues() []Source {
return []Source{SourceLocalfile, SourceRemotestorage}
} why is this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "a.csv" is not a valid value for securityinsight.Source? at that should we not expose this in schema with a default? |
||
|
||
ItemsSearchKey: utils.String(model.ItemSearchKey), | ||
}, | ||
} | ||
|
||
|
@@ -189,6 +197,9 @@ func (r WatchlistResource) Read() sdk.ResourceFunc { | |
if props.DefaultDuration != nil { | ||
model.DefaultDuration = *props.DefaultDuration | ||
} | ||
if props.ItemsSearchKey != nil { | ||
model.ItemSearchKey = *props.ItemsSearchKey | ||
} | ||
} | ||
|
||
return metadata.Encode(&model) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a breaking change, we should be exposing a field for this with a default value here?