Skip to content
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

Rule can't be created using question_id #137

Open
asaba-hashi opened this issue Jan 24, 2023 · 0 comments
Open

Rule can't be created using question_id #137

asaba-hashi opened this issue Jan 24, 2023 · 0 comments

Comments

@asaba-hashi
Copy link
Contributor

Hi there,

Thank you for opening an issue. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html.

Terraform Version

Terraform v1.3.7
on darwin_arm64
+ provider registry.terraform.io/jupiterone/jupiterone v0.5.0

Affected Resource(s)

Please list the resources as a list, for example:

  • jupiterone_rule

Terraform Configuration Files

resource "jupiterone_question" "test_1" {
  title       = "TEST: Testing j1 terraform provider"
  description = "Test query for terraform provider can be deleted at any a time"

  tags = ["test-tag-1", "test-compliance-tag"]

  query {
    name    = "query0"
    version = "v1"
    query   = "find aws_account as a return count(a)"
  }

}

resource "jupiterone_rule" "test_1" {
  name        = "TEST: Testing j1 terraform provider rule"
  description = "Test rule for terraform provider can be deleted at any a time"

  tags = ["test-tag-1", "test-compliance-tag"]

  question_id = jupiterone_question.test_1.id

  operations = <<EOF
    [
      {
        "when": {
          "type": "FILTER",
          "specVersion": 1,
          "condition": [
            "AND",
            [
              "queries.query0.total",
              "<",
              1000
            ]
          ]
        },
        "actions": [
          {
            "targetValue": "INFO",
            "type": "SET_PROPERTY",
            "targetProperty": "alertLevel"
          },
          {
            "type": "CREATE_ALERT"
          }
        ]
      }
    ]
  EOF
}

Debug Output

Please provider a link to a GitHub Gist containing the complete debug output: https://www.terraform.io/docs/internals/debugging.html. Please do NOT paste the debug output in the issue; just paste a link to the Gist.

Expected Behavior

What should have happened?

The resource_rule should have been created.

Actual Behavior

What actually happened?

jupiterone_rule.test_1: Creating...
╷
│ Error: failed to create question rule instance: graphql: Error creating rule instance
│ 
│   with jupiterone_rule.test_1,
│   on main.tf line 16, in resource "jupiterone_rule" "test_1":
│   16: resource "jupiterone_rule" "test_1" {
│ 

question_id does not appear to be a documented part of the alert schema.

Steps to Reproduce

  1. terraform apply

Important Factoids

Are there anything atypical about your accounts that we should know? For example: Running in EC2 Classic? Custom version of OpenStack? Tight ACLs?

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant