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

pagerduty_service_integration does not return the integration_url #783

Open
waldman opened this issue Dec 11, 2023 · 0 comments
Open

pagerduty_service_integration does not return the integration_url #783

waldman opened this issue Dec 11, 2023 · 0 comments

Comments

@waldman
Copy link

waldman commented Dec 11, 2023

Hi there,

pagerduty_service_integration should return an attribute containing the integration_url otherwise we need to do string interpolation in order to tie up creation of an sns_topic_subscription with the integration enqueue URL.

To provide some examples, this is what we should be able to do:

data "pagerduty_vendor" "cloudwatch" {
  name = "Cloudwatch"
}

resource "pagerduty_service_integration" "cloudwatch" {
  name    = "test"
  service = "[redacted]"
  vendor  = data.pagerduty_vendor.cloudwatch.id
}

resource "aws_sns_topic" "topic" {
  name = "test"
}

resource "aws_sns_topic_subscription" "subscription" {
  endpoint  = pagerduty_service_integration.cloudwatch.integration_url
  protocol  = "https"
  topic_arn = aws_sns_topic.topic.arn
}

And this is what we actually have to do:

data "pagerduty_vendor" "cloudwatch" {
  name = "Cloudwatch"
}

resource "pagerduty_service_integration" "cloudwatch" {
  name    = "test"
  service = "[redacted]"
  vendor  = data.pagerduty_vendor.cloudwatch.id
}

resource "aws_sns_topic" "topic" {
  name = "test"
}

resource "aws_sns_topic_subscription" "subscription" {
  endpoint  = "https://events.pagerduty.com/integration/${pagerduty_service_integration.cloudwatch.integration_key}/enqueue"
  protocol  = "https"
  topic_arn = aws_sns_topic.topic.arn
}

Note the interpolation for endpoint at aws_sns_topic_subscription

  endpoint  = "https://events.pagerduty.com/integration/${pagerduty_service_integration.cloudwatch.integration_key}/enqueue"
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