-
Notifications
You must be signed in to change notification settings - Fork 229
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
Synthetic Monitoring Probe and Check Resources and Data Sources #228
Conversation
Precheck for acceptance tests for cloud resources. This allows us to fail fast if GRAFANA_SM_ACCESS_TOKEN is unset.
Duplicate value check w/ incorrect value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! One thing though: examples/resources/grafana_synthetic_monitoring_probe/basic.tf
and examples/resources/grafana_synthetic_monitoring_probe/complex.tf
look very similar, and neither actually looks complex. Is this because we require to have both?
Would it be possible to have the probe resource return the api token for the probe on creation? That would let us store it in vault or anywhere else to automatically provision the probe end-to-end. I realize that may be hard to do on subsequent reads, but maybe it doesn't need to? |
simple.tf and complex.tf didn't make sense because they are essentially the same. Instead resource.tf and resource_update.tf since the reason there is two is to check that update works properly. The template is also deleted in favor of the tfplugindocs default which will render resource.tf automatically.
Merging blocked due to tests failing. #231 should resolve this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for renaming those tests. Changes LGTM, and #231 is approved, so it's only missing a rebase and it should be good to merge.
Adds resources:
Add data sources:
Testing
A "cloud" build tag was added to the top of the Synthetic Monitoring
_test.go
files (// +build cloud
). Therefore, CI in its current state will not run them. I've created an issue to capture the effort of enabling CI for these tests as a followup: #226.Documentation
Documentation was generated with
go generate
. The resources have custom templates to allow the inclusion of multiple examples. I've created another issue to followup to use subcategories to group cloud resources together in navigation: #227.adapters.go
The addition of this file was inspired by https://github.com/paultyng/terraform-provider-unifi/blob/8601203944690676671871390d938ed5238a7f08/internal/provider/strings.go. It's a collection of functions for converting types. These should be useful for making resources and data sources more succinct.
schema.go
This was inspired by https://github.com/hashicorp/terraform-provider-google/blob/eb82ee95846c03976d7df3fbbb965f0ea8106d2b/google/datasource_helpers.go. These functions allow us to reuse resource schemas for data sources. This is instead of duplicating them. It's intended for general schema utilities like this that we can use throughout the provider.
Closes #198