Open DanielWeintraub opened 1 year ago
Without the config block, terrafrom apply updates existing service in-place adding the config block every time applied
resource "pagerduty_service" "this" {
...
# Enable Event Intelligence
alert_grouping_parameters {
type = "intelligent"
}
}
$ terraform apply
...
# pagerduty_service.this will be updated in-place
~ resource "pagerduty_service" "this" {
id = "XXXXXX"
name = "ServiceDaemon"
# (11 unchanged attributes hidden)
~ alert_grouping_parameters {
# (1 unchanged attribute hidden)
- config {
- fields = [] -> null
- timeout = 0 -> null
}
}
# (1 unchanged block hidden)
}
Terraform Version: 1.2.3 pagerduty Version: 2.5.2
More Details - When attempting to change the description, updated in-place, using an empty config block fails.
% terraform -version
Terraform v1.2.3
on darwin_amd64
# module.pagerduty_resource["XXXi"].pagerduty_service.this will be updated in-place
~ resource "pagerduty_service" "this" {
~ description = <<-EOT
...
- criticality: 0
+ criticality: 2
- resiliency : 0
+ resiliency : 5
...
Managed by Terraform
EOT
id = "XXXX"
name = "xxxxxxx"
# (11 unchanged attributes hidden)
# (2 unchanged blocks hidden)
}
│ Error: PUT API call to https://api.pagerduty.com/services/XXXXXX failed 400 Bad Request. Code: 2001, Errors: [Config is invalid.], Message: Invalid Input Provided
TF snippet:
terraform {
required_version = ">= 1.2.3"
required_providers {
pagerduty = {
source = "pagerduty/pagerduty"
version = "~> 2.5.2"
}
}
resource "pagerduty_service" "this" {
name = var.name
description = <<-EOT
criticality : ${var.serviceregistry.criticality}
team : ${var.serviceregistry.team_id}
resiliency : ${var.serviceregistry.resiliency_score}
gm : ${var.teamworks.business_group}
jira : ${var.serviceregistry.jira}
type : ${var.serviceregistry.type}
repo : ${replace(replace(var.serviceregistry.repo_url, ".com:", ".com/"), "git@", "https://")}
Managed by Terraform - https://${var.terraform_repository}
EOT
escalation_policy = pagerduty_escalation_policy.this.id
alert_creation = "create_alerts_and_incidents"
acknowledgement_timeout = "null"
auto_resolve_timeout = "null"
# Enable Event Intelligence
alert_grouping_parameters {
type = "intelligent"
config {}
}
# Enable Dynamic notifications based on alert severity
incident_urgency_rule {
type = "constant"
urgency = "severity_based"
}
}
Terraform Version
terraform 0.14.11
Affected Resource(s)
Terraform Configuration Files
within a pagerduty_service block
this used to work, but now returns:
It works fine if you remove the config block.
The documentation says: