Difference between revisions of "Import opsgenie"

From wikieduonline
Jump to navigation Jump to search
 
(2 intermediate revisions by the same user not shown)
Line 4: Line 4:
 
  [[opsgenie.send_recovery]]
 
  [[opsgenie.send_recovery]]
  
=== Install the Opsgenie Provider in Terraform ===
 
terraform {
 
  required_providers {
 
    opsgenie = {
 
      source = "opsgenie/opsgenie"
 
      version = "0.5.0"  # or the latest version
 
    }
 
  }
 
}
 
 
provider "opsgenie" {
 
  api_key = var.opsgenie_api_key  # Replace with your API key or use a secret variable
 
}
 
  
 
+
== Activities ==
 
+
* [[Create a maintenance window in Opsgenie]]
=== Create alert ===
+
* [[Suppress alerts for HealthChecks during releases]]
resource "opsgenie_alert" "terraform_alert" {
 
  message    = "Terraform Alert: Plan Execution Failure"
 
  alias      = "terraform-plan-failure"
 
  description = "Terraform plan execution failed for the dev environment."
 
  teams      = [opsgenie_team.example_team.name] # Specify your team
 
  priority    = "P1"
 
 
 
  tags = [
 
    "terraform",
 
    "failure"
 
  ]
 
 
  details = {
 
    region  = "us-east-1"
 
    severity = "high"
 
  }
 
}
 
  
 
== Related ==
 
== Related ==

Latest revision as of 11:53, 1 October 2024

Advertising: