Creating AWS EventBridge integration through API does not create Partner Event Bus in AWS

Hi all,

When creating an AWS Event Bridge extension through the API like below, we’re seeing the extension being configured in the PagerDuty console but not in AWS. Performing the steps manually in the PagerDuty console is working as expected.

curl --request POST \
  --url https://api.pagerduty.com/extensions \
  --header 'Accept: application/vnd.pagerduty+json;version=2' \
  --header 'Authorization: Token token=redacted' \
  --header 'Content-Type: application/json' \
  --data '{
	"extension": {
      "name": "test",
      "config": {
        "aws_account_id": "redacted",
        "aws_region": "us-east-1",
        "aws_partner_event_source_name": "forumtest"
      },
      "extension_schema": {
        "id": "PF8FPF1",
        "type": "extension_schema_reference"
      },
      "extension_objects": [
        {
          "id": "redacted",
          "type": "service_reference"
        }
      ]
    }
  }'

That returns a seemingly correct response:

{
    "extension": {
        "endpoint_url": null,
        "name": "test",
        "config": {
            "aws_account_id": "redacted but correct",
            "aws_region": "us-east-1",
            "aws_partner_event_source_name": "forumtest"
        },
        "extension_schema": {
            "id": "PF8FPF1",
            "type": "extension_schema_reference",
            "summary": "Amazon EventBridge",
            "self": "https://api.pagerduty.com/extension_schemas/PF8FPF1",
            "html_url": null
        },
        "extension_objects": [
            {
                redacted but correct
            }
        ],
        "id": "PB1I3T1",
        "type": "webhook",
        "summary": "test",
        "self": "https://api.pagerduty.com/webhooks/PB1I3T1",
        "html_url": null
    }
}

And creates the extension in the PagerDuty UI:

But the AWS Partner event sources page doesn’t list the new event source (redacted event sources are from manual configuration in the UI)

I initially stumbled on this using the Terraform PagerDuty provider (being able to use that end to end is our end goal, currently we have documented the manual process), but I was able to reproduce it with the API directly so it does not appear to be a Terraform provider issue.

Any guidance?

1 Like

Hi Mark,

I have been facing the exact same issue, upon checking I found it strange that the config object for the Event Bridge extension is

"config": {
    "arn": {
      "label": "Event Source ARN",
      "placeholder": "Event Source ARN",
      "type": "password",
      "encrypted": true
    }
}      

And as per the documentation, the config object sent during extension creation should be according to the config defined for that particular extension’s extension schema , but the config returned by an already created EventBridge extension looks like the one you have sent in your request.
As per the documentation on Extension Schema:

In addition, if the Extension Schema has a config object, the Extension will need to provide config values based on what the Extension Schema indicates are required for the config.

Can’t seem to understand what’s missing.

Yeah. I assumed it was a documentation bug so I used the response when calling List Extensions to build my request object, which also seemed to match the fields in the UI.

It almost feels like clicking “Create” in the PD UI fires an event/calls a service/internal magic after it creates the extension resource that the API doesn’t or can’t.

Hi Mark,

Thank you for reaching out to PagerDuty Customer Support!

I’ve looked into this internally and presently the EventBridge extension was built to be created expressly via the UI and was not built in such a way as to allow for creation via the REST API, which makes successful creation of an EventBridge extension via Terraform not possible at this point in time.

I can recognize the great value of the ability to create EventBridge extensions via the API (and therefore via Terraform), and I am happy to add your input and vote to the existing feature request that we have on file for the creation of EventBridge extensions through the API.

Please let me know if you have any further feedback you’d like to share regarding your use case, or any other questions that I can help you with today.

Best regards,

2 Likes

has this been fixed yet by chance?
if not, is there an issue we can follow to track progress?