opsgenie / terraform-provider-opsgenie

Terraform OpsGenie provider
https://registry.terraform.io/providers/opsgenie/opsgenie/latest/docs
Mozilla Public License 2.0
100 stars 136 forks source link

Feature: output the API key for opsgenie_api_integration resources #366

Open BapRx opened 1 year ago

BapRx commented 1 year ago

Terraform Version

❯ terraform -v
Terraform v1.3.9
on linux_amd64

Affected Resource(s)

Please list the resources as a list, for example:

Expected Behavior

I'd like to get the computed API key from the Terraform managed PingdomV2 API integrations.

Actual Behavior

# module.opsgenie.opsgenie_api_integration.pingdom:
resource "opsgenie_api_integration" "pingdom" {
    allow_write_access     = true
    enabled                = true
    id                     = "<redacted>"
    name                   = "Pingdom CUSTOMER"
    owner_team_id          = "<redacted>"
    suppress_notifications = false
    type                   = "PingdomV2"
}

The OpsGenie interface fetches the API key with a separate call:

/webapi/v1/integrations/PingdomV2Integration/update?_=nonce&id=<integration_id>&settings=true&teamId=<owner_team_id>
deepbrook commented 1 year ago

..and while we're at it, having a data source for api integrations would be great as well!

mbarrien commented 11 months ago

Some notes from investigating this: