pulumi / pulumi-pagerduty

A PagerDuty Pulumi resource package, providing multi-language access to PagerDuty
Apache License 2.0
8 stars 2 forks source link

PagerDuty ServiceIntegration has incorrect html_url value #359

Open robnotley opened 9 months ago

robnotley commented 9 months ago

What happened?

We have created a Microsoft Azure integration within PagerDuty. However the value for the webhook _htmlurl is incorrect so cannot be used. Instead we have to use the _integrationkey value and concat this into a static url. The _integrationkey value is due to be deprecated.

Example

PagerDuty Azure Integration Creation

azure_vendor = pagerduty.get_vendor(name="Microsoft Azure")

pd_integration = pagerduty.ServiceIntegration("Platform Cloud - "+customer_alias+" Integration",
    vendor=azure_vendor.id,
    service=service.id)

Example output of pd_integration values

Please note that the _htmlurl value does not correspond to the Integration URL value shown in PagerDuty portal

image

Work Around

We are currently using the following as a workaround where we use a static url and concat the _integrationkey into the url.

# We have to concat URL here with integration key as pd_integration.html_url pulls back incorrect URL.
action_group = create_action_group(
    name=("ag-pagerduty-"+customer_alias+"-"),
    short_name="PagerDuty",
    type="webhook",
    webhook_name="PagerDuty",
    resource_group=action_group_resource_group,
    webhook_url=pulumi.Output.concat("https://events.eu.pagerduty.com/integration/",pd_integration.integration_key,"/enqueue")
)

return {
    "azure_action_group": action_group
}

However we receive the following warning when running pulumi up

_warning: integrationkey is deprecated: Assignments or updates to this attribute are not supported by Service Integrations API, it is a read-only value. Input support will be dropped in upcomming major release

Output of pulumi about

Plugins NAME VERSION azure 5.41.0 azure-native 2.25.0 azuread 5.47.0 keycloak 5.2.1 mailgun 3.4.0 opsgenie 1.1.6 pagerduty 4.3.1 python unknown random 4.8.0

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

iwahbe commented 9 months ago

Hi @robnotley. Thanks for letting us know about this issue. The html_url field id described as:

https://github.com/pulumi/pulumi-pagerduty/blob/739e14a076a5530bcae8c0432176f2264d9a6b74/sdk/python/pulumi_pagerduty/service_integration.py#L875-L878

It doesn't look like it should be equivalent to the "Integration URL" displayed in the web UI. I believe that you are doing the correct thing vis a vis concatenation.

I don't believe that integration_key is being deprecated as an output, just as an input. We shouldn't be issuing the warning when you use it as an output. That is a bug.