-
Notifications
You must be signed in to change notification settings - Fork 7
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
Fix scope_filter
planning
#174
Fix scope_filter
planning
#174
Conversation
RequiresReplace
for framework item relationships.RequiresReplace
for framework item relationships and fix scope_filter
planing
6f288a9
to
62f3a34
Compare
RequiresReplace
for framework item relationships and fix scope_filter
planingRequiresReplace
for framework item relationships and fix scope_filter
planning
Moving this to draft to try to split into smaller chunks. |
bd51ed7
to
aa7cf0f
Compare
@zemberdotnet This has been rebased and is ready for review. |
I think we should check this doesn't have any interaction with the record history feature of questions. It would be unfortunate to make a change that ended up losing the evaluation history of the question. What problems did you experience switching between the two? |
The reported error is:
This is the test terraform to cause it. Either start with question_id and change to query or start with queries and change to question_id to trigger the error: resource "jupiterone_question" "test" {
title = "test-asaba"
description = "test-referenced-rule"
query {
name = "query0"
query = "Find DataStore with classification=('critical' or 'sensitive' or 'confidential' or 'restricted') and encrypted!=true"
version = "v1"
}
}
resource "jupiterone_rule" "test" {
name = "test-asaba"
description = "test"
polling_interval = "ONE_DAY"
#question_id = jupiterone_question.test.id
question {
queries {
name = "query0"
query = "Find DataStore with classification=('critical' or 'sensitive' or 'confidential' or 'restricted') and encrypted!=true"
version = "v1"
}
}
tags = ["exampletag"]
outputs = [
"queries.query0.total",
"alertLevel"
]
operations = [
{
when = jsonencode({
"type" : "FILTER",
"specVersion" : 1,
"condition" : [
"AND",
[
"queries.query0.total",
"<",
1000
]
]
}),
actions = [
jsonencode({
"targetValue" : "INFO",
"type" : "SET_PROPERTY",
"targetProperty" : "alertLevel"
}),
jsonencode({
"type" : "CREATE_ALERT"
}),
]
}
]
} |
…amework-for-defaults
RequiresReplace
for framework item relationships and fix scope_filter
planningscope_filter
planning
This PR:
RequireReplace
for framework item relations to help with deletion. This doesn't guarantee that framework items will be deleted first, but helps with the common use cases where they directly referenceresource_framework
s in the same workspace.Switching back and forth betweenReferenced
andInline
questions is resulting in some inconsistent behavior, so added a check and settingRequiresReplace
to be more predictable.scope_filters
Computed
as the most straightforward way to allow it being unset (nil
) to not generate changes when the response from the server (b/c of how graphql works) is an empty list ([]
).