russellcardullo / terraform-provider-pingdom Goto Github PK
View Code? Open in Web Editor NEWNo longer maintained: Terraform provider to manage pingdom resources
License: MIT License
No longer maintained: Terraform provider to manage pingdom resources
License: MIT License
resource "pingdom_check" "my_website" {
type = "http"
name = "My Website Check"
host = "https://www.example.com"
resolution = 1
sendnotificationwhendown = 2 # alert after 5 mins, with resolution 5*(2-1)
integrationids = [
]
userids = [
pingdom_contact.my.id,
]
}
Error: 400 Bad Request: Invalid parameter value: host
Thanks @russellcardullo and @joshsouza for putting out v1.1.3. Also thanks for putting this project on My workflow got much easier https://registry.terraform.io/. That makes things much easier.
In order to get prepared for the Pingdom API v2.1 sunset I attempted a real quick update from v1.1.2 to v1.1.3. As the release versions suggested I did not expect much more work than increasing the provider version and running terraform init -upgrade
.
I ended up spending much more time, mainly due to the deprecation of the pingdom_user
entity and the redesign of pingdom_contact
. Don't get me wrong: Those changes are highly appreciated! But in order to allow other people plan a bit better it would be great to have a proper indication of the effort needed by bumping up the correct part of the version string according to SemVer.
Thats just a tiny wish for the future...
However, great work!
Error: Invalid resource type
on ../../main.tf line 14, in resource "pingdom_contact" "contacts":
14: resource "pingdom_contact" "contacts" {
The provider provider.pingdom does not support resource type
"pingdom_contact".
Error: Invalid resource type
on ../../main.tf line 14, in resource "pingdom_contact" "contacts":
14: resource "pingdom_contact" "contacts" {
The provider provider.pingdom does not support resource type
"pingdom_contact".
Hello,
First thanks a lot for your work !
I try to switch all of my pingdom into terraform using module. After importing my whole ping sucessfully, I try to add them to check the structure but the url variable is add :
~ resource "pingdom_check" "pingdom_check" {
host = "123.456.789.111"
id = "1111111111"
integrationids = []
name = "TEST IP 123.456.789.111"
notifyagainevery = 0
notifywhenbackup = true
probefilters = "region:EU"
resolution = 1
responsetime_threshold = 30000
sendnotificationwhendown = 6
tags = "tag1,tag2"
teamids = []
type = "ping"
+ url = "/"
userids = [
11411264,
]
}
my entry look like this :
"TEST IP 123.456.789.111"= { host = "123.456.789.111",id = "1111111111",integrationids = [],name = "TEST IP 123.456.789.111",notifyagainevery = "0",notifywhenbackup = "true",probefilters = "region:EU",resolution = "1",responsetime_threshold = "30000",sendnotificationwhendown = "6",tags = "tag1,tag2",type = "ping",userids = [11411264]}
Why url
is add with /
as default value ? I try also with url = null
in my ressource definition but nothing change.
Thanks in advance !
Hi !
We often use this provider and we would like to have new features, like integration and maintenance.
@russellcardullo , you seems to have less time to maintain this provider and the associated go lib.
We looked at https://github.com/nordcloud/terraform-provider-pingdom and it seems that this team is actively maintaining a fork of this provider
Unfortunately, they didn't enable "issues" section, so we can't communicate easily with them.
Could you please, look at their work and encourage them to continue their fork if you can't maintain this provide anymore ?
Anyways, I would like to thank you for your work !
When I try to use it I receive this error:
Error: Unsupported argument
on main.tf line 14, in resource "pingdom_check" "this":
14: responsetime_threshold = 20
An argument named "responsetime_threshold" is not expected here.
I'm using the latest version (1.1.1)
Hi !
First, thanks for your work, we are using your provider quite often.
We would like to use it to handle maintenance windows : https://docs.pingdom.com/api/#tag/Maintenance/paths/~1maintenance~1{id}/put
Could you, please, tell us what is your current roadmap for this provider or if you think that you will not work on this subject ? Maybe we can provide a first work in a PR.
Thanks !
cc: @nlamirault
We often see planned changes which are just the provider re-ordering the tags of our pingdom checks.
e.g. terraform plan will report something like this:
Terraform will perform the following actions:
# pingdom_check.mycheck will be updated in-place
~ resource "pingdom_check" "mycheck" {
encryption = true
host = "my.host"
id = "6564539"
integrationids = []
name = "myhost - healthcheck"
notifyagainevery = 0
notifywhenbackup = true
port = 443
probefilters = "region:EU"
publicreport = true
requestheaders = {}
resolution = 1
sendnotificationwhendown = 6
~ tags = "one,two,three" -> "three,one,two"
teamids = []
type = "http"
url = "/ping"
userids = []
}
Plan: 0 to add, 1 to change, 0 to destroy.
This doesn't do any harm, but it means any scripts we have which check to see if terraform reports that changes have to be made often generate false positives.
We don't always see this. I'm guessing that's because the tag order is arbitrary, and sometimes the order just happens to match the order which exists in the terraform state.
If possible, it would be great if the order of tags could be made deterministic, so that we don't see these null changes reported in terraform plan.
We're using release 1.1.1 of the provider.
Go Modules seems to work well with this project, and has some advantages with smaller repository size and faster dependency resolution.
dep works fine so this isn't a strictly necessary change, but might improve forward compatibility and make it easier for others to contribute.
Firstly, thanks for the hard work on the library. We use it and your Go API.
It would be nice to have the ipv6 option available when creating/updating a check. https://docs.pingdom.com/api/#tag/Checks/paths/~1checks/post
Ref API issue: russellcardullo/go-pingdom#69
I can work on this if you like.
We were surprised that setting sendnotificationwhendown
did not seem to have an affect on http checks when used with webhook integrations.
After opening a support ticket with pingdom, we received the following reply:
The webhooks do not follow the alert delay by default (they where implemented to be a separate alerting system originally).
The good news is that we have a feature that allows them to follow the alert delays ... You won't be able to see this setting as it's currently hidden from the interface
The support team was able to manually enable this setting on our account.
Proposal: Add to the README or other documentation that if sendnotificationwhendown
is used with a webhook integration, Pingdom support must be contacted to enable that functionality.
Any chance this still works? Given new pingdom changes and terraform 0.11.X?
Hi,
Is there any support for manage "PageSpeed" checks?
If not, do you know about the API endpoint needed to develop the feature? I'm willing to contribute if is there an API endpoint to use.
Thanks!
Hello, and thanks for good work on this plugin.
In version 1.1.3 we could not create contact with only email notification because it always failed with:
You must provide both a high and low severity notification method
similar issue was reported and fix here:
#82
Can I ask you to release new version with this fix?
Best regard.
Hi @russellcardullo! First let me thank you for all the work done here!
Would you consider doing release? It seems the last one was 4 years ago.
I'm getting the following error:
Error asking for user input: 1 error(s) occurred:
* provider.pingdom: dial unix /var/folders/s_/8r27qhtn6b34y1ykmb3jz7r00000gq/T/plugin064193899|netrpc: connect: no such file or directory
I'm new to go so maybe missing something but I've tried installing a few different ways. README doesn't mention how to deal with need libraries from terraform.
I did find I was able to install terraform-provider-pingdom and its dependencies in 1 command via:
$ go get -v github.com/russellcardullo/terraform-provider-pingdom
github.com/russellcardullo/terraform-provider-pingdom (download)
github.com/hashicorp/terraform (download)
github.com/mitchellh/mapstructure (download)
github.com/russellcardullo/go-pingdom (download)
github.com/hashicorp/terraform/vendor/github.com/hashicorp/go-hclog
github.com/hashicorp/terraform/vendor/github.com/mitchellh/go-testing-interface
github.com/hashicorp/terraform/vendor/github.com/golang/protobuf/proto
github.com/hashicorp/terraform/vendor/golang.org/x/net/context
github.com/hashicorp/terraform/vendor/golang.org/x/net/http2/hpack
github.com/hashicorp/terraform/vendor/golang.org/x/net/idna
github.com/hashicorp/terraform/vendor/github.com/hashicorp/yamux
github.com/hashicorp/terraform/vendor/golang.org/x/net/internal/timeseries
github.com/hashicorp/terraform/vendor/google.golang.org/grpc/codes
github.com/hashicorp/terraform/vendor/google.golang.org/grpc/grpclog
github.com/hashicorp/terraform/vendor/google.golang.org/grpc/credentials
github.com/hashicorp/terraform/vendor/golang.org/x/net/lex/httplex
github.com/hashicorp/terraform/vendor/google.golang.org/grpc/internal
github.com/hashicorp/terraform/vendor/golang.org/x/net/trace
github.com/hashicorp/terraform/vendor/google.golang.org/grpc/keepalive
github.com/hashicorp/terraform/vendor/google.golang.org/grpc/metadata
github.com/hashicorp/terraform/vendor/google.golang.org/grpc/stats
github.com/hashicorp/terraform/vendor/google.golang.org/grpc/connectivity
github.com/hashicorp/terraform/vendor/golang.org/x/net/http2
github.com/hashicorp/terraform/vendor/google.golang.org/grpc/naming
github.com/hashicorp/terraform/vendor/google.golang.org/grpc/tap
github.com/hashicorp/terraform/vendor/google.golang.org/grpc/peer
github.com/hashicorp/terraform/vendor/github.com/hashicorp/go-cleanhttp
github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/aws/awserr
github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/internal/shareddefaults
github.com/hashicorp/terraform/vendor/github.com/go-ini/ini
github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/aws/client/metadata
github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/aws/endpoints
github.com/hashicorp/terraform/vendor/github.com/jmespath/go-jmespath
github.com/hashicorp/terraform/vendor/github.com/bgentry/go-netrc/netrc
github.com/hashicorp/terraform/vendor/github.com/hashicorp/go-getter/helper/url
github.com/hashicorp/terraform/vendor/github.com/hashicorp/go-version
github.com/hashicorp/terraform/vendor/github.com/mitchellh/go-homedir
github.com/hashicorp/terraform/vendor/github.com/ulikunitz/xz/internal/xlog
github.com/hashicorp/terraform/vendor/github.com/ulikunitz/xz/internal/hash
github.com/hashicorp/terraform/vendor/github.com/hashicorp/errwrap
github.com/hashicorp/terraform/vendor/github.com/ulikunitz/xz/lzma
github.com/hashicorp/terraform/vendor/github.com/hashicorp/go-multierror
github.com/hashicorp/terraform/vendor/github.com/armon/go-radix
github.com/hashicorp/terraform/vendor/github.com/bgentry/speakeasy
github.com/hashicorp/terraform/vendor/github.com/mattn/go-isatty
github.com/hashicorp/terraform/vendor/github.com/posener/complete/cmd/install
github.com/hashicorp/terraform/vendor/github.com/posener/complete/match
github.com/hashicorp/terraform/vendor/golang.org/x/crypto/openpgp/errors
github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/aws/credentials
github.com/hashicorp/terraform/vendor/github.com/posener/complete/cmd
github.com/hashicorp/terraform/vendor/golang.org/x/crypto/openpgp/armor
github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/aws/awsutil
github.com/hashicorp/terraform/vendor/github.com/posener/complete
github.com/hashicorp/terraform/vendor/golang.org/x/crypto/cast5
github.com/hashicorp/terraform/vendor/golang.org/x/crypto/openpgp/elgamal
github.com/hashicorp/terraform/vendor/golang.org/x/crypto/openpgp/s2k
github.com/hashicorp/terraform/vendor/golang.org/x/net/html/atom
github.com/hashicorp/terraform/vendor/github.com/hashicorp/hcl/hcl/strconv
github.com/hashicorp/terraform/vendor/github.com/mitchellh/cli
github.com/hashicorp/terraform/vendor/golang.org/x/net/html
github.com/hashicorp/terraform/vendor/golang.org/x/crypto/openpgp/packet
github.com/hashicorp/terraform/vendor/github.com/hashicorp/hcl/hcl/token
github.com/hashicorp/terraform/vendor/github.com/hashicorp/hcl/hcl/ast
github.com/hashicorp/terraform/vendor/github.com/hashicorp/hcl/hcl/scanner
github.com/hashicorp/terraform/vendor/github.com/ulikunitz/xz
github.com/hashicorp/terraform/vendor/github.com/hashicorp/hcl/hcl/parser
github.com/hashicorp/terraform/vendor/github.com/hashicorp/hcl/json/token
github.com/hashicorp/terraform/vendor/google.golang.org/grpc/grpclb/grpc_lb_v1
github.com/hashicorp/terraform/vendor/github.com/golang/protobuf/ptypes/any
github.com/hashicorp/terraform/vendor/github.com/golang/protobuf/ptypes/duration
github.com/hashicorp/terraform/vendor/github.com/golang/protobuf/ptypes/timestamp
github.com/hashicorp/terraform/vendor/google.golang.org/genproto/googleapis/rpc/status
github.com/hashicorp/terraform/vendor/github.com/hashicorp/hcl/json/scanner
github.com/hashicorp/terraform/vendor/github.com/golang/protobuf/ptypes
github.com/hashicorp/terraform/vendor/github.com/hashicorp/hil/ast
github.com/hashicorp/terraform/vendor/github.com/hashicorp/hcl/json/parser
github.com/hashicorp/terraform/vendor/google.golang.org/grpc/status
github.com/hashicorp/terraform/vendor/github.com/mitchellh/mapstructure
github.com/hashicorp/terraform/vendor/github.com/mitchellh/reflectwalk
github.com/hashicorp/terraform/vendor/github.com/hashicorp/hcl
github.com/hashicorp/terraform/vendor/github.com/hashicorp/hil/scanner
github.com/hashicorp/terraform/vendor/github.com/apparentlymart/go-cidr/cidr
github.com/hashicorp/terraform/vendor/github.com/hashicorp/hil/parser
github.com/hashicorp/terraform/vendor/github.com/blang/semver
github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/aws
github.com/hashicorp/terraform/vendor/github.com/hashicorp/go-uuid
github.com/hashicorp/terraform/vendor/github.com/mitchellh/copystructure
github.com/hashicorp/terraform/helper/hilmapstructure
github.com/hashicorp/terraform/vendor/github.com/hashicorp/hil
github.com/hashicorp/terraform/vendor/github.com/mitchellh/hashstructure
github.com/hashicorp/terraform/vendor/golang.org/x/crypto/blowfish
github.com/hashicorp/terraform/dag
github.com/hashicorp/terraform/vendor/github.com/satori/go.uuid
github.com/hashicorp/terraform/helper/hashcode
github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/aws/request
github.com/mitchellh/mapstructure
github.com/hashicorp/terraform/vendor/golang.org/x/crypto/bcrypt
github.com/russellcardullo/go-pingdom/pingdom
github.com/hashicorp/terraform/vendor/golang.org/x/crypto/openpgp
github.com/hashicorp/terraform/flatmap
github.com/hashicorp/terraform/vendor/google.golang.org/grpc/transport
github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/aws/client
github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/aws/corehandlers
github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/private/protocol/rest
github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/private/protocol
github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/private/protocol/query/queryutil
github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil
github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata
github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/aws/credentials/endpointcreds
github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/aws/signer/v4
github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/private/protocol/query
github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds
github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml
github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/aws/defaults
github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/service/sts
github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/service/s3
github.com/hashicorp/terraform/vendor/google.golang.org/grpc
github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds
github.com/hashicorp/terraform/vendor/github.com/aws/aws-sdk-go/aws/session
github.com/hashicorp/terraform/vendor/google.golang.org/grpc/health/grpc_health_v1
github.com/hashicorp/terraform/vendor/google.golang.org/grpc/health
github.com/hashicorp/terraform/vendor/github.com/hashicorp/go-plugin
github.com/hashicorp/terraform/vendor/github.com/hashicorp/go-getter
github.com/hashicorp/terraform/plugin/discovery
github.com/hashicorp/terraform/config
github.com/hashicorp/terraform/moduledeps
github.com/hashicorp/terraform/config/module
github.com/hashicorp/terraform/terraform
github.com/hashicorp/terraform/helper/schema
github.com/hashicorp/terraform/plugin
github.com/russellcardullo/terraform-provider-pingdom/pingdom
github.com/russellcardullo/terraform-provider-pingdom
I've tried a few different versions of terraform 0.9.x, 0.10.x Currently:
$ tf -v
Terraform v0.9.8
$ go version
go version go1.9 darwin/amd64
Any advice would be great, I'm currently on a Mac
README states that "member_ids" can be in pingdom_check, but apparently it is outdated and it should be "userids" instead.
The Team object could have additional references to the User objects for maintaining team memberships. As far as I could tell from the API, we only need to synchronize the user's IDs to make this work.
Every time I run "terraform plan" I am told the teamids field is changing from 0 to 1.
teamids.#: "0" => "1"
teamids.1479235611: "" => "123456"
Here's how I am specifying a team ID.
teamids = [
"${var.team_id}",
]
Terraform Core Version
1.3.2
Pngdom-provider Version
1.1.3
Affected Resource(s)
pingdom_contact
Expected Behavior
When running apply, it would need to create the contacts pingdom_contact with both LOW and HIGH severity.
Actual Behavior
When running plan, it shows that it will create a contact with both LOW and HIGH severity but in the apply, it triggers an error complaining about that.
Relevant Error/Panic Output Snippet
pingdom_contact.second_contact: Creating...
╷
│ Error: You must provide both a high and low severity notification method
│
│ with pingdom_contact.second_contact,
│ on main.tf line 26, in resource "pingdom_contact" "second_contact":
│ 26: resource "pingdom_contact" "second_contact" {
│
╵
Steps to Reproduce
Copy the example code:
resource "pingdom_contact" "second_contact" {
name = "janedoe"
paused = true
email_notification {
address = "[email protected]"
severity = "LOW"
}
email_notification {
address = "[email protected]"
severity = "HIGH"
}
}
Run teraform apply tf apply --target=pingdom_contact.second_contact
Would you like to implement a fix?
I would like to implement a fix, but I will wait for interactions and then see if it makes sense to contribute.
from pingdom UI, we can set a custom message when manually creating a check, i can seem to find info on how to do the same with this provider. is it possible?
The pingdom check api supports setting verify_certificate
and ssl_down_days_before
in order to configure SSL certificate checking:
https://docs.pingdom.com/api/#tag/Checks/paths/~1checks/post
Feature request is to make these options available in this terraform provider in order to be able to configure SSL checking abilities of Pingdom.
I am trying to add custom_message key vaue pair, the apply runs successful, but can't see the customized Message updated in pingdom check UI
Hi Team,
I am using Apple MACBook Pro M1 chip. When I am trying to Initializ provider plugins for pingdom I am getting bellow errror.
Error: Incompatible provider version
│
│ Provider registry.terraform.io/russellcardullo/pingdom v1.1.3 does not have a
│ package available for your current platform, darwin_arm64.
│
Please let me know how I can fix this error?
Thanks,
Sachin
https://help.pingdom.com/hc/en-us/articles/203910642
Would love to be able to do a multi-transaction check that gets an auth token first, then uses the auth token to perform an authenticated/authorized check.
I would consider using it. Terraform folk have been pondering adding one. See discussion/issue hashicorp/terraform#1844
Cheers,
O
I have data "pingdom_contact" "pagerduty" with the correct name and I see that it finds a proper contact in the terraform debug logs, but in the end, the actual id in the state is different (the last element of contacts list)
This commit in Terraform introduces id
as a reserved field.
When building terraform-provider-pingdom
against the Terraform code base including this commit then we end up with a plugin that generates the following error at runtime:
* module.foo.provider.pingdom: Internal validation of the provider failed! This is always a bug
with the provider itself, and not a user issue. Please report
this bug:
1 error(s) occurred:
* resource pingdom_check: id is a reserved field name for a resource
It's possible to workaround this by reseting back to a commit before this.
Hi!
This issue is similar to #6. Since terraform 0.12 there's a new plugin version, which causes this error: Error: Failed to instantiate provider "pingdom" to obtain schema: Incompatible API version with plugin. Plugin version: 4, Client versions: [5]
Any thoughts how to fix it or is there any code involved to fix it?
Thank you!
Hi there, just trying to setup pingdom with terraform via the examples, and am getting an 403: invalid application key error.
I'm using a multi-user account and have generated an API key from Integrations -> The Pingdom API with read write access, but I'm thrown the error.
Note: The api_key works when I use curl with it, so I suspect the api_key isn't the invalid one
i.e
curl -X GET https://api.pingdom.com/api/3.1/checks -H 'Authorization:Bearer <api_key>'
variable "pingdom_user" {}
variable "pingdom_password" {}
variable "pingdom_api_key" {}
variable "pingdom_account_email" {} # Optional: only required for multi-user accounts
provider "pingdom" {
user = "${var.pingdom_user}"
password = "${var.pingdom_password}"
api_key = "${var.pingdom_api_key}"
account_email = "${var.pingdom_account_email}" # Optional: only required for multi-user accounts
}
resource "pingdom_check" "example" {
type = "http"
name = "my http check"
host = "example.com"
resolution = 5
}
The url
attribute is optional without a default, but the Pingdom API has a default of /
. If you don't configure the attribute for an HTTP check then Terraform will report the following change on every run:
pingdom_check.paas_http_healthcheck: Modifying...
url: "/" => ""
pingdom_check.paas_http_healthcheck: Modifications complete
Apply complete! Resources: 0 added, 1 changed, 0 destroyed.
Do you think it would be safe to set Default: true
since url
is only used if check == "http"
?
Hello @russellcardullo,
just started using Pingdom at $dayJob
and would love to use your plugin to have checks generated through Terraform.
The installation works (though I had to use go get
instead of go install
to actually get the provider / plugin) but a terraform plan
fails with the following:
Error configuring: 1 error(s) occurred:
* Incompatible API version with plugin. Plugin version: 3, Ours: 2
I attempted to verify this by running a number of different ways of installing the plugin, but all end in the same error message.
Any pointers into what I could do to make this work?
After merging api 3.1 there are apis for managing transaction monitoring checks.
That looks like a grate feature
Considering the following contact:
resource "pingdom_contact" "foo_bar" {
name = "Foo Barr"
email_notification {
address = "[email protected]"
severity = "LOW"
}
sms_notification {
number = "791111111"
country_code = "41"
provider = "nexmo"
severity = "HIGH"
}
}
This user cannot be created:
...
pingdom_contact.foo_bar: Creating...
Error: You must provide both a high and low severity notification method
...
provider "pingdom" {
pingdom_api_token = var.pingdom_api_token
}
Error: Unsupported argument
on terraform-providers.tf line 2, in provider "pingdom":
2: pingdom_api_token = var.pingdom_api_token
An argument named "pingdom_api_token" is not expected here.
According to the documentation, this is the correct way to specify the pingdom api token.
Currently using version 1.1.3 of the provider.
Resources of type pingdom_contact
cannot be imported via terraform import
.
I have hacked together some sort of pindom2terraform converter script which allows to reproduce the issue quite easily:
package main
import (
"bytes"
"fmt"
"os"
"strings"
"text/template"
"github.com/gosimple/slug"
"github.com/russellcardullo/go-pingdom/pingdom"
)
func renderUsers(users []pingdom.UsersResponse) ([]byte, error) {
var b bytes.Buffer
var templ = `{{ range $user := . }}
######################################
# {{ $user.Username }}
######################################
# terraform import pingdom_user.{{ slug $user.Username }} {{ $user.Id }}
resource "pingdom_user" "{{ slug $user.Username }}" {
username = "{{ $user.Username }}"
}
{{ range $contact := $user.Sms -}}
# terraform import pingdom_contact.{{ slug $user.Username}}_{{ slug $contact.Number}}-{{ slug $contact.Severity}} {{ $contact.Id}}
resource "pingdom_contact" "{{ slug $user.Username}}_{{ slug $contact.Number}}-{{ slug $contact.Severity}}" {
user_id = pingdom_user.{{ slug $user.Username }}.id
number = "{{$contact.Number}}"
country_code = "{{$contact.CountryCode}}"
phone_provider = "{{$contact.Provider}}"
severity_level = "{{$contact.Severity}}"
}
{{ end }}
{{- range $contact := $user.Email}}
# terraform import pingdom_contact.{{ slug $user.Username}}_{{ slug $contact.Address}}-{{ slug $contact.Severity}} {{ $contact.Id}}
resource "pingdom_contact" "{{ slug $user.Username}}_{{ slug $contact.Address}}-{{ slug $contact.Severity}}" {
user_id = pingdom_user.{{ slug $user.Username }}.id
email = "{{$contact.Address}}"
severity_level = "{{$contact.Severity}}"
}
{{ end -}}
{{ end -}}
`
t, err := template.New("template").Funcs(GetTemplateFuncMap()).Parse(templ)
if err != nil {
return b.Bytes(), err
}
err = t.Execute(&b, users)
return b.Bytes(), err
}
func main() {
client, err := pingdom.NewClientWithConfig(pingdom.ClientConfig{
User: os.Getenv("PINGDOM_USER"),
Password: os.Getenv("PINGDOM_PASS"),
APIKey: os.Getenv("PINGDOM_APP"),
})
if err != nil {
fmt.Println(err)
os.Exit(1)
}
users, err := client.Users.List()
if err != nil {
fmt.Println(err)
os.Exit(1)
}
out, err := renderUsers(users)
if err != nil {
fmt.Println(err)
os.Exit(1)
}
fmt.Println(string(out))
}
func GetTemplateFuncMap() template.FuncMap {
funcMap := template.FuncMap{
"slug": slug.Make,
"unspace": func(in string) string {
return strings.ReplaceAll(in, " ", "")
},
"join": func(in []string, joiner string) string {
return strings.Join(in, joiner)
},
}
return funcMap
}
This prints a the terraform resources for pingdom_user
and pingdom_contact
to stdout. It also prints an import statement per resource. This does not work as expected (nothing is imported). Error is:
# terraform import pingdom_contact.xxx [contact ID according to the api]
pingdom_contact.xxx: Importing from ID "[ID]"...
pingdom_contact.xxx: Import prepared!
Prepared pingdom_contact for import
pingdom_contact.xxx: Refreshing state... [id=[ID]]
Error: Error retrieving id for resource: strconv.Atoi: parsing "": invalid syntax
Pingdom released their v3.1 api in September of 2019, which has fewer features at the moment, but uses a different authentication method (tokens vs. username/password/key).
To update this provider to use the 3.1 api also requires an update to the go client go-pingdom
, so I've got a fork at https://github.com/grnhse/go-pingdom with the changes until the main repo is ready for 3.1.
My fork with the changes necessary for 3.1 support is here: https://github.com/grnhse/terraform-provider-pingdom/tree/api-v3.1
Not putting in a PR, as I think it makes sense to wait for the go-client to have a proper revision that supports v3 than to use my forked version, but hopefully this can help in the process up updating things to use the new API.
Hello ,
First, thanks a lot for the provider !
I'm using this provider as a module I don't know if it's change something. But I've noticed that I can add or update tags on ressources created by this provider.
Here my code :
# In the source here is the code
"test"= { host = "1.2.3.4",integrationids = [],name = "test",notifyagainevery = "0",notifywhenbackup = "true",probefilters = "region:EU",resolution = "1",responsetime_threshold = "30000",sendnotificationwhendown = "6",paused = false ,tags = "test",type = "ping",userids = []}
# and in the module I use it as :
resource "pingdom_check" "pingdom_check" {
...
tags = var.tags
...
}
and tag variable is declare as string.
Each time I do terraform plan
it show me that changes but when I do terraform apply
the tages are not created in pingdom UI and they are still visible if I make a terraform plan
again.
Do you have an idea ? Is there someting I make wrong ?
Thanks a lot in advance !
When applying a state with about 20 pingdom checks at once the following Error Message is displayed:
Error: Provider produced inconsistent result after apply
When applying changes to module.subdomain.pingdom_check.url[0], provider
"registry.terraform.io/-/pingdom" produced an unexpected new value for was
present, but now absent.
This is a bug in the provider, which should be reported in the provider's own
issue tracker.
our terraform code looks like this:
resource "pingdom_check" "url" {
count = var.enable_pingdom ? 1 : 0
type = "http"
name = "subdomain.domain.tld - environment"
host = "subdomain.domain.tld"
url = "/url"
shouldcontain = "verificationstr"
tags = "environment,terraform"
encryption = true
resolution = 5
sendnotificationwhendown = 2
userids = var.pingdom_users
}
terraform version: 0.12.19
Because resourcePingdomCheckRead
does not set the "type"
attribute for checks, checks are imported with an empty "type"
in the terraform state file. Since "type"
is both Required
and (correctly) specified with ForceNew: true
in the resource schema, this forces a delete+create operation once the user properly specifies the "type"
attribute in their resource file.
Steps to recreate:
terraform plan
.Is it possible to update private variables as sensitive here?
This will help in the Terraform Enterprise integration because when these values are Sensitive
they will be hidden as (sensitive)
in the logs - which is highly desired.
Please refer to how the official terraform module for the MongoDB Atlas Database User resource has implemented.
Hey, more and more developers are moving to Apple M1 (ARM64). Unfortunately, the provider does not support it.
│ Error: Incompatible provider version
│
│ Provider registry.terraform.io/russellcardullo/pingdom v1.1.3 does not have
│ a package available for your current platform, darwin_arm64.
│
│ Provider releases are separate from Terraform CLI releases, so not all
│ providers are available for all platforms. Other versions of this provider
│ may have different platforms supported.
When I'm trying to apply following
resource "pingdom_check" "example_ping" {
type = "ping"
name = "aaaaaa"
host = "8.8.8.8"
resolution = 1
}
I'm getting this
* pingdom_check.example_ping: 400 Bad Request: Invalid parameter value: sendnotificationwhendown
what does not make sense since sendnotificationwhendown is not mandatory, bad anyways when I fix that, so I have this
resource "pingdom_check" "example_ping" {
type = "ping"
name = "aaaaaa"
host = "8.8.8.8"
resolution = 1
sendnotificationwhendown = 1
}
API throws an 500 error
2019/01/17 13:02:48 [ERROR] root: eval: *terraform.EvalApplyPost, err: 1 error(s) occurred:
* pingdom_check.example_ping: 500 Internal Server Error: Internal Server Error
2019/01/17 13:02:48 [ERROR] root: eval: *terraform.EvalSequence, err: 1 error(s) occurred:
* pingdom_check.example_ping: 500 Internal Server Error: Internal Server Error
Error: Error applying plan:
1 error(s) occurred:
* pingdom_check.example_ping: 1 error(s) occurred:
* pingdom_check.example_ping: 500 Internal Server Error: Internal Server Error
THO I'm able to create a ping check with API using curl, so it's related to the provider for sure.
Will appreciate any help
"Who to alert?" section on the pingdom website allows you to select "Owner" type profiles as well as "Contact" type profiles, but adding the userid of an "Owner" type profile results in an error.
@russellcardullo can you push a new release for the provider?
#82 and #88 need to be resolved by pushing the fix included in #81 as it's now a blocker for being able to progress in any meaningful way with the provider.
Pingdom uptime checks support defining a "Test from" location.
Right now, for my account, this list is:
I notice this is not supported by go-pingdom
at this point, so I believe it would need to be added there, first.
Hi, could you please provide a new version and publish it to the Terraform registry.
So we could use it like that :
terraform {
required_providers {
updown = {
source = "russellcardullo/pingdom"
version = "x.y.z"
}
}
}
There is some others providers : https://registry.terraform.io/search/providers?q=pingdom
But not yours. Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.