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

Error [Url can't be empty] with resource "pagerduty_extension" #131

Closed
heldersepu opened this issue May 3, 2019 · 3 comments · Fixed by #164
Closed

Error [Url can't be empty] with resource "pagerduty_extension" #131

heldersepu opened this issue May 3, 2019 · 3 comments · Fixed by #164

Comments

@heldersepu
Copy link

heldersepu commented May 3, 2019

Terraform Version

Terraform v0.11.13

Affected Resource(s)

pagerduty_extension

Terraform Configuration Files

resource "pagerduty_extension" "slack"{
  name = "My Web App Extension"
   extension_schema = "${data.pagerduty_extension_schema.webhook.id}"
  extension_objects    = ["${pagerduty_service.example.id}"]

  config = <<EOF
{
    "restrict": "any",
    "notify_types": {
            "resolve": false,
            "acknowledge": false,
            "assignments": false
    },
    "access_token": "XXX"
}
EOF

}.

Here is the full code:
https://github.com/heldersepu/hs-scripts/blob/master/TerraForm/pagerduty/pagerduty.tf

Debug Output

Error: Error applying plan:

1 error(s) occurred:

* ....pagerduty_extension.slack: 1 error(s) occurred:

* pagerduty_extension.slack: 
  POST API call to https://api.pagerduty.com/extensions failed 400 Bad Request. 
  Code: 2001, Errors: [Url can't be empty], Message: Invalid Input Provided

Expected Behavior

It should complete without errors?

Actual Behavior

We get that strange 'Url can't be empty' error but according to the documentation the endpoint_url is optional

@pdecat
Copy link
Contributor

pdecat commented May 5, 2019

Hi, the endpoint URL is optional API wise in most cases, and the provider was updated to match that behavior in #83, but I believe it can be required in some cases such as the pagerduty_extension_schema named Generic V2 Webhook you are using here.

For the pagerduty_extension_schema named Slack, the API accepts pagerduty_extension with no endpoint_url defined.

@heldersepu
Copy link
Author

heldersepu commented May 5, 2019

@pdecat would be nice if that:

optional in most cases ... it can be required in some cases

was included in the documentation

Yes changing the pagerduty_extension_schema to the one named Slack works without the endpoint_url

@karancode
Copy link
Contributor

@heimweh @pdecat I updated the documentation #164. PTAL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants