Pagerduty_service resource with count as `if condition` is failing

I am trying to create a PD service only if service exists in the list of strings, which was working fine in terraform 11

resource “pagerduty_service” “csp” {
count = “{var.csppd ? 1 : 0}" name = "CSP {var.namespace}”
escalation_policy = “${var.moonshot_pd_escalation_policy_id[“value”]}”

which is used for creating integration like this,

resource “pagerduty_service_integration” “csp” {
count = “{var.csppd ? 1 : 0}" vendor = "{data.pagerduty_vendor.cloudwatch.id}”
service = “${pagerduty_service.csp.id}”
}

output “csp” {
value = “${pagerduty_service_integration.csp.*.integration_key}”
}

************ This worked fine in TF11*********

I am trying to upgrade our project to TF12 which caused problem with this approach,

/*
on csp.tf line 47, in resource “pagerduty_service_integration” “csp”:
47: service = “${pagerduty_service.csp.id}”

Because pagerduty_service.csp has “count” set, its attributes must be accessed
on specific instances.

For example, to correlate with indices of a referring resource, use:
pagerduty_service.csp[count.index] */

There is anything to provide index, How do I handle this?