-
Notifications
You must be signed in to change notification settings - Fork 14
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
feat: new lacework_query resource #266
Conversation
Signed-off-by: Darren Murray <darren.murray@lacework.net>
Signed-off-by: Darren Murray <darren.murray@lacework.net>
Signed-off-by: Darren Murray <darren.murray@lacework.net>
Signed-off-by: Darren Murray <darren.murray@lacework.net>
resource "lacework_query" "example" { | ||
query_id = var.query_id | ||
evaluator_id = "Cloudtrail" | ||
query = var.query |
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.
nit. should we call this query_text to be consistent with Lacework APIs and SDK structs?
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.
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.
Approved w/ comments.
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.
Unfortunately, when we do not specify an evaluator ID, the platform returns the string "<<IMPLICIT>>"
which causes a constant drift.
How do we address this @dmurray-lacework @hazedav ?
We could set a default value of "<//<IMPLCIT//>>" in the schema. I'll take a look at this today |
Signed-off-by: Darren Murray <darren.murray@lacework.net>
Signed-off-by: Darren Murray <darren.murray@lacework.net>
Signed-off-by: Darren Murray <darren.murray@lacework.net>
Signed-off-by: Darren Murray <darren.murray@lacework.net>
Signed-off-by: Darren Murray <darren.murray@lacework.net>
Signed-off-by: Darren Murray <darren.murray@lacework.net>
lacework = meta.(*api.Client) | ||
) | ||
|
||
if d.HasChange("query_id") { |
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 we do this during validation? why? because then the user can run plan
or a partial apply and fail.
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.
I can't find a way to check the diff between old and new on validation.
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.
Optional: true, | ||
Description: "The query evaluator id", | ||
DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool { | ||
return old == "<<IMPLICIT>>" || new == "<<IMPLICIT>>" |
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.
I'm not sure that after this we could change the evaluator ID but I also think those are edge cases where the user wants to repurpose a query, so let us ignore this for now. 😅
Signed-off-by: Darren Murray <darren.murray@lacework.net>
Issue: https://lacework.atlassian.net/browse/ALLY-870
Description:
Add new resource
lacework_query
Usage: