yannh / terraform-provider-statuspage

A Terraform provider for Statuspage.io
https://registry.terraform.io/providers/yannh/statuspage/latest
Mozilla Public License 2.0
47 stars 25 forks source link

statuspage_metrics_provider create fails for Datadog type #59

Open sean-snyk opened 10 months ago

sean-snyk commented 10 months ago

When creating a metric provider of the type Datadog, the statuspage api https://developer.statuspage.io/#operation/postPagesPageIdMetricsProviders documents api_key and api_token as the required fields

2023-09-19-153422

But the provider documents api_key and application_key as the required fields.

2023-09-19-153639

Setting api_key and application_key (with or without api_token set) results in

Error: failed creating resource, request returned 422, full response: &{Status:422 Unprocessable Entity StatusCode:422 Proto:HTTP/2.0 ProtoMajor:2 ProtoMinor:0 Header:map[Atl-Traceid:[9b9555fa1da89dc5] Cache-Control:[no-cache] Content-Type:[application/json] Date:[Tue, 19 Sep 2023 14:00:46 GMT] Nel:[{"failure_fraction": 0.001, "include_subdomains": true, "max_age": 600, "report_to": "endpoint-1"}] Report-To:[{"endpoints": [{"url": "https://dz8aopenkvv6s.cloudfront.net"}], "group": "endpoint-1", "include_subdomains": true, "max_age": 600}] Server:[AtlassianEdge] Strict-Transport-Security:[max-age=63072000; preload] Vary:[Origin, Accept-Encoding] X-Content-Type-Options:[nosniff] X-Runtime:[0.065030] X-Xss-Protection:[1; mode=block]] Body:0xc000116b10 ContentLength:-1 TransferEncoding:[] Close:false Uncompressed:true Trailer:map[] Request:0xc0001b4100 TLS:0xc000604bb0} with statuspage_metrics_provider.staging_datadog on statuspage_staging.tf line 13, in resource "statuspage_metrics_provider" "staging_datadog":

Setting api_key with just api_token results in:

Error: parameter application_key is required for Datadog Metrics Provider with statuspage_metrics_provider.staging_datadog on statuspage_staging.tf line 13, in resource "statuspage_metrics_provider" "staging_datadog": resource "statuspage_metrics_provider" "staging_datadog" {

sealneaward commented 5 months ago

I get the same error.

sealneaward commented 5 months ago

Actually the problem is not having metric_base_uri provided as an argument. Once I added that, the resource was created. For some reason, this is not documented for the resource.

Maybe a new version of the provider needs to be released @yannh ?