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

Error try to create resource using terraform #499

Open
lanania opened this issue Apr 9, 2024 · 6 comments
Open

Error try to create resource using terraform #499

lanania opened this issue Apr 9, 2024 · 6 comments

Comments

@lanania
Copy link

lanania commented Apr 9, 2024

Hi
I was trying to create a resource using via terraform just copying from documentation at here :

  • main.tf
resource "sysdig_monitor_alert_event" "sample" {
  name        = "[Kubernetes] Failed to pull image"
  description = "A Kubernetes pod failed to pull an image from the registry"
  severity    = 4

  event_name  = "Failed to pull image"
  source      = "kubernetes"
  event_rel   = ">"
  event_count = 0

  multiple_alerts_by = ["kubernetes.pod.name"]

  trigger_after_minutes = 1
}
  • versions.tf
terraform {
  required_providers {
    sysdig = {
      source = "sysdiglabs/sysdig"
      # version = ">= 0.4.0"
      version = "1.23.4"
    }
  }
}

I received this error:

Empty Summary: This is always a bug in the provider and should be reported to the provider developers

@dbonf
Copy link
Collaborator

dbonf commented May 9, 2024

hi, can you please provide debug logs outputted with something like TF_LOG=debug terraform apply (redacting sensible information first)?

@dbonf
Copy link
Collaborator

dbonf commented May 9, 2024

it could be you had authorisation problems, in such cases you would get that error message, this was a bug we fixed reporting the proper error message in the latest release with this PR, please try again with v1.24.5 and report the full debug log if you still have issues, thanks.

@lanania
Copy link
Author

lanania commented May 9, 2024

I was on vacation this morning. Anyway I resolved that problem after a few days.
I used

terraform {
  required_providers {
    ibm = {
      source  = "IBM-Cloud/ibm"
      version = ">= 1.59.0"
    }
    sysdig = {
      source  = "sysdiglabs/sysdig"
      version = ">=0.5"
    }
  }
}

and obviously my custom resource declaration.

thank you. I think that this issue can be closed.

@lanania
Copy link
Author

lanania commented May 9, 2024

But a question what is the syntax to add a link for dashboard and runbook links? I tried with something like

link = [
{ type = "runbook",
href = "https//cloud.ibm.com"
}
]

but it does not work.

@lanania
Copy link
Author

lanania commented May 10, 2024

I read this in the documentation
image

image there's no example then I tried to interpret according to my knowledge by imagining an array of objects.

@dbonf
Copy link
Collaborator

dbonf commented Jun 5, 2024

hi, here a working example of alert event with multiple links:

resource "sysdig_monitor_alert_v2_event" "sample" {

  name = "[Kubernetes] Failed to pull image"
  description = "A Kubernetes pod failed to pull an image from the registry"
  severity = "high"
  filter = "Failed to pull image"
  sources = ["kubernetes"]
  operator = ">"
  threshold = 0
  group_by = ["kube_pod_name"]

  scope {
    label = "kube_cluster_name"
    operator = "in"
    values = ["my_cluster_1", "my_cluster_2"]
  }

  scope {
    label = "kube_deployment_name"
    operator = "equals"
    values = ["my_deployment"]
  }

  trigger_after_minutes = 1

  link {
    type = "dashboard"
    id   = "6010784"
  }

  link {
    type = "runbook"
    href = "https://www.google.com/"
  }


}

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

2 participants