Coder Social home page Coder Social logo

yannh / terraform-provider-statuspage Goto Github PK

View Code? Open in Web Editor NEW
47.0 47.0 25.0 8.05 MB

A Terraform provider for Statuspage.io

Home Page: https://registry.terraform.io/providers/yannh/statuspage/latest

License: Mozilla Public License 2.0

Makefile 4.84% Go 92.07% HTML 3.09%
statuspage terraform terraform-provider

terraform-provider-statuspage's Introduction

test Go Report card Terraform logo

Terraform Provider for Statuspage.io

The Statuspage provider is used to interact with the resources supported by Statuspage.io.

Requirements

  • Terraform 0.10.x
  • Go 1.11 (to build the provider plugin)

Building The Provider

Clone repository to: `$GOPATH/src/github.com/yannh/terraform-provider-statuspage

$ mkdir -p $GOPATH/src/github.com/yannh; cd $GOPATH/src/github.com/yannh
$ git clone https://github.com/yannh/terraform-provider-statuspage.git

Enter the provider directory and build the provider

$ cd $GOPATH/src/github.com/yannh/terraform-provider-statuspage
$ make build

Developing the Provider

If you wish to work on the provider, you'll first need Go installed on your machine (version 1.11+ is required). You'll also need to correctly setup a GOPATH, as well as adding $GOPATH/bin to your $PATH.

To compile the provider, run make build. This will build the provider and put the provider binary in the $GOPATH/bin directory.

$ make build
...
$ $GOPATH/bin/terraform-provider-statuspage
...

In order to test the provider, set the following variables:

$ export STATUSPAGE_TOKEN=www
$ export STATUSPAGE_PAGE=xxx    # PageID of the Statuspage page
$ export STATUSPAGE_PAGE_2=xxx  # PageID of another Statuspage page
$ export DATADOG_API_KEY=yyy
$ export DATADOG_APPLICATION_KEY=zzz

, and then run make test acc.

$ make test acc

terraform-provider-statuspage's People

Contributors

davidmontoyago avatar knapo avatar lukeamaral avatar promaty avatar usmansharifkhan avatar yannh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

terraform-provider-statuspage's Issues

A panic when importing a metric

$ terraform import 'statuspage_metric.metrics["pingdom_docs"]' '[REDACTED]/[REDACTED]'
statuspage_metric.metrics["pingdom_docs"]: Importing from ID "[REDACTED]/[REDACTED]"...

Error: rpc error: code = Unavailable desc = transport is closing


panic: runtime error: invalid memory address or nil pointer dereference
2021-02-23T16:56:13.529-0800 [DEBUG] plugin.terraform-provider-statuspage_v0.1.7: [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x19e8bb6]
2021-02-23T16:56:13.529-0800 [DEBUG] plugin.terraform-provider-statuspage_v0.1.7:
2021-02-23T16:56:13.529-0800 [DEBUG] plugin.terraform-provider-statuspage_v0.1.7: goroutine 14 [running]:
2021-02-23T16:56:13.530-0800 [DEBUG] plugin.terraform-provider-statuspage_v0.1.7: github.com/yannh/terraform-provider-statuspage/statuspage.resourceMetricRead(0xc0001a8150, 0x1aeb520, 0xc000204280, 0x1a7b8e0, 0xc0004bea70)
2021-02-23T16:56:13.530-0800 [DEBUG] plugin.terraform-provider-statuspage_v0.1.7: 	github.com/yannh/terraform-provider-statuspage/statuspage/resource_metric.go:83 +0x816
2021-02-23T16:56:13.530-0800 [DEBUG] plugin.terraform-provider-statuspage_v0.1.7: github.com/yannh/terraform-provider-statuspage/statuspage.resourceMetricImport(0xc0001a8150, 0x1aeb520, 0xc000204280, 0x11, 0xc0004c0578, 0xc000681601, 0x0, 0x10747fc)
2021-02-23T16:56:13.530-0800 [DEBUG] plugin.terraform-provider-statuspage_v0.1.7: 	github.com/yannh/terraform-provider-statuspage/statuspage/resource_metric.go:146 +0x4d5
2021-02-23T16:56:13.530-0800 [DEBUG] plugin.terraform-provider-statuspage_v0.1.7: github.com/hashicorp/terraform/helper/schema.(*Provider).ImportState(0xc00019cb00, 0xc000149990, 0xc00069c0a0, 0x19, 0xc000202510, 0xc000202518, 0xc000149910, 0x13d83e5, 0xc0001100c0)
2021-02-23T16:56:13.530-0800 [DEBUG] plugin.terraform-provider-statuspage_v0.1.7: 	github.com/hashicorp/[email protected]/helper/schema/provider.go:381 +0x286
2021-02-23T16:56:13.530-0800 [DEBUG] plugin.terraform-provider-statuspage_v0.1.7: github.com/hashicorp/terraform/helper/plugin.(*GRPCProviderServer).ImportResourceState(0xc00000ea58, 0x1d93580, 0xc0002024e0, 0xc0002c0180, 0xc00000ea58, 0xc0002024e0, 0xc000141a48)
2021-02-23T16:56:13.530-0800 [DEBUG] plugin.terraform-provider-statuspage_v0.1.7: 	github.com/hashicorp/[email protected]/helper/plugin/grpc_provider.go:970 +0xd3
2021-02-23T16:56:13.530-0800 [DEBUG] plugin.terraform-provider-statuspage_v0.1.7: github.com/hashicorp/terraform/internal/tfplugin5._Provider_ImportResourceState_Handler(0x1bdd3c0, 0xc00000ea58, 0x1d93580, 0xc0002024e0, 0xc000098370, 0x0, 0x1d93580, 0xc0002024e0, 0xc0001100c0, 0x2e)
2021-02-23T16:56:13.530-0800 [DEBUG] plugin.terraform-provider-statuspage_v0.1.7: 	github.com/hashicorp/[email protected]/internal/tfplugin5/tfplugin5.pb.go:3235 +0x214
2021-02-23T16:56:13.530-0800 [DEBUG] plugin.terraform-provider-statuspage_v0.1.7: google.golang.org/grpc.(*Server).processUnaryRPC(0xc000682c00, 0x1d9cdc0, 0xc000210d80, 0xc000120200, 0xc00010e5d0, 0x232fb58, 0x0, 0x0, 0x0)
2021-02-23T16:56:13.530-0800 [DEBUG] plugin.terraform-provider-statuspage_v0.1.7: 	google.golang.org/[email protected]/server.go:966 +0x486
2021-02-23T16:56:13.530-0800 [DEBUG] plugin.terraform-provider-statuspage_v0.1.7: google.golang.org/grpc.(*Server).handleStream(0xc000682c00, 0x1d9cdc0, 0xc000210d80, 0xc000120200, 0x0)
2021-02-23T16:56:13.530-0800 [DEBUG] plugin.terraform-provider-statuspage_v0.1.7: 	google.golang.org/[email protected]/server.go:1245 +0xcac
2021-02-23T16:56:13.530-0800 [DEBUG] plugin.terraform-provider-statuspage_v0.1.7: google.golang.org/grpc.(*Server).serveStreams.func1.1(0xc0001161c0, 0xc000682c00, 0x1d9cdc0, 0xc000210d80, 0xc000120200)
2021-02-23T16:56:13.530-0800 [DEBUG] plugin.terraform-provider-statuspage_v0.1.7: 	google.golang.org/[email protected]/server.go:685 +0xa5
2021-02-23T16:56:13.530-0800 [DEBUG] plugin.terraform-provider-statuspage_v0.1.7: created by google.golang.org/grpc.(*Server).serveStreams.func1
2021-02-23T16:56:13.530-0800 [DEBUG] plugin.terraform-provider-statuspage_v0.1.7: 	google.golang.org/[email protected]/server.go:683 +0xa5
2021-02-23T16:56:13.532-0800 [DEBUG] plugin: plugin process exited: path=.terraform/plugins/registry.terraform.io/yannh/statuspage/0.1.7/darwin_amd64/terraform-provider-statuspage_v0.1.7 pid=30712 error="exit status 2"
2021/02/23 16:56:13 [ERROR] eval: *terraform.EvalImportState, err: rpc error: code = Unavailable desc = transport is closing
2021/02/23 16:56:13 [ERROR] eval: *terraform.EvalSequence, err: rpc error: code = Unavailable desc = transport is closing
2021/02/23 16:56:13 [TRACE] [walkImport] Exiting eval tree: statuspage_metric.metrics["pingdom_docs"] (import id "ym160lg4ny6r/vn8xp667dt7w")
2021/02/23 16:56:13 [TRACE] vertex "statuspage_metric.metrics[\"pingdom_docs\"] (import id \"ym160lg4ny6r/vn8xp667dt7w\")": visit complete
2021/02/23 16:56:13 [TRACE] dag/walk: upstream of "provider[\"registry.terraform.io/yannh/statuspage\"] (close)" errored, so skipping
2021/02/23 16:56:13 [TRACE] dag/walk: upstream of "root" errored, so skipping
2021-02-23T16:56:13.680-0800 [DEBUG] plugin: plugin exited



!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!

Terraform crashed! This is always indicative of a bug within Terraform.
A crash log has been placed at "crash.log" relative to your current
working directory. It would be immensely helpful if you could please
report the crash with Terraform[1] so that we can fix this.

When reporting bugs, please include your terraform version. That
information is available on the first line of crash.log. You can also
get it by running 'terraform --version' on the command line.

SECURITY WARNING: the "crash.log" file that was created may contain
sensitive information that must be redacted before it is safe to share
on the issue tracker.

[1]: https://github.com/hashicorp/terraform/issues

!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!

Datadog Provider not working

We are trying to integrate Datadog metrics via the terraform provider.

We are using

resource "statuspage_metrics_provider" "datadog" {
  page_id   = "MY_PAGE_ID"
  api_key   = "MY_API_KEY"
  api_token = "MY_APPLICATION_KEY"
  type      = "Datadog"
}

but that yields an error

* statuspage_metrics_provider.datadog: failed creating metrics_provider, request returned 422, full
response: &{Status:422 Unprocessable Entity StatusCode:422 Proto:HTTP/2.0 ProtoMajor:2 ProtoMinor:0
Header:map[Cache-Control:[no-cache] Content-Length:[44] Content-Type:[application/json] Vary:[Origin]
X-Request-Id:[19417729-28a1-4432-a646-3004e69bee25] X-Runtime:[0.075292]] Body:{cs:0xc0005e2dc0}
ContentLength:44 TransferEncoding:[] Close:false Uncompressed:false Trailer:map[]
Request:0xc000122500 TLS:0xc0004308f0}

Reading through your code and the API docs, I assume the error is that the provider uses (and checks for) APIKey and APIToken whereas the API expects api_key and application_key.

Metric creation failing

Hello,
I wanted to use this provider to create metrics in my StatusPage. In current state (I believe after this merge) there is a problem - as omitempty doesn't work properly when using pointers and all fields receive some default value. The issue occurs when I don't want to set up y_axis_min and y_axis_max properties - both of them are set up to 0 as a default value, and when trying to do the POST request I receive 422 status code with message:

{"error":["Y-axis min must be less than Y-axis max."]}

The workaround for that is to set up property y_axis_hidden to true - in that case POST request works as expected. In that case, StatusPage API returns metric with below definition:

{"name":"test from terraform","metric_identifier":"test_tf_id","created_at":"2022-06-03T09:48:34.867Z","updated_at":"2022-06-03T09:48:34.867Z","id":"<some_id>","metrics_provider_id":"<id>","display":true,"y_axis_min":-0.01,"y_axis_max":1.01,"y_axis_hidden":true,"suffix":"","decimal_places":0,"tooltip_description":"","most_recent_data_at":null,"backfilled":false}

where y_axis_min and y_axis_max have some defaults.

I'm wondering if additional validation before metric creation makes sense. Or maybe that is not the place for doing that, and instead it should be done in go-sdk?

PGP Key Expired -- Failed to Install Provider

Issue:
It looks like your PGP Key expired. As a result, I can longer install this provider on terraform init.

Here is the error message:

╷
│ Error: Failed to install provider
│ 
│ Error while installing yannh/statuspage v0.1.12: error checking signature:
│ openpgp: key expired
╵

Can you please fix this? If you need any other details please let me know.

Thanks!

Provide versioned binary releases

Currently the only releleases are from the master branch on gitlab's ci jobs.

It would be nice to provide versioned binaries for multiple platforms. Submitted as release artifacts.

I have a WIP branch adding this using goreleser would this be something you would accept?

Ordering of resources (eg components + component groups)

Hey, thanks for putting the provider together!

In testing this provider, do you have any ideas for how TF can order the components?

Right now it seems to be ordered (without any modifications in SP) by newest to oldest.

Here is an idea:

  1. Each resource, what your thoughts on using an arbitrarily weighted system? This should work for any top-level resources. For example:
resource "statuspage_component" "website" {
  page_id     = "${var.page_id}"
  name        = "My Website"
  description = "Status of my website"
  status      = ""
  weight      = -10  # (optional field, default = 0)
}

resource "statuspage_component" "below-website" {
  page_id     = "${var.page_id}"
  name        = "Below Website"
  description = "Status of my website"
  status      = ""
  weight      = -100  # (optional field, default = 0)
}

resource "statuspage_component" "above-website" {
  page_id     = "${var.page_id}"
  name        = "Above Website"
  description = "Status of my website"
  status      = ""
  weight      = 5  # (optional field, default = 0)
}

resource "statuspage_component" "above-group" {
  page_id     = "${var.page_id}"
  name        = "Above Group"
  description = "Status of my website"
  status      = ""
  weight      = 5  # (optional field, default = 0)
}

resource "statuspage_component_group" "my-group" {
  page_id     = "${var.page_id}"
  name        = "terraform"
  description = "Created by terraform"
  components = [
    "${statuspage_component.above-website.id}",
    "${statuspage_component.website.id}",
    "${statuspage_component.below-website.id}",
  ]
  weight      = 2  # (optional field, default = 0)
}

2a. For component ordering in a group, to use the ordering of the list in statuspage_component_group.components[]. This ignores weights assigned to components, or..

2b. For components ordering in a group, to use the weights assigned to components. This ignores the ordering of the list in statuspage_component_group.components[].

I'm not familiar with the SP API so it might expect to do it differently?

statuspage_metrics_provider create fails for Datadog type

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" {

Ordering of component groups

Hi,

I have created a statuspage with multiple components and a component group that inclused these component. However, with the current implementation the provider seems to use a different ordering than what is returned by the API. The result is that on every TF run it tries to reorder the components.

Example:

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  ~ statuspage_component_group.web
      components.0: "f30f5bxdjkm3" => "n7r1jhzvlndy"
      components.1: "g79sjl6272y6" => "q4nxjxgwb0pc"
      components.2: "q4nxjxgwb0pc" => "f30f5bxdjkm3"
      components.3: "n7r1jhzvlndy" => "g79sjl6272y6"


Plan: 0 to add, 1 to change, 0 to destroy.

Executing that plan and running terraform plan again results in the same plan.

This makes it hard to detect drift.

Expected behaviour: After setting up a component group with some ordering, the next run will show no changes.

Unable to set showcase to false

Using the provider we are unable to set showcase = false no matter what the sate was. Setting it to true however does update the sate.

So the following transition does not seem to work

showcase = true -> showcase = false

but the following does work

showcase = false -> showcase = true

I think this has to do with the omitempty on boolean fields, as I see the same issue for only_show_if_degraded

Haven't been able to test if removing omitempty fixes the issue though.

terraform error after manually deleting a component from statuspage

Hello,
This provider does not seem to appreciate when a component is (manually) deleted from statuspage.
After manual deletion, I got:

terraform plan
[...]
Error: could not find component with ID: 9nt3wb5yrbm9, http status 404

I expected for terraform plan to succeed and propose to reprovision the component.

Terraform v0.13.6
+ provider registry.terraform.io/yannh/statuspage v0.1.7

Updating page_id for a component doesn't work

If I just change the page_id then the plan will be:

  # module.statuspage_component["test_component"].statuspage_component.test_component will be updated in-place
  ~ resource "statuspage_component" "test_component" {
        automation_email      = "[email protected]"
        description           = "Test component"
        id                    = "3aatyllodd78"
        name                  = "test_component"
        only_show_if_degraded = false
      ~ page_id               = "1dm8qkaypshw" -> "eweq026a3hrd"
        showcase              = true
        status                = "operational"
    }

I get a an error message when applying this plan:

Error: failed updating component, request returned 404

This seems to be, because the PUT /pages/{page_id}/components/{component_id} API has the page id in its path parameter.

The fix seems to be to have the plan destroy the previous component on the old page and create a new component on the new page.

Publish provider for use in Terraform 0.13

👋 Hi, I'm on the Terraform Providers team at HashiCorp. With the release of the Terraform 0.13 beta, users can now download and install community providers from the registry. We are inviting provider authors (especially those for popular community providers) to publish their providers in a closed beta.

To get invited to the closed beta, please email [email protected]. We need:

  • A list of GitHub usernames to add to the beta (you and any team members who will publish)
  • List of provider repositories you plan to publish
  • A GPG public key in ASCII-armor format, which you will be using to sign your provider releases

You can use one key for all of your providers, or separate keys if you prefer. If you are publishing from an organization, this key or keys will be associated with that namespace. Once in the beta, you can manage personal keys in the UI as well.

Add group id support to component creation

We have a use-case where component when created has to be added to a component group, the source code of terraform-statuspage-provider does not allow configuration of group id during component creation where the go-sdk already has support for it. The task of this ticket is to update the component creation function to also incorporate group id to fulfil our use-case.

Data lookups

Hello,

Requesting a feature request to have the ability to add data lookups for each of the resources currently exposed.

It would be awesome to have the capability to do something like:

data "statuspage_component" "this" {}

that could pull in every component from your account.

You could then take that data to help build your codebase if you are trying to backport a lot of existing work into Terraform.


I'm not sure if how easy it would be to just do something like to import everything all in a single call.

data "statuspage_account" "this" {
      // maybe add account number here or a specific page? 
      page = "MyAwesomePage"
}

Support for setting a start date

It doesn't seem like there is any support for setting the start_date field.

The API does support it, so I believe this should be trivial.

crash importing statuspage_metric

version v0.1.12

resource "statuspage_metric" "staging_platform_api_success_rate" {
  page_id             = local.staging_page_id
  metrics_provider_id = statuspage_metrics_provider.staging_datadog.id
  name                = "Platform API Success Rate"
  metric_identifier   = "100-((sum:envoy.http.downstream.rq.xx{envoy.response.code.class:5,container:gateway-proxy}.as_count().rollup(sum, 3600))/(sum:envoy.http.downstream.rq.xx{container:gateway-proxy}.as_count().rollup(sum, 3600))*100)"
  display             = false
  suffix              = "%"
}
main » tf import statuspage_metric.staging_platform_api_success_rate m219lkb9w9m5/0vnm97s93bty
2023-09-19T14:39:17.019+0100 [INFO]  Terraform version: 1.5.7
2023-09-19T14:39:17.019+0100 [DEBUG] using github.com/hashicorp/go-tfe v1.26.0
2023-09-19T14:39:17.019+0100 [DEBUG] using github.com/hashicorp/hcl/v2 v2.16.2
2023-09-19T14:39:17.019+0100 [DEBUG] using github.com/hashicorp/terraform-svchost v0.1.0
2023-09-19T14:39:17.019+0100 [DEBUG] using github.com/zclconf/go-cty v1.12.2
2023-09-19T14:39:17.019+0100 [INFO]  Go runtime version: go1.20.7
2023-09-19T14:39:17.019+0100 [INFO]  CLI args: []string{"terraform", "import", "statuspage_metric.staging_platform_api_success_rate", "m219lkb9w9m5/0vnm97s93bty"}
2023-09-19T14:39:17.019+0100 [DEBUG] Attempting to open CLI config file: /home/user/.config/terraform.rc
2023-09-19T14:39:17.020+0100 [INFO]  Loading CLI configuration from /home/user/.config/terraform.rc
2023-09-19T14:39:17.020+0100 [DEBUG] Not reading CLI config directory because config location is overridden by environment variable
2023-09-19T14:39:17.020+0100 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2023-09-19T14:39:17.020+0100 [DEBUG] ignoring non-existing provider search directory /home/user/.terraform.d/plugins
2023-09-19T14:39:17.020+0100 [DEBUG] ignoring non-existing provider search directory /home/user/.data/terraform/plugins
2023-09-19T14:39:17.020+0100 [DEBUG] ignoring non-existing provider search directory /usr/local/share/terraform/plugins
2023-09-19T14:39:17.020+0100 [DEBUG] ignoring non-existing provider search directory /usr/share/terraform/plugins
2023-09-19T14:39:17.020+0100 [INFO]  CLI command args: []string{"import", "statuspage_metric.staging_platform_api_success_rate", "m219lkb9w9m5/0vnm97s93bty"}
2023-09-19T14:39:17.020+0100 [INFO]  Checkpoint disabled. Not running.
2023-09-19T14:39:17.022+0100 [DEBUG] Service discovery for app.terraform.io at https://app.terraform.io/.well-known/terraform.json
2023-09-19T14:39:17.356+0100 [DEBUG] Retrieve version constraints for service tfe.v2.1 and product terraform
2023-09-19T14:39:18.004+0100 [DEBUG] Service discovery for app.terraform.io aliased as localterraform.com
2023-09-19T14:39:18.043+0100 [DEBUG] checking for provisioner in "."
2023-09-19T14:39:18.046+0100 [DEBUG] checking for provisioner in "/usr/bin"
2023-09-19T14:39:20.355+0100 [DEBUG] Building and walking import graph
2023-09-19T14:39:20.356+0100 [DEBUG] adding implicit provider configuration provider["terraform.io/builtin/terraform"], implied first by data.terraform_remote_state.datadog-infra-tokens (expand)
2023-09-19T14:39:20.356+0100 [DEBUG] ProviderTransformer: "statuspage_component.staging_example (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/yannh/statuspage"]
2023-09-19T14:39:20.356+0100 [DEBUG] ProviderTransformer: "statuspage_metric.staging_platform_api_success_rate (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/yannh/statuspage"]
2023-09-19T14:39:20.356+0100 [DEBUG] ProviderTransformer: "data.terraform_remote_state.datadog-infra-tokens (expand)" (*terraform.nodeExpandPlannableResource) needs provider["terraform.io/builtin/terraform"]
2023-09-19T14:39:20.356+0100 [DEBUG] ProviderTransformer: "statuspage_metric.staging_platform_api_success_rate_prod16 (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/yannh/statuspage"]
2023-09-19T14:39:20.356+0100 [DEBUG] ProviderTransformer: "statuspage_metrics_provider.staging_datadog (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/yannh/statuspage"]
2023-09-19T14:39:20.356+0100 [DEBUG] ProviderTransformer: "statuspage_metrics_provider.staging_self (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/yannh/statuspage"]
2023-09-19T14:39:20.356+0100 [DEBUG] ProviderTransformer: "statuspage_metric.staging_open_source_test_success_rate_prod16 (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/yannh/statuspage"]
2023-09-19T14:39:20.356+0100 [DEBUG] ProviderTransformer: "statuspage_metric.staging_pr_checks_success_rate (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/yannh/statuspage"]
2023-09-19T14:39:20.356+0100 [DEBUG] ProviderTransformer: "statuspage_metric.staging_platform_api_latency_prod16 (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/yannh/statuspage"]
2023-09-19T14:39:20.357+0100 [ERROR] AttachSchemaTransformer: No provider config schema available for provider["terraform.io/builtin/terraform"]
2023-09-19T14:39:20.357+0100 [DEBUG] created provider logger: level=debug
2023-09-19T14:39:20.357+0100 [INFO]  provider: configuring client automatic mTLS
2023-09-19T14:39:20.374+0100 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/yannh/statuspage/0.1.12/linux_amd64/terraform-provider-statuspage_v0.1.12 args=[.terraform/providers/registry.terraform.io/yannh/statuspage/0.1.12/linux_amd64/terraform-provider-statuspage_v0.1.12]
2023-09-19T14:39:20.375+0100 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/yannh/statuspage/0.1.12/linux_amd64/terraform-provider-statuspage_v0.1.12 pid=201864
2023-09-19T14:39:20.375+0100 [DEBUG] provider: waiting for RPC address: path=.terraform/providers/registry.terraform.io/yannh/statuspage/0.1.12/linux_amd64/terraform-provider-statuspage_v0.1.12
2023-09-19T14:39:20.379+0100 [INFO]  provider.terraform-provider-statuspage_v0.1.12: configuring server automatic mTLS: timestamp=2023-09-19T14:39:20.379+0100
2023-09-19T14:39:20.387+0100 [DEBUG] provider: using plugin: version=5
2023-09-19T14:39:20.387+0100 [DEBUG] provider.terraform-provider-statuspage_v0.1.12: plugin address: network=unix address=/tmp/plugin1003262048 timestamp=2023-09-19T14:39:20.387+0100
2023-09-19T14:39:20.403+0100 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2023-09-19T14:39:20.404+0100 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/yannh/statuspage/0.1.12/linux_amd64/terraform-provider-statuspage_v0.1.12 pid=201864
2023-09-19T14:39:20.404+0100 [DEBUG] provider: plugin exited
2023-09-19T14:39:20.404+0100 [DEBUG] ReferenceTransformer: "statuspage_metric.staging_pr_checks_success_rate (expand)" references: [statuspage_metrics_provider.staging_datadog (expand) local.staging_page_id (expand)]
2023-09-19T14:39:20.405+0100 [DEBUG] ReferenceTransformer: "statuspage_metric.staging_platform_api_latency_prod16 (expand)" references: [local.staging_page_id (expand) statuspage_metrics_provider.staging_datadog (expand)]
2023-09-19T14:39:20.405+0100 [DEBUG] ReferenceTransformer: "statuspage_metric.staging_platform_api_success_rate_prod16 (expand)" references: [local.staging_page_id (expand) statuspage_metrics_provider.staging_datadog (expand)]
2023-09-19T14:39:20.405+0100 [DEBUG] ReferenceTransformer: "statuspage_metric.staging_platform_api_success_rate (expand)" references: [statuspage_metrics_provider.staging_datadog (expand) local.staging_page_id (expand)]
2023-09-19T14:39:20.405+0100 [DEBUG] ReferenceTransformer: "data.terraform_remote_state.datadog-infra-tokens (expand)" references: []
2023-09-19T14:39:20.405+0100 [DEBUG] ReferenceTransformer: "provider[\"registry.terraform.io/yannh/statuspage\"]" references: []
2023-09-19T14:39:20.405+0100 [DEBUG] ReferenceTransformer: "provider[\"terraform.io/builtin/terraform\"]" references: []
2023-09-19T14:39:20.405+0100 [DEBUG] ReferenceTransformer: "statuspage_metrics_provider.staging_self (expand)" references: [local.staging_page_id (expand)]
2023-09-19T14:39:20.405+0100 [DEBUG] ReferenceTransformer: "statuspage_metric.staging_open_source_test_success_rate_prod16 (expand)" references: [statuspage_metrics_provider.staging_datadog (expand) local.staging_page_id (expand)]
2023-09-19T14:39:20.405+0100 [DEBUG] ReferenceTransformer: "statuspage_component.staging_example (expand)" references: [local.staging_page_id (expand)]
2023-09-19T14:39:20.405+0100 [DEBUG] ReferenceTransformer: "statuspage_metrics_provider.staging_datadog (expand)" references: [data.terraform_remote_state.datadog-infra-tokens (expand) local.staging_page_id (expand) data.terraform_remote_state.datadog-infra-tokens (expand)]
2023-09-19T14:39:20.405+0100 [DEBUG] ReferenceTransformer: "local.staging_page_id (expand)" references: []
2023-09-19T14:39:20.405+0100 [DEBUG] Starting graph walk: walkImport
2023-09-19T14:39:20.405+0100 [DEBUG] created provider logger: level=debug
2023-09-19T14:39:20.406+0100 [INFO]  provider: configuring client automatic mTLS
2023-09-19T14:39:20.412+0100 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/yannh/statuspage/0.1.12/linux_amd64/terraform-provider-statuspage_v0.1.12 args=[.terraform/providers/registry.terraform.io/yannh/statuspage/0.1.12/linux_amd64/terraform-provider-statuspage_v0.1.12]
2023-09-19T14:39:20.412+0100 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/yannh/statuspage/0.1.12/linux_amd64/terraform-provider-statuspage_v0.1.12 pid=201878
2023-09-19T14:39:20.412+0100 [DEBUG] provider: waiting for RPC address: path=.terraform/providers/registry.terraform.io/yannh/statuspage/0.1.12/linux_amd64/terraform-provider-statuspage_v0.1.12
2023-09-19T14:39:20.416+0100 [INFO]  provider.terraform-provider-statuspage_v0.1.12: configuring server automatic mTLS: timestamp=2023-09-19T14:39:20.416+0100
2023-09-19T14:39:20.423+0100 [DEBUG] provider: using plugin: version=5
2023-09-19T14:39:20.423+0100 [DEBUG] provider.terraform-provider-statuspage_v0.1.12: plugin address: address=/tmp/plugin4214676830 network=unix timestamp=2023-09-19T14:39:20.423+0100
2023-09-19T14:39:20.434+0100 [DEBUG] ReferenceTransformer: "data.terraform_remote_state.datadog-infra-tokens" references: []
2023-09-19T14:39:20.435+0100 [DEBUG] Initializing remote state backend: remote
2023-09-19T14:39:20.435+0100 [DEBUG] Initializing remote state backend: remote
2023-09-19T14:39:20.435+0100 [DEBUG] Retrieve version constraints for service tfe.v2.1 and product terraform
2023-09-19T14:39:20.438+0100 [WARN]  ValidateProviderConfig from "provider[\"registry.terraform.io/yannh/statuspage\"]" changed the config value, but that value is unused
2023-09-19T14:39:20.439+0100 [INFO]  ReferenceTransformer: reference not found: "local.staging_page_id"
2023-09-19T14:39:20.439+0100 [DEBUG] ReferenceTransformer: "statuspage_component.staging_example" references: []
2023-09-19T14:39:20.439+0100 [INFO]  ReferenceTransformer: reference not found: "local.staging_page_id"
2023-09-19T14:39:20.439+0100 [DEBUG] ReferenceTransformer: "statuspage_metrics_provider.staging_self" references: []
2023-09-19T14:39:21.735+0100 [INFO]  ReferenceTransformer: reference not found: "local.staging_page_id"
2023-09-19T14:39:21.735+0100 [DEBUG] ReferenceTransformer: "statuspage_metrics_provider.staging_datadog" references: []
2023-09-19T14:39:21.738+0100 [DEBUG] Resource instance state not found for node "statuspage_metric.staging_platform_api_latency_prod16", instance statuspage_metric.staging_platform_api_latency_prod16
2023-09-19T14:39:21.738+0100 [INFO]  ReferenceTransformer: reference not found: "local.staging_page_id"
2023-09-19T14:39:21.738+0100 [DEBUG] ReferenceTransformer: "statuspage_metric.staging_platform_api_latency_prod16" references: []
2023-09-19T14:39:21.738+0100 [DEBUG] Resource instance state not found for node "statuspage_metric.staging_open_source_test_success_rate_prod16", instance statuspage_metric.staging_open_source_test_success_rate_prod16
2023-09-19T14:39:21.738+0100 [INFO]  ReferenceTransformer: reference not found: "local.staging_page_id"
2023-09-19T14:39:21.738+0100 [DEBUG] ReferenceTransformer: "statuspage_metric.staging_open_source_test_success_rate_prod16" references: []
2023-09-19T14:39:21.738+0100 [DEBUG] ReferenceTransformer: "statuspage_metric.staging_platform_api_success_rate (import id \"m219lkb9w9m5/0vnm97s93bty\")" references: []
2023-09-19T14:39:21.739+0100 [DEBUG] Resource instance state not found for node "statuspage_metric.staging_platform_api_success_rate_prod16", instance statuspage_metric.staging_platform_api_success_rate_prod16
2023-09-19T14:39:21.739+0100 [INFO]  ReferenceTransformer: reference not found: "local.staging_page_id"
2023-09-19T14:39:21.739+0100 [DEBUG] ReferenceTransformer: "statuspage_metric.staging_platform_api_success_rate_prod16" references: []
2023-09-19T14:39:21.739+0100 [DEBUG] Resource instance state not found for node "statuspage_metric.staging_pr_checks_success_rate", instance statuspage_metric.staging_pr_checks_success_rate
2023-09-19T14:39:21.739+0100 [INFO]  ReferenceTransformer: reference not found: "local.staging_page_id"
2023-09-19T14:39:21.739+0100 [DEBUG] ReferenceTransformer: "statuspage_metric.staging_pr_checks_success_rate" references: []
2023-09-19T14:39:21.740+0100 [INFO]  provider.terraform-provider-statuspage_v0.1.12: 2023/09/19 14:39:21 [INFO] Importing Metric 0vnm97s93bty from Page m219lkb9w9m5: timestamp=2023-09-19T14:39:21.740+0100
2023-09-19T14:39:22.757+0100 [INFO]  provider.terraform-provider-statuspage_v0.1.12: 2023/09/19 14:39:22 [INFO] Statuspage read metric: 0vnm97s93bty: timestamp=2023-09-19T14:39:22.757+0100
2023-09-19T14:39:22.761+0100 [DEBUG] provider.terraform-provider-statuspage_v0.1.12: panic: runtime error: invalid memory address or nil pointer dereference
2023-09-19T14:39:22.761+0100 [DEBUG] provider.terraform-provider-statuspage_v0.1.12: [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xa55355]
2023-09-19T14:39:22.761+0100 [DEBUG] provider.terraform-provider-statuspage_v0.1.12: 
2023-09-19T14:39:22.761+0100 [DEBUG] provider.terraform-provider-statuspage_v0.1.12: goroutine 21 [running]:
2023-09-19T14:39:22.761+0100 [DEBUG] provider.terraform-provider-statuspage_v0.1.12: github.com/yannh/terraform-provider-statuspage/statuspage.resourceMetricRead(0xc000018680, {0xaec960, 0xc000098420})
2023-09-19T14:39:22.761+0100 [DEBUG] provider.terraform-provider-statuspage_v0.1.12: 	github.com/yannh/terraform-provider-statuspage/statuspage/resource_metric.go:78 +0x435
2023-09-19T14:39:22.761+0100 [DEBUG] provider.terraform-provider-statuspage_v0.1.12: github.com/yannh/terraform-provider-statuspage/statuspage.resourceMetricImport(0xc000018680, {0xaec960, 0xc000098420})
2023-09-19T14:39:22.761+0100 [DEBUG] provider.terraform-provider-statuspage_v0.1.12: 	github.com/yannh/terraform-provider-statuspage/statuspage/resource_metric.go:149 +0x499
2023-09-19T14:39:22.761+0100 [DEBUG] provider.terraform-provider-statuspage_v0.1.12: github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Provider).ImportState(0xc00009a960, {0xcafae0, 0xc000343140}, 0xc000685780, {0xc0004280a0, 0x19})
2023-09-19T14:39:22.761+0100 [DEBUG] provider.terraform-provider-statuspage_v0.1.12: 	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/provider.go:387 +0x1ce
2023-09-19T14:39:22.761+0100 [DEBUG] provider.terraform-provider-statuspage_v0.1.12: github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ImportResourceState(0xc00000d878, {0xcafa38, 0xc0002c66c0}, 0xc00041a460)
2023-09-19T14:39:22.761+0100 [DEBUG] provider.terraform-provider-statuspage_v0.1.12: 	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:1088 +0x105
2023-09-19T14:39:22.761+0100 [DEBUG] provider.terraform-provider-statuspage_v0.1.12: github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ImportResourceState(0xc0000f4aa0, {0xcafae0, 0xc0000a4510}, 0xc0002ec0a0)
2023-09-19T14:39:22.761+0100 [DEBUG] provider.terraform-provider-statuspage_v0.1.12: 	github.com/hashicorp/[email protected]/tfprotov5/tf5server/server.go:841 +0x254
2023-09-19T14:39:22.761+0100 [DEBUG] provider.terraform-provider-statuspage_v0.1.12: github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ImportResourceState_Handler({0xb840c0, 0xc0000f4aa0}, {0xcafae0, 0xc0000a4510}, 0xc000476120, 0x0)
2023-09-19T14:39:22.761+0100 [DEBUG] provider.terraform-provider-statuspage_v0.1.12: 	github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:403 +0x170
2023-09-19T14:39:22.761+0100 [DEBUG] provider.terraform-provider-statuspage_v0.1.12: google.golang.org/grpc.(*Server).processUnaryRPC(0xc0000c0700, {0xcbcae8, 0xc000410680}, 0xc000708900, 0xc0003e6ae0, 0x1174b38, 0x0)
2023-09-19T14:39:22.761+0100 [DEBUG] provider.terraform-provider-statuspage_v0.1.12: 	google.golang.org/[email protected]/server.go:1283 +0xcf2
2023-09-19T14:39:22.761+0100 [DEBUG] provider.terraform-provider-statuspage_v0.1.12: google.golang.org/grpc.(*Server).handleStream(0xc0000c0700, {0xcbcae8, 0xc000410680}, 0xc000708900, 0x0)
2023-09-19T14:39:22.761+0100 [DEBUG] provider.terraform-provider-statuspage_v0.1.12: 	google.golang.org/[email protected]/server.go:1620 +0xa2a
2023-09-19T14:39:22.761+0100 [DEBUG] provider.terraform-provider-statuspage_v0.1.12: google.golang.org/grpc.(*Server).serveStreams.func1.2()
2023-09-19T14:39:22.761+0100 [DEBUG] provider.terraform-provider-statuspage_v0.1.12: 	google.golang.org/[email protected]/server.go:922 +0x98
2023-09-19T14:39:22.761+0100 [DEBUG] provider.terraform-provider-statuspage_v0.1.12: created by google.golang.org/grpc.(*Server).serveStreams.func1
2023-09-19T14:39:22.761+0100 [DEBUG] provider.terraform-provider-statuspage_v0.1.12: 	google.golang.org/[email protected]/server.go:920 +0x294
2023-09-19T14:39:22.762+0100 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2023-09-19T14:39:22.762+0100 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/yannh/statuspage/0.1.12/linux_amd64/terraform-provider-statuspage_v0.1.12 pid=201878 error="exit status 2"
2023-09-19T14:39:22.762+0100 [ERROR] plugin.(*GRPCProvider).ImportResourceState: error="rpc error: code = Unavailable desc = error reading from server: EOF"
2023-09-19T14:39:22.762+0100 [ERROR] vertex "statuspage_metric.staging_platform_api_success_rate (import id \"m219lkb9w9m5/0vnm97s93bty\")" error: Plugin did not respond
2023-09-19T14:39:22.762+0100 [ERROR] vertex "statuspage_metric.staging_platform_api_success_rate (expand)" error: Plugin did not respond
╷
│ Error: Plugin did not respond
│ 
│ The plugin encountered an error, and failed to respond to the
│ plugin.(*GRPCProvider).ImportResourceState call. The plugin logs may contain more details.
╵

Support for Apple Silicon

Would it be possible to support Apple Silicon (darwin_arm64) for the Provider? This would be awesome!

Creating new Datadog metric is not working

Hi Yannh,

I am trying to create a new metric using datadog provider and using the below code but with the same query I can create the metric from status page UI.
resource "statuspage_metric" "datadog_metric" {
page_id = ""
metrics_provider_id = "${statuspage_metrics_provider.datadog.id}"
name = ""
metric_identifier = "avg:aws.applicationelb.target_response_time.average{aws_account:bitbucket,targetgroup:targetgroup/bitbucket-tg-prod/xxxx}"
suffix = "ms"
transform = "average"
y_axis_max = 100
y_axis_min = 0
y_axis_hidden = true
display = false
decimal_places = 0
tooltip_description = "Test"
}
Getting the following error:
Error: failed creating resource, request returned 500, full response: &{Status:500 Internal Server Error StatusCode:500 Proto:HTTP/2.0 ProtoMajor:2 ProtoMinor:0 Header:map[Atl-Traceid:[a773583cc4ffea4b] Cache-Control:[no-cache] Content-Type:[application/json] Date:[Wed, 08 Mar 2023 14:03:44 GMT] Expect-Ct:[report-uri="https://web-security-reports.services.atlassian.com/expect-ct-report/status-page-web-api", max-age=86400] 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.663737] X-Xss-Protection:[1; mode=block]] Body:0x140006c7740 ContentLength:-1 TransferEncoding:[] Close:false Uncompressed:true Trailer:map[] Request:0x140005e2500 TLS:0x140006d8160}

Disable History

Hi there!

On Statuspage for a component we can enable or disable the history. Is this also possible with this provider? I think not since there is no Paramenter for this as far as I can see.

This is how it is called in Statuspage:

Display the historical status of this component on my status page

Couldn't find this history flag in the Statuspage API neither: https://developer.statuspage.io/#tag/components

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.