-
Notifications
You must be signed in to change notification settings - Fork 18
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
New Resource: wiz_report_graph_query #184
Conversation
I'm not entirely sure how to address this failure, but I think it could be that I don't have access to the required token. |
Hey @cvirtucio 👋 Thanks for the contribution, I'll make some time hopefully this week or weekend to go through the PR. Regarding the CI failure, it was a recently introduced check and suspect it is indeed a security measure. Its not blocking but it should be fixed. I'll go through it in some more detail, in the meantime:
Looking good overall, been meaning to get to the open PRs will try get through them most likely over the weekend. |
Hi, thanks for giving it a look @jschoombee.
I originally had them all in
Added example and docs: 5927b92
Added test: dacd275. Do I have to run these tests on our own Wiz environment? |
thanks, please reference one of the merged PRs, you generally set env vars |
Done:
We can't run all of them because we don't have some of the integrations, like |
runIntervalHours, hasOk := d.GetOk("run_interval_hours") | ||
if hasOk { | ||
runIntervalHoursVal, _ := runIntervalHours.(int) | ||
vars.RunIntervalHours = &runIntervalHoursVal | ||
|
||
runStartsAt, hasOk := d.GetOk("run_starts_at") | ||
if !hasOk { | ||
return append(diags, diag.FromErr(fmt.Errorf("both run_interval_hours ad run_starts_at must be set to enable scheduling"))...) | ||
} | ||
|
||
runStartsAtVal, _ := runStartsAt.(string) | ||
dt, err := time.Parse(reportRunStartsAtLayout, runStartsAtVal) | ||
if err != nil { | ||
return append(diags, diag.FromErr(fmt.Errorf("run_starts_at %s does not match layout %s", runStartsAtVal, reportRunStartsAtLayout))...) | ||
} | ||
|
||
vars.RunStartsAt = &dt | ||
} |
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.
Can this be refactored into another func as the logic is repeated in update context?
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.
fixed: 38f2edc
|
||
func resourceWizReportGraphQuery() *schema.Resource { | ||
return &schema.Resource{ | ||
Description: "TBD.", |
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.
Just spotted this TBD value, If you could please update then we can get this PR merged.
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.
fixed: ec26333
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.
please run go generate ./...
to update the docs and push the committed changes
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.
done: f3c5f9e
Signed-off-by: JP Schoombee <[email protected]>
* New Resource: wiz_report_graph_query --------- Signed-off-by: Christopher Virtucio <[email protected]> Signed-off-by: JP Schoombee <[email protected]> Co-authored-by: JP Schoombee <[email protected]>
This PR adds a new
resource
for theReport
object of typeGRAPH_QUERY
.closes #185