From 66fc7df30036bccca1bf4d82b42644acdd39f147 Mon Sep 17 00:00:00 2001 From: jeremyh Date: Tue, 20 Jul 2021 12:17:03 -0700 Subject: [PATCH] move to splunk organization --- GNUmakefile | 37 + README.md | 29 + docs/data-sources/check.md | 344 +++++++++ docs/index.md | 21 + docs/resources/create_browser_check.md | 300 ++++++++ docs/resources/create_http_check.md | 202 +++++ examples/main.tf | 173 +++++ go.mod | 8 + go.sum | 601 +++++++++++++++ main.go | 15 + synthetics/data_source_check.go | 888 ++++++++++++++++++++++ synthetics/provider.go | 46 ++ synthetics/provider_test.go | 34 + synthetics/resource_browser_check.go | 821 ++++++++++++++++++++ synthetics/resource_browser_check_test.go | 97 +++ synthetics/resource_http_check.go | 511 +++++++++++++ synthetics/resource_http_check_test.go | 105 +++ synthetics/structures.go | 515 +++++++++++++ 18 files changed, 4747 insertions(+) create mode 100644 GNUmakefile create mode 100644 README.md create mode 100644 docs/data-sources/check.md create mode 100644 docs/index.md create mode 100644 docs/resources/create_browser_check.md create mode 100644 docs/resources/create_http_check.md create mode 100644 examples/main.tf create mode 100644 go.mod create mode 100644 go.sum create mode 100644 main.go create mode 100644 synthetics/data_source_check.go create mode 100644 synthetics/provider.go create mode 100644 synthetics/provider_test.go create mode 100644 synthetics/resource_browser_check.go create mode 100644 synthetics/resource_browser_check_test.go create mode 100644 synthetics/resource_http_check.go create mode 100644 synthetics/resource_http_check_test.go create mode 100644 synthetics/structures.go diff --git a/GNUmakefile b/GNUmakefile new file mode 100644 index 0000000..0757070 --- /dev/null +++ b/GNUmakefile @@ -0,0 +1,37 @@ +TEST?=$$(go list ./... | grep -v 'vendor') +HOSTNAME=splunk.com +NAMESPACE=edu +NAME=synthetics +BINARY=terraform-provider-${NAME} +VERSION=0.0.1 +OS_ARCH=darwin_amd64 + +default: install + +build: + go build -o ${BINARY} + +release: + GOOS=darwin GOARCH=amd64 go build -o ./bin/${BINARY}_${VERSION}_darwin_amd64 + GOOS=freebsd GOARCH=386 go build -o ./bin/${BINARY}_${VERSION}_freebsd_386 + GOOS=freebsd GOARCH=amd64 go build -o ./bin/${BINARY}_${VERSION}_freebsd_amd64 + GOOS=freebsd GOARCH=arm go build -o ./bin/${BINARY}_${VERSION}_freebsd_arm + GOOS=linux GOARCH=386 go build -o ./bin/${BINARY}_${VERSION}_linux_386 + GOOS=linux GOARCH=amd64 go build -o ./bin/${BINARY}_${VERSION}_linux_amd64 + GOOS=linux GOARCH=arm go build -o ./bin/${BINARY}_${VERSION}_linux_arm + GOOS=openbsd GOARCH=386 go build -o ./bin/${BINARY}_${VERSION}_openbsd_386 + GOOS=openbsd GOARCH=amd64 go build -o ./bin/${BINARY}_${VERSION}_openbsd_amd64 + GOOS=solaris GOARCH=amd64 go build -o ./bin/${BINARY}_${VERSION}_solaris_amd64 + GOOS=windows GOARCH=386 go build -o ./bin/${BINARY}_${VERSION}_windows_386 + GOOS=windows GOARCH=amd64 go build -o ./bin/${BINARY}_${VERSION}_windows_amd64 + +install: build + mkdir -p ~/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH} + mv ${BINARY} ~/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH} + +test: + go test -i $(TEST) || exit 1 + echo $(TEST) | xargs -t -n4 go test $(TESTARGS) -timeout=30s -parallel=4 + +testacc: + TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 120m \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..8035e3d --- /dev/null +++ b/README.md @@ -0,0 +1,29 @@ +# Splunk Synthetics Terraform Provider + +**Until this description is changed this is not a complete provider. Currently it may not even work. Proceed at your own risk.** + +This repository is an **alpha* Terraform provider for [Splunk Synthetics (formerly Rigor™)](https://monitoring.rigor.com/). It currently contains CRUD operations for HTTP (Uptime) Checks and Real Browser Checks with some caveats: + + - Currently Real Browser Checks cannot have `steps` or `javascript_files` added via Public API and thus are not included in this provider. + - Integrations are not managed by this provider and must be setup in the UI and referenced with their ID number. + - Private Locations are not managed by this provider and must be setup in the UI and referenced with their ID number. + - Excluding custom files is currently not supported. All preset file exclusions are included and working. + +This repo and the companion [Synthetics Golang client](https://github.com/splunk/syntheticsclient) are not DRY and are specifically verbose for code auditing and teaching reasons. + +**NOTE:** The client expects a valid Synthetics API token defined as an environment variable named `API_ACCESS_TOKEN` (E.G. `export API_ACCESS_TOKEN="This_is_my_api_token"`) + +## Installation + +Currently this provider is in testing and is not published to the Terraform Provider Registry. + +To install this provider locally follow the directions for installing [In-House Providers](https://www.terraform.io/docs/cloud/run/install-software.html#in-house-providers). + +## Examples + +see ./examples/ for current examples of HTTP and Browser Checks + +## Requirements + +- [Terraform](https://www.terraform.io/downloads.html) >= 0.13.x +- [Go](https://golang.org/doc/install) >= 1.15 \ No newline at end of file diff --git a/docs/data-sources/check.md b/docs/data-sources/check.md new file mode 100644 index 0000000..0984b20 --- /dev/null +++ b/docs/data-sources/check.md @@ -0,0 +1,344 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "synthetics_check Data Source - terraform-provider-synthetics" +subcategory: "" +description: |- + +--- + +# synthetics_check (Data Source) + +## Example +``` +data "synthetics_check" "datasource_check" { + id = 123456 +} + +output "datasource_check" { + value = data.synthetics_check.datasource_check +} +``` + + + +## Schema + +### Required + +- **id** (Number) The ID of this resource. + +### Optional + +- **browser** (Block Set) (see [below for nested schema](#nestedblock--browser)) +- **check_connection** (Block Set) (see [below for nested schema](#nestedblock--check_connection)) +- **cookies** (Block Set) (see [below for nested schema](#nestedblock--cookies)) +- **created_at** (String) +- **dns_overrides** (Block Set) (see [below for nested schema](#nestedblock--dns_overrides)) +- **excluded_files** (Block Set) (see [below for nested schema](#nestedblock--excluded_files)) +- **frequency** (Number) +- **javascript_files** (Block Set) (see [below for nested schema](#nestedblock--javascript_files)) +- **links** (Block Set) (see [below for nested schema](#nestedblock--links)) +- **muted** (Boolean) +- **paused** (Boolean) +- **response_time_monitor_milliseconds** (Number) +- **steps** (Block Set) (see [below for nested schema](#nestedblock--steps)) +- **threshold_monitors** (Block Set) (see [below for nested schema](#nestedblock--threshold_monitors)) +- **type** (String) +- **updated_at** (String) +- **viewport** (Block Set) (see [below for nested schema](#nestedblock--viewport)) + +### Read-Only + +- **auto_retry** (Boolean) +- **blackout_periods** (Set of Object) (see [below for nested schema](#nestedatt--blackout_periods)) +- **enabled** (Boolean) +- **http_method** (String) +- **http_request_body** (String) +- **http_request_headers** (List of Object) (see [below for nested schema](#nestedatt--http_request_headers)) +- **integrations** (Set of Object) (see [below for nested schema](#nestedatt--integrations)) +- **locations** (Set of Object) (see [below for nested schema](#nestedatt--locations)) +- **name** (String) +- **notifications** (Set of Object) (see [below for nested schema](#nestedatt--notifications)) +- **round_robin** (Boolean) +- **status** (Set of Object) (see [below for nested schema](#nestedatt--status)) +- **success_criteria** (Set of Object) (see [below for nested schema](#nestedatt--success_criteria)) +- **tags** (Set of Object) (see [below for nested schema](#nestedatt--tags)) +- **url** (String) + + +### Nested Schema for `browser` + +Optional: + +- **type** (String) + + + +### Nested Schema for `check_connection` + +Optional: + +- **download_bandwidth** (Number) +- **latency** (Number) +- **packet_loss** (Number) +- **upload_bandwidth** (Number) + + + +### Nested Schema for `cookies` + +Optional: + +- **domain** (String) +- **key** (String) +- **path** (String) +- **value** (String) + + + +### Nested Schema for `dns_overrides` + +Optional: + +- **original_domain** (String) +- **original_host** (String) + + + +### Nested Schema for `excluded_files` + +Optional: + +- **exclusion_type** (String) +- **pattern** (String) +- **preset_name** (String) + + + +### Nested Schema for `javascript_files` + +Optional: + +- **id** (Number) The ID of this resource. +- **name** (String) + + + +### Nested Schema for `links` + +Optional: + +- **last_run** (String) +- **metrics** (String) +- **self** (String) +- **self_html** (String) + + + +### Nested Schema for `steps` + +Optional: + +- **how** (String) +- **item_method** (String) +- **name** (String) +- **position** (Number) +- **value** (String) +- **variable_name** (String) +- **what** (String) + + + +### Nested Schema for `threshold_monitors` + +Optional: + +- **comparison_type** (String) +- **matcher** (String) +- **metric_name** (String) +- **value** (Number) + + + +### Nested Schema for `viewport` + +Optional: + +- **height** (Number) +- **width** (Number) + + + +### Nested Schema for `blackout_periods` + +Read-Only: + +- **created_at** (String) +- **duration_in_minutes** (Number) +- **end_date** (String) +- **end_time** (String) +- **is_repeat** (Boolean) +- **monthly_repeat_type** (String) +- **repeat_type** (String) +- **start_date** (String) +- **start_time** (String) +- **timezone** (String) +- **updated_at** (String) + + + +### Nested Schema for `http_request_headers` + +Read-Only: + +- **user_agent** (String) + + + +### Nested Schema for `integrations` + +Read-Only: + +- **id** (Number) +- **name** (String) + + + +### Nested Schema for `locations` + +Read-Only: + +- **id** (Number) +- **name** (String) +- **region_code** (String) +- **world_region** (String) + + + +### Nested Schema for `notifications` + +Read-Only: + +- **call** (Boolean) +- **email** (Boolean) +- **escalations** (Set of Object) (see [below for nested schema](#nestedobjatt--notifications--escalations)) +- **muted** (Boolean) +- **notification_windows** (Set of Object) (see [below for nested schema](#nestedobjatt--notifications--notification_windows)) +- **notify_after_failure_count** (Number) +- **notify_on_location_failure** (Boolean) +- **notify_who** (Set of Object) (see [below for nested schema](#nestedobjatt--notifications--notify_who)) +- **sms** (Boolean) + + +### Nested Schema for `notifications.escalations` + +Read-Only: + +- **after_minutes** (Number) +- **call** (Boolean) +- **email** (Boolean) +- **is_repeat** (Boolean) +- **notification_window** (Set of Object) (see [below for nested schema](#nestedobjatt--notifications--escalations--notification_window)) +- **notify_who** (Set of Object) (see [below for nested schema](#nestedobjatt--notifications--escalations--notify_who)) +- **sms** (Boolean) + + +### Nested Schema for `notifications.escalations.notification_window` + +Read-Only: + +- **duration_in_minutes** (Number) +- **end_time** (String) +- **start_time** (String) +- **time_zone** (String) + + + +### Nested Schema for `notifications.escalations.notify_who` + +Read-Only: + +- **custom_user_email** (String) +- **id** (Number) +- **links** (Set of Object) (see [below for nested schema](#nestedobjatt--notifications--escalations--notify_who--links)) +- **type** (String) + + +### Nested Schema for `notifications.escalations.notify_who.type` + +Read-Only: + +- **self_html** (String) + + + + + +### Nested Schema for `notifications.notification_windows` + +Read-Only: + +- **duration_in_minutes** (Number) +- **end_time** (String) +- **start_time** (String) +- **time_zone** (String) + + + +### Nested Schema for `notifications.notify_who` + +Read-Only: + +- **call** (Boolean) +- **custom_user_email** (String) +- **email** (Boolean) +- **id** (Number) +- **links** (Set of Object) (see [below for nested schema](#nestedobjatt--notifications--notify_who--links)) +- **sms** (Boolean) +- **type** (String) + + +### Nested Schema for `notifications.notify_who.links` + +Read-Only: + +- **self_html** (String) + + + + + +### Nested Schema for `status` + +Read-Only: + +- **has_failure** (Boolean) +- **has_location_failure** (Boolean) +- **last_alert_at** (String) +- **last_code** (Number) +- **last_failure_at** (String) +- **last_message** (String) +- **last_response_time** (Number) +- **last_run_at** (String) + + + +### Nested Schema for `success_criteria` + +Read-Only: + +- **action_type** (String) +- **comparison_string** (String) +- **created_at** (String) +- **updated_at** (String) + + + +### Nested Schema for `tags` + +Read-Only: + +- **id** (Number) +- **name** (String) + + diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..6c31190 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,21 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "synthetics Provider" +subcategory: "" +description: |- + +--- + +# synthetics Provider + + + + + + +## Schema + +### Required + +- **apikey** (String) + - Expects a valid Splunk Synthetics (Rigor) API token as an environment variable named `API_ACCESS_TOKEN` diff --git a/docs/resources/create_browser_check.md b/docs/resources/create_browser_check.md new file mode 100644 index 0000000..f722c43 --- /dev/null +++ b/docs/resources/create_browser_check.md @@ -0,0 +1,300 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "synthetics_create_browser_check Resource - terraform-provider-synthetics" +subcategory: "" +description: |- + +--- + +# synthetics_create_browser_check (Resource) + +## Example +``` +resource "synthetics_create_browser_check" "browser_check" { + name = "check name" + url = "https://www.somewebpageorsomething.com" + type = "real_browser" + frequency = 15 +} +``` + + +## Schema + +### Required + +- **frequency** (Number) +- **name** (String) +- **url** (String) + +### Optional + +- **auto_retry** (Boolean) +- **auto_update_user_agent** (Boolean) +- **browser** (Block Set) (see [below for nested schema](#nestedblock--browser)) +- **check_connection** (Block Set) (see [below for nested schema](#nestedblock--check_connection)) +- **cookies** (Block Set) (see [below for nested schema](#nestedblock--cookies)) +- **dns_overrides** (Block Set) (see [below for nested schema](#nestedblock--dns_overrides)) +- **enabled** (Boolean) +- **enforce_ssl_validation** (Boolean) +- **excluded_files** (Block Set) (see [below for nested schema](#nestedblock--excluded_files)) +- **http_method** (String) +- **http_request_body** (String) +- **id** (String) The ID of this resource. +- **integrations** (List of Number) +- **javascript_files** (Block Set) (see [below for nested schema](#nestedblock--javascript_files)) +- **last_updated** (String) +- **locations** (List of Number) +- **notifications** (Block Set) (see [below for nested schema](#nestedblock--notifications)) +- **round_robin** (Boolean) +- **steps** (Block Set) (see [below for nested schema](#nestedblock--steps)) +- **success_criteria** (Block Set) (see [below for nested schema](#nestedblock--success_criteria)) +- **tags** (List of String) +- **threshold_monitors** (Block Set) (see [below for nested schema](#nestedblock--threshold_monitors)) +- **type** (String) +- **user_agent** (String) +- **viewport** (Block Set) (see [below for nested schema](#nestedblock--viewport)) +- **wait_for_full_metrics** (Boolean) + +### Read-Only + +- **blackout_periods** (Block Set) (see [below for nested schema](#nestedblock--blackout_periods)) +- **http_request_headers** (Block List) (see [below for nested schema](#nestedblock--http_request_headers)) + + +### Nested Schema for `browser` + +Optional: + +- **type** (String) + + + +### Nested Schema for `check_connection` + +Optional: + +- **download_bandwidth** (Number) +- **latency** (Number) +- **packet_loss** (Number) +- **upload_bandwidth** (Number) + + + +### Nested Schema for `cookies` + +Optional: + +- **domain** (String) +- **key** (String) +- **path** (String) +- **value** (String) + + + +### Nested Schema for `dns_overrides` + +Optional: + +- **original_domain** (String) +- **original_host** (String) + + + +### Nested Schema for `excluded_files` +**NOTE:** Currently only preset exclusions are configurable through public API + +Optional: + +- **exclusion_type** (String) +- **pattern** (String) +- **preset_name** (String) + + + +### Nested Schema for `javascript_files` +**NOTE:** Currently not configurable through public API + +Optional: + +- **id** (Number) The ID of this resource. +- **name** (String) + + + +### Nested Schema for `notifications` + +Optional: + +- **call** (Boolean) +- **email** (Boolean) +- **escalations** (Block Set) (see [below for nested schema](#nestedblock--notifications--escalations)) +- **muted** (Boolean) +- **notification_windows** (Block Set) (see [below for nested schema](#nestedblock--notifications--notification_windows)) +- **notify_after_failure_count** (Number) +- **notify_on_location_failure** (Boolean) +- **notify_who** (Block Set) (see [below for nested schema](#nestedblock--notifications--notify_who)) +- **sms** (Boolean) + + +### Nested Schema for `notifications.escalations` + +Optional: + +- **after_minutes** (Number) +- **call** (Boolean) +- **email** (Boolean) +- **notification_window** (Block Set) (see [below for nested schema](#nestedblock--notifications--escalations--notification_window)) +- **notify_who** (Block Set) (see [below for nested schema](#nestedblock--notifications--escalations--notify_who)) +- **sms** (Boolean) + +Read-Only: + +- **is_repeat** (Boolean) + + +### Nested Schema for `notifications.escalations.notification_window` + +Optional: + +- **duration_in_minutes** (Number) +- **end_time** (String) +- **start_time** (String) +- **time_zone** (String) + + + +### Nested Schema for `notifications.escalations.notify_who` + +Optional: + +- **call** (Boolean) +- **custom_user_email** (String) +- **email** (Boolean) +- **id** (Number) The ID of this resource. +- **sms** (Boolean) +- **type** (String) + +Read-Only: + +- **links** (Set of Object) (see [below for nested schema](#nestedatt--notifications--escalations--notify_who--links)) + + +### Nested Schema for `notifications.escalations.notify_who.links` + +Read-Only: + +- **self_html** (String) + + + + + +### Nested Schema for `notifications.notification_windows` + +Optional: + +- **duration_in_minutes** (Number) +- **end_time** (String) +- **start_time** (String) +- **time_zone** (String) + + + +### Nested Schema for `notifications.notify_who` + +Optional: + +- **call** (Boolean) +- **custom_user_email** (String) +- **email** (Boolean) +- **id** (Number) The ID of this resource. +- **sms** (Boolean) +- **type** (String) + +Read-Only: + +- **links** (Set of Object) (see [below for nested schema](#nestedatt--notifications--notify_who--links)) + + +### Nested Schema for `notifications.notify_who.links` + +Read-Only: + +- **self_html** (String) + + + + + +### Nested Schema for `steps` +**NOTE:** Currently not configurable through public API + +Optional: + +- **how** (String) +- **item_method** (String) +- **name** (String) +- **position** (Number) +- **value** (String) +- **variable_name** (String) +- **what** (String) + + + +### Nested Schema for `success_criteria` + +Optional: + +- **action_type** (String) +- **comparison_string** (String) +- **created_at** (String) +- **updated_at** (String) + + + +### Nested Schema for `threshold_monitors` + +Optional: + +- **comparison_type** (String) +- **matcher** (String) +- **metric_name** (String) +- **value** (Number) + + + +### Nested Schema for `viewport` + +Optional: + +- **height** (Number) +- **width** (Number) + + + +### Nested Schema for `blackout_periods` + +Read-Only: + +- **created_at** (String) +- **duration_in_minutes** (Number) +- **end_date** (String) +- **end_time** (String) +- **is_repeat** (Boolean) +- **monthly_repeat_type** (String) +- **repeat_type** (String) +- **start_date** (String) +- **start_time** (String) +- **timezone** (String) +- **updated_at** (String) + + + +### Nested Schema for `http_request_headers` + +Read-Only: + +- **user_agent** (String) + + diff --git a/docs/resources/create_http_check.md b/docs/resources/create_http_check.md new file mode 100644 index 0000000..6f3b448 --- /dev/null +++ b/docs/resources/create_http_check.md @@ -0,0 +1,202 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "synthetics_create_http_check Resource - terraform-provider-synthetics" +subcategory: "" +description: |- + +--- + +# synthetics_create_http_check (Resource) + +## Example +``` +resource "synthetics_create_http_check" "http_check" { + name = "check name" + url = "https://www.somewebpageorsomething.com" + frequency = 15 +} +``` + + +## Schema + +### Required + +- **frequency** (Number) +- **name** (String) +- **url** (String) + +### Optional + +- **auto_retry** (Boolean) +- **check_connection** (Block Set) (see [below for nested schema](#nestedblock--check_connection)) +- **enabled** (Boolean) +- **http_method** (String) +- **http_request_body** (String) +- **id** (String) The ID of this resource. +- **integrations** (List of Number) +- **last_updated** (String) +- **locations** (List of Number) +- **notifications** (Block Set) (see [below for nested schema](#nestedblock--notifications)) +- **round_robin** (Boolean) +- **success_criteria** (Block Set) (see [below for nested schema](#nestedblock--success_criteria)) +- **tags** (List of String) + +### Read-Only + +- **blackout_periods** (Block Set) (see [below for nested schema](#nestedblock--blackout_periods)) +- **http_request_headers** (Block List) (see [below for nested schema](#nestedblock--http_request_headers)) + + +### Nested Schema for `check_connection` + +Optional: + +- **download_bandwidth** (Number) +- **latency** (Number) +- **packet_loss** (Number) +- **upload_bandwidth** (Number) + + + +### Nested Schema for `notifications` + +Optional: + +- **call** (Boolean) +- **email** (Boolean) +- **escalations** (Block Set) (see [below for nested schema](#nestedblock--notifications--escalations)) +- **muted** (Boolean) +- **notification_windows** (Block Set) (see [below for nested schema](#nestedblock--notifications--notification_windows)) +- **notify_after_failure_count** (Number) +- **notify_on_location_failure** (Boolean) +- **notify_who** (Block Set) (see [below for nested schema](#nestedblock--notifications--notify_who)) +- **sms** (Boolean) + + +### Nested Schema for `notifications.escalations` + +Optional: + +- **after_minutes** (Number) +- **call** (Boolean) +- **email** (Boolean) +- **notification_window** (Block Set) (see [below for nested schema](#nestedblock--notifications--escalations--notification_window)) +- **notify_who** (Block Set) (see [below for nested schema](#nestedblock--notifications--escalations--notify_who)) +- **sms** (Boolean) + +Read-Only: + +- **is_repeat** (Boolean) + + +### Nested Schema for `notifications.escalations.notification_window` + +Optional: + +- **duration_in_minutes** (Number) +- **end_time** (String) +- **start_time** (String) +- **time_zone** (String) + + + +### Nested Schema for `notifications.escalations.notify_who` + +Optional: + +- **call** (Boolean) +- **custom_user_email** (String) +- **email** (Boolean) +- **id** (Number) The ID of this resource. +- **sms** (Boolean) +- **type** (String) + +Read-Only: + +- **links** (Set of Object) (see [below for nested schema](#nestedatt--notifications--escalations--notify_who--links)) + + +### Nested Schema for `notifications.escalations.notify_who.links` + +Read-Only: + +- **self_html** (String) + + + + + +### Nested Schema for `notifications.notification_windows` + +Optional: + +- **duration_in_minutes** (Number) +- **end_time** (String) +- **start_time** (String) +- **time_zone** (String) + + + +### Nested Schema for `notifications.notify_who` + +Optional: + +- **call** (Boolean) +- **custom_user_email** (String) +- **email** (Boolean) +- **id** (Number) The ID of this resource. +- **sms** (Boolean) +- **type** (String) + +Read-Only: + +- **links** (Set of Object) (see [below for nested schema](#nestedatt--notifications--notify_who--links)) + + +### Nested Schema for `notifications.notify_who.links` + +Read-Only: + +- **self_html** (String) + + + + + +### Nested Schema for `success_criteria` + +Optional: + +- **action_type** (String) +- **comparison_string** (String) +- **created_at** (String) +- **updated_at** (String) + + + +### Nested Schema for `blackout_periods` + +Read-Only: + +- **created_at** (String) +- **duration_in_minutes** (Number) +- **end_date** (String) +- **end_time** (String) +- **is_repeat** (Boolean) +- **monthly_repeat_type** (String) +- **repeat_type** (String) +- **start_date** (String) +- **start_time** (String) +- **timezone** (String) +- **updated_at** (String) + + + +### Nested Schema for `http_request_headers` + +Read-Only: + +- **user_agent** (String) + + diff --git a/examples/main.tf b/examples/main.tf new file mode 100644 index 0000000..43a78ce --- /dev/null +++ b/examples/main.tf @@ -0,0 +1,173 @@ +terraform { + required_providers { + synthetics = { + version = "0.0.1" + source = "splunk.com/edu/synthetics" + } + } +} + +provider "synthetics" {} + +//Pull a Check as a datasource +/* +data "synthetics_check" "datasource_check" { + id = 123456 +} + +output "datasource_check" { + value = data.synthetics_check.datasource_check +} +*/ + + + +//Create an HTTP Check +resource "synthetics_create_http_check" "http_check" { + name = "Uptime Checkaroo" + frequency = 15 + url = "https://www.google.com" + success_criteria { + action_type = "presence_of_text" + comparison_string = "Images" + } + success_criteria { + action_type = "presence_of_text" + comparison_string = "About" + } + check_connection { + download_bandwidth = 20010 + upload_bandwidth = 5010 + latency = 23 + packet_loss = 0.1 + } + tags = ["beep","boiiiiip","haaaai"] + locations = [1,2,158,48,22] + round_robin = false + integrations = [80,82] + auto_retry = true + enabled = false + http_method = "GET" + notifications { + sms = true + email = false + call = true + notify_after_failure_count = 10 + notify_on_location_failure = false + muted = true + notify_who { + sms = false + email = true + custom_user_email = "aperson@splunk.com" + call = false + } + notify_who { + type = "user" + id = 18100 + sms = true + email = true + } + escalations { + sms = true + email = true + call = false + after_minutes = 30 + notify_who { + type = "user" + id = 18100 + } + } + } +} + +output "http_check" { + value = synthetics_create_http_check.http_check +} + + + +// Create a Browser Check † +// †: steps and javascript_files currently not available through public API endpoints +resource "synthetics_create_browser_check" "browser_check" { + name = "BROWSERMANIA" + frequency = 15 + type = "real_browser" + url = "https://www.google.com" + viewport { + width = 800 + height = 600 + } + check_connection { + download_bandwidth = 0 + upload_bandwidth = 0 + latency = 0 + packet_loss = 0 + } + tags = ["beelp","boiiiiip","haaaai"] + locations = [6] + integrations = [80,71] + cookies { + key = "beep" + value = "boop" + domain = "google.com" + path = "/" + } + cookies { + key = "bam" + value = "botch" + domain = "google.com" + path = "/" + } + dns_overrides { + original_domain = "new.domain.com" + original_host = "123.123.123.123" + } + threshold_monitors { + matcher = "*.google.com" + metric_name = "first_byte_time_ms" + comparison_type = "less_than" + value = 9999 + } + excluded_files { + pattern = ".+\\.clicktale\\.net" + preset_name = "clicktale" + exclusion_type = "preset" + } + round_robin = false + auto_retry = true + enabled = false + notifications { + sms = true + email = false + call = true + notify_after_failure_count = 10 + notify_on_location_failure = false + muted = true + notify_who { + sms = false + email = true + custom_user_email = "aperson@splunk.com" + call = false + } + notify_who { + type = "user" + id = 18100 + sms = true + email = true + } + escalations { + sms = true + email = true + call = false + after_minutes = 30 + notify_who { + type = "user" + id = 18100 + } + } + } +} + +output "browser_check" { + value = synthetics_create_browser_check.browser_check +} diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..642395f --- /dev/null +++ b/go.mod @@ -0,0 +1,8 @@ +module github.com/greatestusername-splunk/terraform-provider-synthetics + +go 1.15 + +require ( + github.com/hashicorp/terraform-plugin-sdk/v2 v2.7.0 + github.com/splunk/syntheticsclient v0.2.1 +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..fea91ce --- /dev/null +++ b/go.sum @@ -0,0 +1,601 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.61.0 h1:NLQf5e1OMspfNT1RAHOB3ublr1TW3YTXO8OiWwVjK2U= +cloud.google.com/go v0.61.0/go.mod h1:XukKJg4Y7QsUu0Hxg3qQKUWR4VuWivmyMK2+rUyxAqw= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0 h1:STgFzyU5/8miMl0//zKh2aQeTyeaUH3WN9bSUiJ09bA= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= +github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= +github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= +github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= +github.com/Microsoft/go-winio v0.4.16 h1:FtSW/jqD+l4ba5iPBj9CODVtgfYAD8w2wS923g/cFDk= +github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= +github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7 h1:YoJbenK9C67SkzkDfmQuVln04ygHj3vjZfd9FL+GmQQ= +github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7/go.mod h1:z4/9nQmJSSwwds7ejkxaJwO37dru3geImFUdJlaLzQo= +github.com/acomagu/bufpipe v1.0.3 h1:fxAGrHZTgQ9w5QqVItgzwj235/uYZYgbXitB+dLupOk= +github.com/acomagu/bufpipe v1.0.3/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4= +github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= +github.com/agext/levenshtein v1.2.2 h1:0S/Yg6LYmFJ5stwQeRp6EeOcCbj7xiqQSdNelsXvaqE= +github.com/agext/levenshtein v1.2.2/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= +github.com/andybalholm/crlf v0.0.0-20171020200849-670099aa064f/go.mod h1:k8feO4+kXDxro6ErPXBRTJ/ro2mf0SsFG8s7doP9kJE= +github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 h1:kFOfPq6dUM1hTo4JG6LR5AXSUEsOjtdm0kw0FtQtMJA= +github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= +github.com/apparentlymart/go-cidr v1.0.1/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/YjEn/vI25Lg7Gwc= +github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= +github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0 h1:MzVXffFUye+ZcSR6opIgz9Co7WcDx6ZcY+RjfFHoA0I= +github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= +github.com/apparentlymart/go-textseg v1.0.0 h1:rRmlIsPEEhUTIKQb7T++Nz/A5Q6C9IuX2wFoYVvnCs0= +github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= +github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= +github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw= +github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= +github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= +github.com/aws/aws-sdk-go v1.15.78/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3ATZkfNZeM= +github.com/aws/aws-sdk-go v1.25.3 h1:uM16hIw9BotjZKMZlX05SN2EFtaWfi/NonPKIARiBLQ= +github.com/aws/aws-sdk-go v1.25.3/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= +github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= +github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg= +github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568 h1:BHsljHzVlRcyQhjrss6TZTdY2VfCqZPbv5k3iBFa2ZQ= +github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= +github.com/gliderlabs/ssh v0.2.2 h1:6zsha5zo/TWhRhwqCD3+EarCAgZ2yN28ipRnGPnwkI0= +github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= +github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4= +github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= +github.com/go-git/go-billy/v5 v5.2.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= +github.com/go-git/go-billy/v5 v5.3.1 h1:CPiOUAzKtMRvolEKw+bG1PLRpT7D3LIs3/3ey4Aiu34= +github.com/go-git/go-billy/v5 v5.3.1/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= +github.com/go-git/go-git-fixtures/v4 v4.2.1 h1:n9gGL1Ct/yIw+nfsfr8s4+sbhT+Ncu2SubfXjIWgci8= +github.com/go-git/go-git-fixtures/v4 v4.2.1/go.mod h1:K8zd3kDUAykwTdDCr+I0per6Y6vMiRR/nnVTBtavnB0= +github.com/go-git/go-git/v5 v5.4.2 h1:BXyZu9t0VkbiHtqrsvdq39UDhGJTl1h55VW6CSC4aY4= +github.com/go-git/go-git/v5 v5.4.2/go.mod h1:gQ1kArt6d+n+BGd+/B/I74HwRTLhth2+zti4ihgckDc= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= +github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0 h1:pMen7vLs8nvgEYhywH3KDWJIJTeEr2ULsVWHWYHQyBs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-checkpoint v0.5.0 h1:MFYpPZCnQqQTE18jFwSII6eUQrD/oxMFp3mlgcqk5mU= +github.com/hashicorp/go-checkpoint v0.5.0/go.mod h1:7nfLNL10NsxqO4iWuW6tWW0HjZuDrwkBuEQsVcpCOgg= +github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= +github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= +github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 h1:1/D3zfFHttUKaCaGKZ/dR2roBXv0vKbSCnssIldfQdI= +github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320/go.mod h1:EiZBMaudVLy8fmjf9Npq1dq9RalhveqZG5w/yz3mHWs= +github.com/hashicorp/go-getter v1.5.3 h1:NF5+zOlQegim+w/EUhSLh6QhXHmZMEeHLQzllkQ3ROU= +github.com/hashicorp/go-getter v1.5.3/go.mod h1:BrrV/1clo8cCYu6mxvboYg+KutTiFnXjMEgDD8+i7ZI= +github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= +github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-hclog v0.15.0 h1:qMuK0wxsoW4D0ddCCYwPSTm4KQv1X1ke3WmPWZ0Mvsk= +github.com/hashicorp/go-hclog v0.15.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o= +github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-plugin v1.3.0/go.mod h1:F9eH4LrE/ZsRdbwhfjs9k9HoDUwAHnYtXdgmf1AVNs0= +github.com/hashicorp/go-plugin v1.4.1 h1:6UltRQlLN9iZO513VveELp5xyaFxVD2+1OVylE+2E+w= +github.com/hashicorp/go-plugin v1.4.1/go.mod h1:5fGEH17QVwTTcR0zV7yhDPLLmFX9YSZ38b18Udy6vYQ= +github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= +github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I= +github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-version v1.3.0 h1:McDWVJIU/y+u1BRV06dPaLfLCaT7fUTJLp5r04x7iNw= +github.com/hashicorp/go-version v1.3.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/hcl/v2 v2.3.0 h1:iRly8YaMwTBAKhn1Ybk7VSdzbnopghktCD031P8ggUE= +github.com/hashicorp/hcl/v2 v2.3.0/go.mod h1:d+FwDBbOLvpAM3Z6J7gPj/VoAGkNe/gm352ZhjJ/Zv8= +github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= +github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/terraform-exec v0.14.0 h1:UQoUcxKTZZXhyyK68Cwn4mApT4mnFPmEXPiqaHL9r+w= +github.com/hashicorp/terraform-exec v0.14.0/go.mod h1:qrAASDq28KZiMPDnQ02sFS9udcqEkRly002EA2izXTA= +github.com/hashicorp/terraform-json v0.12.0 h1:8czPgEEWWPROStjkWPUnTQDXmpmZPlkQAwYYLETaTvw= +github.com/hashicorp/terraform-json v0.12.0/go.mod h1:pmbq9o4EuL43db5+0ogX10Yofv1nozM+wskr/bGFJpI= +github.com/hashicorp/terraform-plugin-go v0.3.0 h1:AJqYzP52JFYl9NABRI7smXI1pNjgR5Q/y2WyVJ/BOZA= +github.com/hashicorp/terraform-plugin-go v0.3.0/go.mod h1:dFHsQMaTLpON2gWhVWT96fvtlc/MF1vSy3OdMhWBzdM= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.7.0 h1:SuI59MqNjYDrL7EfqHX9V6P/24isgqYx/FdglwVs9bg= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.7.0/go.mod h1:grseeRo9g3yNkYW09iFlV8LG78jTa1ssBgouogQg/RU= +github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= +github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d h1:kJCB4vdITiW1eC1vq2e6IsrXKrZit1bv/TDYFGMp4BQ= +github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= +github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= +github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= +github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= +github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= +github.com/jhump/protoreflect v1.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZZoE= +github.com/jhump/protoreflect v1.6.0/go.mod h1:eaTn3RZAmMBcV0fifFvlm6VHNz3wSkYyXYWUh7ymB74= +github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM= +github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1 h1:6QPYqodiu3GuPL+7mfx+NwDdp2eTkp9IfEUpgAwUN0o= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 h1:DowS9hvgyYSX4TO5NpyC606/Z4SxnNYbT+WX27or6Ck= +github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.11.2 h1:MiK62aErc3gIiVEtyzKfeOHgW7atJb5g/KNX5m3c2nQ= +github.com/klauspost/compress v1.11.2/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/matryer/is v1.2.0 h1:92UTHpy8CDwaJ08GqLDzhhuixiBUUD1p3AU6PHddz4A= +github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.10 h1:qxFzApOv4WsAL965uUPIsXzAKCZxN2p9UqdhFS4ZW10= +github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= +github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mitchellh/cli v1.1.2/go.mod h1:6iaV0fGdElS6dPBx0EApTxHrcWvmJphyh2n8YBLPPZ4= +github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= +github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= +github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= +github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/go-testing-interface v1.0.4 h1:ZU1VNC02qyufSZsjjs7+khruk2fKvbQ3TwRV/IBCeFA= +github.com/mitchellh/go-testing-interface v1.0.4/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= +github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4= +github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= +github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= +github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/nsf/jsondiff v0.0.0-20200515183724-f29ed568f4ce h1:RPclfga2SEJmgMmz2k+Mg7cowZ8yv4Trqw9UsJby758= +github.com/nsf/jsondiff v0.0.0-20200515183724-f29ed568f4ce/go.mod h1:uFMI8w+ref4v2r9jz+c9i1IfIttS/OkmLfrk1jne5hs= +github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= +github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= +github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/sebdah/goldie v1.0.0/go.mod h1:jXP4hmWywNEwZzhMuv2ccnqTSFpuq8iyQhtQdkkZBH4= +github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= +github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= +github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= +github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= +github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/splunk/syntheticsclient v0.2.1 h1:eIfofpJPcLzkyHg7OX7Rd4N0+OFolH77hw8mf6NThHA= +github.com/splunk/syntheticsclient v0.2.1/go.mod h1:riH4plM9ySr2lHnWi2E4cocaP9qqlRQHKX6nisiyq6E= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/ulikunitz/xz v0.5.8 h1:ERv8V6GKqVi23rgu5cj9pVfVzJbOqAY2Ntl88O6c2nQ= +github.com/ulikunitz/xz v0.5.8/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= +github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= +github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaUXK79GlxNBwueZn0xI= +github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= +github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4= +github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= +github.com/xanzy/ssh-agent v0.3.0 h1:wUMzuKtKilRgBAD1sUb8gOwwRr2FGoBVumcjoOACClI= +github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= +github.com/zclconf/go-cty v1.2.1/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= +github.com/zclconf/go-cty v1.8.4 h1:pwhhz5P+Fjxse7S7UriBrMu6AUJSZM5pKqGem1PjGAs= +github.com/zclconf/go-cty v1.8.4/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= +github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4 h1:LYy1Hy3MJdrCdMwwzxA/dRok4ejH+RwNGbuoD9fCjto= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b h1:7mWr3k41Qtv8XlltBkDkl8LoP3mpSgBW8BUoxtEdbXg= +golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20180530234432-1e491301e022/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210326060303-6b1517762897 h1:KrsHThm5nFk34YtATK1LsThyGhGbGe1olrte/HInHvs= +golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210502180810-71e4cd670f79 h1:RX8C8PRZc2hTIod4ds8ij+/4RQX3AqhYj3uOHmyaz4E= +golang.org/x/sys v0.0.0-20210502180810-71e4cd670f79/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200713011307-fd294ab11aed h1:+qzWo37K31KxduIYaBeMqJ8MUOyTayOQKpH9aDPLMSY= +golang.org/x/tools v0.0.0-20200713011307-fd294ab11aed/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0 h1:BaiDisFir8O4IJxvAabCGGkQ6yCJegNQqSVoYUNAnbk= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20170818010345-ee236bd376b0/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200711021454-869866162049 h1:YFTFpQhgvrLrmxtiIncJxFXeCyq84ixuKWVCaCAi9Oc= +google.golang.org/genproto v0.0.0-20200711021454-869866162049/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.32.0 h1:zWTV+LMdc3kaiJMSTOFz2UgSBgx8RNQoTGiZu3fR9S0= +google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= +gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/main.go b/main.go new file mode 100644 index 0000000..4fcfc3b --- /dev/null +++ b/main.go @@ -0,0 +1,15 @@ +package main + +import ( + "github.com/greatestusername-splunk/terraform-provider-synthetics/synthetics" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/plugin" +) + +func main() { + plugin.Serve(&plugin.ServeOpts{ + ProviderFunc: func() *schema.Provider { + return synthetics.Provider() + }, + }) +} diff --git a/synthetics/data_source_check.go b/synthetics/data_source_check.go new file mode 100644 index 0000000..2962b73 --- /dev/null +++ b/synthetics/data_source_check.go @@ -0,0 +1,888 @@ +package synthetics + +import ( + "context" + "fmt" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + sc "github.com/splunk/syntheticsclient/syntheticsclient" +) + +func dataSourceCheck() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceChecksRead, + Schema: map[string]*schema.Schema{ + "id": { + Type: schema.TypeInt, + Required: true, + }, + "name": { + Type: schema.TypeString, + Computed: true, + }, + "type": { + Type: schema.TypeString, + Computed: true, + Optional: true, + }, + "frequency": { + Type: schema.TypeInt, + Computed: true, + Optional: true, + }, + "paused": { + Type: schema.TypeBool, + Computed: true, + Optional: true, + }, + "muted": { + Type: schema.TypeBool, + Computed: true, + Optional: true, + }, + "created_at": { + Type: schema.TypeString, + Computed: true, + Optional: true, + }, + "updated_at": { + Type: schema.TypeString, + Computed: true, + Optional: true, + }, + "links": { + Type: schema.TypeSet, + Computed: true, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "self": { + Type: schema.TypeString, + Computed: true, + Optional: true, + }, + "self_html": { + Type: schema.TypeString, + Computed: true, + Optional: true, + }, + "metrics": { + Type: schema.TypeString, + Computed: true, + Optional: true, + }, + "last_run": { + Type: schema.TypeString, + Computed: true, + Optional: true, + }, + }, + }, + }, + "status": { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "last_code": { + Type: schema.TypeInt, + Computed: true, + Optional: true, + }, + "last_message": { + Type: schema.TypeString, + Computed: true, + Optional: true, + }, + "last_response_time": { + Type: schema.TypeInt, + Computed: true, + Optional: true, + }, + "last_run_at": { + Type: schema.TypeString, + Computed: true, + Optional: true, + }, + "last_failure_at": { + Type: schema.TypeString, + Computed: true, + Optional: true, + }, + "last_alert_at": { + Type: schema.TypeString, + Computed: true, + Optional: true, + }, + "has_failure": { + Type: schema.TypeBool, + Computed: true, + Optional: true, + }, + "has_location_failure": { + Type: schema.TypeBool, + Computed: true, + Optional: true, + }, + }, + }, + }, + "viewport": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "width": { + Type: schema.TypeInt, + Optional: true, + }, + "height": { + Type: schema.TypeInt, + Optional: true, + }, + }, + }, + }, + "dns_overrides": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "original_domain": { + Type: schema.TypeString, + Optional: true, + }, + "original_host": { + Type: schema.TypeString, + Optional: true, + }, + }, + }, + }, + "browser": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "type": { + Type: schema.TypeString, + Optional: true, + Default: "chrome", + }, + }, + }, + }, + "steps": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "item_method": { + Type: schema.TypeString, + Optional: true, + }, + "value": { + Type: schema.TypeString, + Optional: true, + }, + "how": { + Type: schema.TypeString, + Optional: true, + }, + "what": { + Type: schema.TypeString, + Optional: true, + }, + "variable_name": { + Type: schema.TypeString, + Optional: true, + }, + "name": { + Type: schema.TypeString, + Optional: true, + }, + "position": { + Type: schema.TypeInt, + Optional: true, + }, + }, + }, + }, + "cookies": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "key": { + Type: schema.TypeString, + Optional: true, + }, + "value": { + Type: schema.TypeString, + Optional: true, + }, + "domain": { + Type: schema.TypeString, + Optional: true, + }, + "path": { + Type: schema.TypeString, + Optional: true, + }, + }, + }, + }, + "javascript_files": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "id": { + Type: schema.TypeInt, + Optional: true, + }, + "name": { + Type: schema.TypeString, + Optional: true, + }, + }, + }, + }, + "threshold_monitors": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "matcher": { + Type: schema.TypeString, + Optional: true, + }, + "metric_name": { + Type: schema.TypeString, + Optional: true, + ValidateFunc: func(val interface{}, key string) (warns []string, errs []error) { + v := val.(string) + switch v { + case + "first_byte_time_ms", + "dom_interactive_time_ms", + "dom_load_time_ms", + "dom_complete_time_ms", + "start_render_ms", + "onload_time_ms", + "visually_complete_ms", + "fully_loaded_time_ms", + "first_paint_time_ms", + "first_contentful_paint_time_ms", + "first_meaningful_paint_time_ms", + "first_interactive_time_ms", + "first_cpu_idle_time_ms", + "first_request_dns_time_ms", + "first_request_connect_time_ms", + "first_request_ssl_time_ms", + "first_request_send_time_ms", + "first_request_wait_time_ms", + "first_request_receive_time_ms", + "speed_index", + "requests", + "content_bytes", + "html_files", + "html_bytes", + "image_files", + "image_bytes", + "javascript_files", + "javascript_bytes", + "css_files", + "css_bytes", + "video_files", + "video_bytes", + "font_files", + "font_bytes", + "other_files", + "other_bytes", + "client_errors", + "connection_errors", + "server_errors", + "errors", + "run_count", + "success_count", + "failure_count", + "lighthouse_performance_score", + "availability", + "downtime", + "total_blocking_time_ms", + "largest_contentful_paint_time_ms", + "cumulative_layout_shift": + return + } + errs = append(errs, fmt.Errorf("%s is not a valid metric_name. Please check your input against API docs at https://monitoring-api.rigor.com", v)) + return + }, + }, + "comparison_type": { + Type: schema.TypeString, + Optional: true, + ValidateFunc: func(val interface{}, key string) (warns []string, errs []error) { + v := val.(string) + switch v { + case + "less_than", + "equals", + "greater_than": + return + } + errs = append(errs, fmt.Errorf("%s is not a valid comparison_type. Please check your input against API docs at https://monitoring-api.rigor.com", v)) + return + }, + }, + "value": { + Type: schema.TypeInt, + Optional: true, + }, + }, + }, + }, + "excluded_files": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "pattern": { + Type: schema.TypeString, + Optional: true, + }, + "preset_name": { + Type: schema.TypeString, + Optional: true, + ValidateFunc: func(val interface{}, key string) (warns []string, errs []error) { + v := val.(string) + switch v { + case + "chartbeat", + "clicktale", + "comscore", + "coremetrics", + "crazy-egg", + "eloqua", + "gomez", + "google-analytics", + "hubspot", + "liveperson", + "mixpanel", + "omniture", + "optimizely", + "pardot", + "quantcast", + "spectate", + "tealium", + "white-ops": + return + } + errs = append(errs, fmt.Errorf("%s is not a valid preset_name. Please check your input against API docs at https://monitoring-api.rigor.com", v)) + return + }, + }, + "exclusion_type": { + Type: schema.TypeString, + Optional: true, + ValidateFunc: func(val interface{}, key string) (warns []string, errs []error) { + v := val.(string) + switch v { + case + "preset", + "custom", + "all_except": + return + } + errs = append(errs, fmt.Errorf("%s is not a valid exclusion_type. Please check your input against API docs at https://monitoring-api.rigor.com", v)) + return + }, + }, + }, + }, + }, + "notifications": { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "sms": { + Type: schema.TypeBool, + Computed: true, + Optional: true, + }, + "call": { + Type: schema.TypeBool, + Computed: true, + Optional: true, + }, + "email": { + Type: schema.TypeBool, + Computed: true, + Optional: true, + }, + "notify_after_failure_count": { + Type: schema.TypeInt, + Computed: true, + Optional: true, + }, + "notify_on_location_failure": { + Type: schema.TypeBool, + Computed: true, + Optional: true, + }, + "muted": { + Type: schema.TypeBool, + Computed: true, + Optional: true, + }, + "notify_who": { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "sms": { + Type: schema.TypeBool, + Optional: true, + }, + "call": { + Type: schema.TypeBool, + Optional: true, + }, + "email": { + Type: schema.TypeBool, + Optional: true, + }, + "custom_user_email": { + Type: schema.TypeString, + Optional: true, + }, + "type": { + Type: schema.TypeString, + Optional: true, + }, + "links": { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "self_html": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "id": { + Type: schema.TypeInt, + Computed: true, + Optional: true, + }, + }, + }, + }, + "notification_windows": { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "start_time": { + Type: schema.TypeString, + Computed: true, + }, + "end_time": { + Type: schema.TypeString, + Computed: true, + }, + "duration_in_minutes": { + Type: schema.TypeInt, + Computed: true, + }, + "time_zone": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "escalations": { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "sms": { + Type: schema.TypeBool, + Computed: true, + Optional: true, + }, + "call": { + Type: schema.TypeBool, + Computed: true, + Optional: true, + }, + "email": { + Type: schema.TypeBool, + Computed: true, + Optional: true, + }, + "after_minutes": { + Type: schema.TypeInt, + Computed: true, + Optional: true, + }, + "is_repeat": { + Type: schema.TypeBool, + Computed: true, + }, + "notify_who": { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "id": { + Type: schema.TypeInt, + Optional: true, + }, + "custom_user_email": { + Type: schema.TypeString, + Optional: true, + }, + "type": { + Type: schema.TypeString, + Optional: true, + }, + "links": { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "self_html": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + }, + }, + }, + "notification_window": { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "start_time": { + Type: schema.TypeString, + Computed: true, + }, + "end_time": { + Type: schema.TypeString, + Computed: true, + }, + "duration_in_minutes": { + Type: schema.TypeInt, + Computed: true, + }, + "time_zone": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + "response_time_monitor_milliseconds": { + Type: schema.TypeInt, + Computed: true, + Optional: true, + }, + "http_request_headers": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "user_agent": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "round_robin": { + Type: schema.TypeBool, + Computed: true, + }, + "auto_retry": { + Type: schema.TypeBool, + Computed: true, + }, + "enabled": { + Type: schema.TypeBool, + Computed: true, + }, + "integrations": { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "id": { + Type: schema.TypeInt, + Computed: true, + }, + "name": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "url": { + Type: schema.TypeString, + Computed: true, + }, + "http_request_body": { + Type: schema.TypeString, + Computed: true, + }, + "http_method": { + Type: schema.TypeString, + Computed: true, + }, + "blackout_periods": { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "start_date": { + Type: schema.TypeString, + Computed: true, + }, + "end_date": { + Type: schema.TypeString, + Computed: true, + }, + "timezone": { + Type: schema.TypeString, + Computed: true, + }, + "start_time": { + Type: schema.TypeString, + Computed: true, + }, + "end_time": { + Type: schema.TypeString, + Computed: true, + }, + "repeat_type": { + Type: schema.TypeString, + Computed: true, + }, + "duration_in_minutes": { + Type: schema.TypeInt, + Computed: true, + }, + "is_repeat": { + Type: schema.TypeBool, + Computed: true, + }, + "monthly_repeat_type": { + Type: schema.TypeString, + Computed: true, + }, + "created_at": { + Type: schema.TypeString, + Computed: true, + }, + "updated_at": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "locations": { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "id": { + Type: schema.TypeInt, + Computed: true, + }, + "name": { + Type: schema.TypeString, + Computed: true, + }, + "region_code": { + Type: schema.TypeString, + Computed: true, + }, + "world_region": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "success_criteria": { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "action_type": { + Type: schema.TypeString, + Computed: true, + }, + "created_at": { + Type: schema.TypeString, + Computed: true, + }, + "updated_at": { + Type: schema.TypeString, + Computed: true, + }, + "comparison_string": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "check_connection": { + // `connection` is a reserved field name in Terraform + Type: schema.TypeSet, + Computed: true, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "download_bandwidth": { + Type: schema.TypeInt, + Computed: true, + Optional: true, + }, + "upload_bandwidth": { + Type: schema.TypeInt, + Computed: true, + Optional: true, + }, + "latency": { + Type: schema.TypeInt, + Computed: true, + Optional: true, + }, + "packet_loss": { + Type: schema.TypeInt, + Computed: true, + Optional: true, + }, + }, + }, + }, + "tags": { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "id": { + Type: schema.TypeInt, + Computed: true, + }, + "name": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + }, + } +} + +func dataSourceChecksRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + c := m.(*sc.Client) + + // Warning or errors can be collected in a slice type + var diags diag.Diagnostics + + checkID := d.Get("id").(int) + + check, _, err := c.GetCheck(checkID) + if err != nil { + return diag.FromErr(err) + } + + d.Set("name", check.Name) + d.Set("frequency", check.Frequency) + d.Set("muted", check.Muted) + d.Set("paused", check.Paused) + d.Set("created_at", check.CreatedAt) + d.Set("type", check.Type) + d.Set("updated_at", check.UpdatedAt) + d.Set("response_time_monitor_milliseconds", check.ResponseTimeMonitorMilliseconds) + d.Set("round_robin", check.RoundRobin) + d.Set("auto_retry", check.AutoRetry) + d.Set("enabled", check.Enabled) + d.Set("url", check.URL) + d.Set("http_request_body", check.HTTPRequestBody) + d.Set("http_method", check.HTTPMethod) + + checkLinks := flattenLinkData(&check.Links) + if err := d.Set("links", checkLinks); err != nil { + return diag.FromErr(err) + } + + checkStatus := flattenStatusData(&check.Status) + if err := d.Set("status", checkStatus); err != nil { + return diag.FromErr(err) + } + + checkTags := flattenTagsData(&check.Tags) + if err := d.Set("tags", checkTags); err != nil { + return diag.FromErr(err) + } + + checkBlackout := flattenBlackoutData(&check.BlackoutPeriods) + if err := d.Set("blackout_periods", checkBlackout); err != nil { + return diag.FromErr(err) + } + + checkNotifications := flattenNotificationsData(&check.Notifications) + if err := d.Set("notifications", checkNotifications); err != nil { + return diag.FromErr(err) + } + + checkConnection := flattenConnectionData(&check.Connection) + if err := d.Set("check_connection", checkConnection); err != nil { + return diag.FromErr(err) + } + + checkIntegrations := flattenIntegrationsData(&check.Integrations) + if err := d.Set("integrations", checkIntegrations); err != nil { + return diag.FromErr(err) + } + + checkLocations := flattenLocationsData(&check.Locations) + if err := d.Set("locations", checkLocations); err != nil { + return diag.FromErr(err) + } + + checkSuccessCriteria := flattenSuccessCriteriaData(&check.SuccessCriteria) + if err := d.Set("success_criteria", checkSuccessCriteria); err != nil { + return diag.FromErr(err) + } + + checkSteps := flattenStepData(check.Steps) + if err := d.Set("steps", checkSteps); err != nil { + return diag.FromErr(err) + } + + id := fmt.Sprint(check.ID) + d.SetId(id) + return diags +} diff --git a/synthetics/provider.go b/synthetics/provider.go new file mode 100644 index 0000000..250e096 --- /dev/null +++ b/synthetics/provider.go @@ -0,0 +1,46 @@ +package synthetics + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + sc "github.com/splunk/syntheticsclient/syntheticsclient" +) + +func Provider() *schema.Provider { + return &schema.Provider{ + Schema: map[string]*schema.Schema{ + "apikey": { + Type: schema.TypeString, + Optional: true, + DefaultFunc: schema.EnvDefaultFunc("API_ACCESS_TOKEN", nil), + }, + }, + ResourcesMap: map[string]*schema.Resource{ + "synthetics_create_http_check": resourceHttpCheck(), + "synthetics_create_browser_check": resourceBrowserCheck(), + }, + DataSourcesMap: map[string]*schema.Resource{ + "synthetics_check": dataSourceCheck(), + }, + ConfigureContextFunc: providerConfigure, + } +} + +func providerConfigure(ctx context.Context, d *schema.ResourceData) (interface{}, diag.Diagnostics) { + token := d.Get("apikey").(string) + + // Warning or errors can be collected in a slice type + var diags diag.Diagnostics + + if token != "" { + c := sc.NewClient(token) + + return c, diags + } + + c := sc.NewClient(token) + + return c, diags +} diff --git a/synthetics/provider_test.go b/synthetics/provider_test.go new file mode 100644 index 0000000..1890202 --- /dev/null +++ b/synthetics/provider_test.go @@ -0,0 +1,34 @@ +package synthetics + +import ( + "os" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +var testAccProvider *schema.Provider +var testAccProviders map[string]*schema.Provider + +func init() { + testAccProvider = Provider() + testAccProviders = map[string]*schema.Provider{ + "synthetics": testAccProvider, + } +} + +func TestProvider(t *testing.T) { + if err := Provider().InternalValidate(); err != nil { + t.Fatalf("err: %s", err) + } +} + +func TestProvider_impl(t *testing.T) { + var _ *schema.Provider = Provider() +} + +func testAccPreCheck(t *testing.T) { + if err := os.Getenv("API_ACCESS_TOKEN"); err == "" { + t.Fatal("API_ACCESS_TOKEN must be set for acceptance tests") + } +} diff --git a/synthetics/resource_browser_check.go b/synthetics/resource_browser_check.go new file mode 100644 index 0000000..3b23f8d --- /dev/null +++ b/synthetics/resource_browser_check.go @@ -0,0 +1,821 @@ +package synthetics + +import ( + "context" + "fmt" + "log" + "strconv" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + sc "github.com/splunk/syntheticsclient/syntheticsclient" +) + +func resourceBrowserCheck() *schema.Resource { + return &schema.Resource{ + CreateContext: resourceBrowserCheckCreate, + ReadContext: resourceBrowserCheckRead, + UpdateContext: resourceBrowserCheckUpdate, + DeleteContext: resourceBrowserCheckDelete, + + Schema: map[string]*schema.Schema{ + "last_updated": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "name": { + Type: schema.TypeString, + Required: true, + }, + "type": { + Type: schema.TypeString, + Optional: true, + Default: "real_browser", + }, + "frequency": { + Type: schema.TypeInt, + Required: true, + }, + "url": { + Type: schema.TypeString, + Required: true, + }, + "round_robin": { + Type: schema.TypeBool, + Default: true, + Optional: true, + }, + "auto_retry": { + Type: schema.TypeBool, + Optional: true, + }, + "enabled": { + Type: schema.TypeBool, + Optional: true, + }, + "http_request_body": { + Type: schema.TypeString, + Optional: true, + }, + "http_method": { + Type: schema.TypeString, + Optional: true, + }, + "user_agent": { + Type: schema.TypeString, + Optional: true, + Default: "Mozilla/5.0 (X11; Linux x86_64; Rigor) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36", + }, + "auto_update_user_agent": { + Type: schema.TypeBool, + Optional: true, + Default: true, + }, + "enforce_ssl_validation": { + Type: schema.TypeBool, + Optional: true, + Default: false, + }, + "wait_for_full_metrics": { + Type: schema.TypeBool, + Optional: true, + Default: false, + }, + "integrations": { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Schema{ + Type: schema.TypeInt, + }, + }, + "viewport": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "width": { + Type: schema.TypeInt, + Optional: true, + }, + "height": { + Type: schema.TypeInt, + Optional: true, + }, + }, + }, + }, + "dns_overrides": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "original_domain": { + Type: schema.TypeString, + Optional: true, + }, + "original_host": { + Type: schema.TypeString, + Optional: true, + }, + }, + }, + }, + "browser": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "type": { + Type: schema.TypeString, + Optional: true, + Default: "chrome", + }, + }, + }, + }, + "steps": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "item_method": { + Type: schema.TypeString, + Optional: true, + }, + "value": { + Type: schema.TypeString, + Optional: true, + }, + "how": { + Type: schema.TypeString, + Optional: true, + }, + "what": { + Type: schema.TypeString, + Optional: true, + }, + "variable_name": { + Type: schema.TypeString, + Optional: true, + }, + "name": { + Type: schema.TypeString, + Optional: true, + }, + "position": { + Type: schema.TypeInt, + Optional: true, + }, + }, + }, + }, + "cookies": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "key": { + Type: schema.TypeString, + Optional: true, + }, + "value": { + Type: schema.TypeString, + Optional: true, + }, + "domain": { + Type: schema.TypeString, + Optional: true, + }, + "path": { + Type: schema.TypeString, + Optional: true, + }, + }, + }, + }, + "javascript_files": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "id": { + Type: schema.TypeInt, + Optional: true, + }, + "name": { + Type: schema.TypeString, + Optional: true, + }, + }, + }, + }, + "threshold_monitors": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "matcher": { + Type: schema.TypeString, + Optional: true, + }, + "metric_name": { + Type: schema.TypeString, + Optional: true, + ValidateFunc: func(val interface{}, key string) (warns []string, errs []error) { + v := val.(string) + switch v { + case + "first_byte_time_ms", + "dom_interactive_time_ms", + "dom_load_time_ms", + "dom_complete_time_ms", + "start_render_ms", + "onload_time_ms", + "visually_complete_ms", + "fully_loaded_time_ms", + "first_paint_time_ms", + "first_contentful_paint_time_ms", + "first_meaningful_paint_time_ms", + "first_interactive_time_ms", + "first_cpu_idle_time_ms", + "first_request_dns_time_ms", + "first_request_connect_time_ms", + "first_request_ssl_time_ms", + "first_request_send_time_ms", + "first_request_wait_time_ms", + "first_request_receive_time_ms", + "speed_index", + "requests", + "content_bytes", + "html_files", + "html_bytes", + "image_files", + "image_bytes", + "javascript_files", + "javascript_bytes", + "css_files", + "css_bytes", + "video_files", + "video_bytes", + "font_files", + "font_bytes", + "other_files", + "other_bytes", + "client_errors", + "connection_errors", + "server_errors", + "errors", + "run_count", + "success_count", + "failure_count", + "lighthouse_performance_score", + "availability", + "downtime", + "total_blocking_time_ms", + "largest_contentful_paint_time_ms", + "cumulative_layout_shift": + return + } + errs = append(errs, fmt.Errorf("%s is not a valid metric_name. Please check your input against API docs at https://monitoring-api.rigor.com", v)) + return + }, + }, + "comparison_type": { + Type: schema.TypeString, + Optional: true, + ValidateFunc: func(val interface{}, key string) (warns []string, errs []error) { + v := val.(string) + switch v { + case + "less_than", + "equals", + "greater_than": + return + } + errs = append(errs, fmt.Errorf("%s is not a valid comparison_type. Please check your input against API docs at https://monitoring-api.rigor.com", v)) + return + }, + }, + "value": { + Type: schema.TypeInt, + Optional: true, + }, + }, + }, + }, + "excluded_files": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "pattern": { + Type: schema.TypeString, + Optional: true, + }, + "preset_name": { + Type: schema.TypeString, + Optional: true, + ValidateFunc: func(val interface{}, key string) (warns []string, errs []error) { + v := val.(string) + switch v { + case + "chartbeat", + "clicktale", + "comscore", + "coremetrics", + "crazy-egg", + "eloqua", + "gomez", + "google-analytics", + "hubspot", + "liveperson", + "mixpanel", + "omniture", + "optimizely", + "pardot", + "quantcast", + "spectate", + "tealium", + "white-ops": + return + } + errs = append(errs, fmt.Errorf("%s is not a valid preset_name. Please check your input against API docs at https://monitoring-api.rigor.com", v)) + return + }, + }, + "exclusion_type": { + Type: schema.TypeString, + Optional: true, + ValidateFunc: func(val interface{}, key string) (warns []string, errs []error) { + v := val.(string) + switch v { + case + "preset", + "custom", + "all_except": + return + } + errs = append(errs, fmt.Errorf("%s is not a valid exclusion_type. Please check your input against API docs at https://monitoring-api.rigor.com", v)) + return + }, + }, + }, + }, + }, + "notifications": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "sms": { + Type: schema.TypeBool, + Optional: true, + }, + "call": { + Type: schema.TypeBool, + Optional: true, + }, + "email": { + Type: schema.TypeBool, + Optional: true, + }, + "notify_after_failure_count": { + Type: schema.TypeInt, + Optional: true, + }, + "notify_on_location_failure": { + Type: schema.TypeBool, + Optional: true, + }, + "muted": { + Type: schema.TypeBool, + Optional: true, + }, + "notify_who": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "sms": { + Type: schema.TypeBool, + Optional: true, + }, + "call": { + Type: schema.TypeBool, + Optional: true, + }, + "email": { + Type: schema.TypeBool, + Optional: true, + }, + "custom_user_email": { + Type: schema.TypeString, + Optional: true, + }, + "type": { + Type: schema.TypeString, + Optional: true, + }, + "links": { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "self_html": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "id": { + Type: schema.TypeInt, + Computed: true, + Optional: true, + }, + }, + }, + }, + "notification_windows": { + Type: schema.TypeSet, + Computed: true, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "start_time": { + Type: schema.TypeString, + Optional: true, + }, + "end_time": { + Type: schema.TypeString, + Optional: true, + }, + "duration_in_minutes": { + Type: schema.TypeInt, + Optional: true, + }, + "time_zone": { + Type: schema.TypeString, + Optional: true, + }, + }, + }, + }, + "escalations": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "sms": { + Type: schema.TypeBool, + Optional: true, + }, + "call": { + Type: schema.TypeBool, + Optional: true, + }, + "email": { + Type: schema.TypeBool, + Optional: true, + }, + "after_minutes": { + Type: schema.TypeInt, + Optional: true, + }, + "is_repeat": { + Type: schema.TypeBool, + Computed: true, + }, + "notify_who": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "id": { + Type: schema.TypeInt, + Optional: true, + }, + "sms": { + Type: schema.TypeBool, + Optional: true, + }, + "call": { + Type: schema.TypeBool, + Optional: true, + }, + "email": { + Type: schema.TypeBool, + Optional: true, + }, + "custom_user_email": { + Type: schema.TypeString, + Optional: true, + }, + "type": { + Type: schema.TypeString, + Optional: true, + }, + "links": { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "self_html": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + }, + }, + }, + "notification_window": { + Type: schema.TypeSet, + Computed: true, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "start_time": { + Type: schema.TypeString, + Optional: true, + }, + "end_time": { + Type: schema.TypeString, + Optional: true, + }, + "duration_in_minutes": { + Type: schema.TypeInt, + Optional: true, + }, + "time_zone": { + Type: schema.TypeString, + Optional: true, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + "http_request_headers": { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "user_agent": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "blackout_periods": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "start_date": { + Type: schema.TypeString, + Computed: true, + }, + "end_date": { + Type: schema.TypeString, + Computed: true, + }, + "timezone": { + Type: schema.TypeString, + Computed: true, + }, + "start_time": { + Type: schema.TypeString, + Computed: true, + }, + "end_time": { + Type: schema.TypeString, + Computed: true, + }, + "repeat_type": { + Type: schema.TypeString, + Computed: true, + }, + "duration_in_minutes": { + Type: schema.TypeInt, + Computed: true, + }, + "is_repeat": { + Type: schema.TypeBool, + Computed: true, + }, + "monthly_repeat_type": { + Type: schema.TypeString, + Computed: true, + }, + "created_at": { + Type: schema.TypeString, + Computed: true, + }, + "updated_at": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "locations": { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Schema{ + Type: schema.TypeInt, + }, + }, + "success_criteria": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "action_type": { + Type: schema.TypeString, + Optional: true, + }, + "created_at": { + Type: schema.TypeString, + Optional: true, + }, + "updated_at": { + Type: schema.TypeString, + Optional: true, + }, + "comparison_string": { + Type: schema.TypeString, + Optional: true, + }, + }, + }, + }, + "check_connection": { + // `connection` is a reserved field name in Terraform + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "download_bandwidth": { + Type: schema.TypeInt, + Optional: true, + }, + "upload_bandwidth": { + Type: schema.TypeInt, + Optional: true, + }, + "latency": { + Type: schema.TypeInt, + Optional: true, + }, + "packet_loss": { + Type: schema.TypeFloat, + Optional: true, + }, + }, + }, + }, + "tags": { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, + } +} + +func resourceBrowserCheckCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + c := meta.(*sc.Client) + + // Warning or errors can be collected in a slice type + var diags diag.Diagnostics + + check := sc.BrowserCheckInput{} + + checkData := processBrowserCheckItems(d, check) + + o, _, err := c.CreateBrowserCheck(&checkData) + if err != nil { + return diag.FromErr(err) + } + d.SetId(strconv.Itoa(o.ID)) + + resourceBrowserCheckRead(ctx, d, meta) + + return diags + // return nil +} + +func resourceBrowserCheckRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + c := meta.(*sc.Client) + + // Warning or errors can be collected in a slice type + var diags diag.Diagnostics + + checkID, err := strconv.Atoi(d.Id()) + if err != nil { + return diag.FromErr(err) + } + + check, _, err := c.GetCheck(checkID) + if err != nil { + return diag.FromErr(err) + } + log.Println("[DEBUG] GET check response data: ", check) + + return diags +} + +func resourceBrowserCheckDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + c := meta.(*sc.Client) + + var diags diag.Diagnostics + + checkID := d.Id() + + checkIdString, err := strconv.Atoi(checkID) + if err != nil { + return diag.FromErr(err) + } + + resp, err := c.DeleteBrowserCheck(checkIdString) + if err != nil { + return diag.FromErr(err) + } + + log.Println("[DEBUG] Delete check response data: ", resp) + d.SetId("") + + return diags +} + +func resourceBrowserCheckUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + c := meta.(*sc.Client) + + checkID := d.Id() + + check := sc.BrowserCheckInput{} + + checkData := processBrowserCheckItems(d, check) + + checkIdString, err := strconv.Atoi(checkID) + if err != nil { + return diag.FromErr(err) + } + + o, _, err := c.UpdateBrowserCheck(checkIdString, &checkData) + if err != nil { + return diag.FromErr(err) + } + log.Println("[DEBUG] Update check response data: ", o) + d.Set("last_updated", time.Now().Format(time.RFC850)) + + return resourceBrowserCheckRead(ctx, d, meta) +} + +func processBrowserCheckItems(d *schema.ResourceData, check sc.BrowserCheckInput) sc.BrowserCheckInput { + + //These MUST exist or the request will fail + check.Name = d.Get("name").(string) + check.Frequency = d.Get("frequency").(int) + check.Type = d.Get("type").(string) + check.URL = d.Get("url").(string) + + check.RoundRobin = d.Get("round_robin").(bool) + check.AutoRetry = d.Get("auto_retry").(bool) + check.Enabled = d.Get("enabled").(bool) + check.HTTPRequestBody = d.Get("http_request_body").(string) + check.HTTPMethod = d.Get("http_method").(string) + check.AutoUpdateUserAgent = d.Get("auto_update_user_agent").(bool) + check.EnforceSslValidation = d.Get("enforce_ssl_validation").(bool) + check.WaitForFullMetrics = d.Get("wait_for_full_metrics").(bool) + + check.Viewport = buildViewportData(d) + check.Connection = buildConnectionData(d) + check.Tags = buildTagsData(d) + check.Locations = buildLocationsData(d) + check.Integrations = buildIntegrationsData(d) + check.Notifications = buildNotificationsData(check.Notifications, d) + check.ExcludedFiles = buildExcludedFilesData(d) + check.Cookies = buildCookieData(d) + check.DNSOverrides = buildDnsOverridesData(d) + check.ThresholdMonitors = buildThresholdMonitorsData(d) + // Currently javascript_files and steps settings are not available via public API endpoints + check.JavascriptFiles = buildJavascriptFilesData(d) + check.Steps = buildStepData(d) + + return check +} diff --git a/synthetics/resource_browser_check_test.go b/synthetics/resource_browser_check_test.go new file mode 100644 index 0000000..de9c062 --- /dev/null +++ b/synthetics/resource_browser_check_test.go @@ -0,0 +1,97 @@ +package synthetics + +import ( + "fmt" + "os" + "strconv" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sc "github.com/splunk/syntheticsclient/syntheticsclient" +) + +func TestAccBrowserCheckBasic(t *testing.T) { + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccBrowserCheckDestroy, + Steps: []resource.TestStep{ + { + Config: testAccBrowserCheckConfigBasic("ineffective browser test", "https://www.google.com", "real_browser", 15), + Check: resource.ComposeTestCheckFunc( + testAccBrowserCheckExists("synthetics_create_browser_check.browser_check"), + resource.TestCheckResourceAttr("synthetics_create_browser_check.browser_check", "name", "ineffective browser test"), + resource.TestCheckResourceAttr("synthetics_create_browser_check.browser_check", "url", "https://www.google.com"), + resource.TestCheckResourceAttr("synthetics_create_browser_check.browser_check", "type", "real_browser"), + resource.TestCheckResourceAttr("synthetics_create_browser_check.browser_check", "frequency", "15"), + ), + }, + { + ResourceName: "synthetics_create_browser_check.browser_check", + ImportState: true, + ImportStateIdFunc: testAccStateIdFunc("synthetics_create_browser_check.browser_check"), + }, + { + Config: testAccBrowserCheckConfigBasic("updated test", "https://about.google/", "real_browser", 5), + Check: resource.ComposeTestCheckFunc( + testAccBrowserCheckExists("synthetics_create_browser_check.browser_check"), + resource.TestCheckResourceAttr("synthetics_create_browser_check.browser_check", "name", "updated test"), + resource.TestCheckResourceAttr("synthetics_create_browser_check.browser_check", "url", "https://about.google/"), + resource.TestCheckResourceAttr("synthetics_create_browser_check.browser_check", "type", "real_browser"), + resource.TestCheckResourceAttr("synthetics_create_browser_check.browser_check", "frequency", "5"), + ), + }, + }, + }) +} + +func testAccBrowserCheckConfigBasic(name string, url string, checktype string, frequency int) string { + check := fmt.Sprintf(` +resource "synthetics_create_browser_check" "browser_check" { + name = "%s" + url = "%s" + type = "%s" + frequency = %d +} +`, name, url, checktype, frequency) + + return check +} + +func testAccBrowserCheckExists(n string) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[n] + + if !ok { + return fmt.Errorf("Not found: %s", n) + } + + if rs.Primary.ID == "" { + return fmt.Errorf("No Check Id set") + } + return nil + } +} + +func testAccBrowserCheckDestroy(s *terraform.State) error { + token := os.Getenv("API_ACCESS_TOKEN") + client := sc.NewClient(token) + for _, rs := range s.RootModule().Resources { + switch rs.Type { + case "synthetics_create_browser_check": + checkId, err := strconv.Atoi(rs.Primary.ID) + if err != nil { + return fmt.Errorf("Error converting check id: %s", err) + } + check, _, err := client.GetCheck(checkId) + if check.ID != checkId || err != nil { + return fmt.Errorf("Found deleted check %s", rs.Primary.ID) + } + default: + return fmt.Errorf("Unexpected resource of type: %s", rs.Type) + } + } + + return nil +} diff --git a/synthetics/resource_http_check.go b/synthetics/resource_http_check.go new file mode 100644 index 0000000..f2d926e --- /dev/null +++ b/synthetics/resource_http_check.go @@ -0,0 +1,511 @@ +package synthetics + +import ( + "context" + "log" + "strconv" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + sc "github.com/splunk/syntheticsclient/syntheticsclient" +) + +func resourceHttpCheck() *schema.Resource { + return &schema.Resource{ + CreateContext: resourceHttpCheckCreate, + ReadContext: resourceHttpCheckRead, + UpdateContext: resourceHttpCheckUpdate, + DeleteContext: resourceHttpCheckDelete, + + Schema: map[string]*schema.Schema{ + "last_updated": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "name": { + Type: schema.TypeString, + Required: true, + }, + "frequency": { + Type: schema.TypeInt, + Required: true, + }, + "url": { + Type: schema.TypeString, + Required: true, + }, + "notifications": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "sms": { + Type: schema.TypeBool, + Optional: true, + }, + "call": { + Type: schema.TypeBool, + Optional: true, + }, + "email": { + Type: schema.TypeBool, + Optional: true, + }, + "notify_after_failure_count": { + Type: schema.TypeInt, + Optional: true, + }, + "notify_on_location_failure": { + Type: schema.TypeBool, + Optional: true, + }, + "muted": { + Type: schema.TypeBool, + Optional: true, + }, + "notify_who": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "sms": { + Type: schema.TypeBool, + Optional: true, + }, + "call": { + Type: schema.TypeBool, + Optional: true, + }, + "email": { + Type: schema.TypeBool, + Optional: true, + }, + "custom_user_email": { + Type: schema.TypeString, + Optional: true, + }, + "type": { + Type: schema.TypeString, + Optional: true, + }, + "links": { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "self_html": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "id": { + Type: schema.TypeInt, + Computed: true, + Optional: true, + }, + }, + }, + }, + "notification_windows": { + Type: schema.TypeSet, + Computed: true, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "start_time": { + Type: schema.TypeString, + Optional: true, + }, + "end_time": { + Type: schema.TypeString, + Optional: true, + }, + "duration_in_minutes": { + Type: schema.TypeInt, + Optional: true, + }, + "time_zone": { + Type: schema.TypeString, + Optional: true, + }, + }, + }, + }, + "escalations": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "sms": { + Type: schema.TypeBool, + Optional: true, + }, + "call": { + Type: schema.TypeBool, + Optional: true, + }, + "email": { + Type: schema.TypeBool, + Optional: true, + }, + "after_minutes": { + Type: schema.TypeInt, + Optional: true, + }, + "is_repeat": { + Type: schema.TypeBool, + Computed: true, + }, + "notify_who": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "id": { + Type: schema.TypeInt, + Optional: true, + }, + "sms": { + Type: schema.TypeBool, + Optional: true, + }, + "call": { + Type: schema.TypeBool, + Optional: true, + }, + "email": { + Type: schema.TypeBool, + Optional: true, + }, + "custom_user_email": { + Type: schema.TypeString, + Optional: true, + }, + "type": { + Type: schema.TypeString, + Optional: true, + }, + "links": { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "self_html": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + }, + }, + }, + "notification_window": { + Type: schema.TypeSet, + Computed: true, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "start_time": { + Type: schema.TypeString, + Optional: true, + }, + "end_time": { + Type: schema.TypeString, + Optional: true, + }, + "duration_in_minutes": { + Type: schema.TypeInt, + Optional: true, + }, + "time_zone": { + Type: schema.TypeString, + Optional: true, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + "http_request_headers": { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "user_agent": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "round_robin": { + Type: schema.TypeBool, + Default: true, + Optional: true, + }, + "auto_retry": { + Type: schema.TypeBool, + Optional: true, + }, + "enabled": { + Type: schema.TypeBool, + Optional: true, + }, + "integrations": { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Schema{ + Type: schema.TypeInt, + }, + }, + "http_request_body": { + Type: schema.TypeString, + Optional: true, + }, + "http_method": { + Type: schema.TypeString, + Optional: true, + }, + "blackout_periods": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "start_date": { + Type: schema.TypeString, + Computed: true, + }, + "end_date": { + Type: schema.TypeString, + Computed: true, + }, + "timezone": { + Type: schema.TypeString, + Computed: true, + }, + "start_time": { + Type: schema.TypeString, + Computed: true, + }, + "end_time": { + Type: schema.TypeString, + Computed: true, + }, + "repeat_type": { + Type: schema.TypeString, + Computed: true, + }, + "duration_in_minutes": { + Type: schema.TypeInt, + Computed: true, + }, + "is_repeat": { + Type: schema.TypeBool, + Computed: true, + }, + "monthly_repeat_type": { + Type: schema.TypeString, + Computed: true, + }, + "created_at": { + Type: schema.TypeString, + Computed: true, + }, + "updated_at": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "locations": { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Schema{ + Type: schema.TypeInt, + }, + }, + "success_criteria": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "action_type": { + Type: schema.TypeString, + Optional: true, + }, + "created_at": { + Type: schema.TypeString, + Optional: true, + }, + "updated_at": { + Type: schema.TypeString, + Optional: true, + }, + "comparison_string": { + Type: schema.TypeString, + Optional: true, + }, + }, + }, + }, + "check_connection": { + // `connection` is a reserved field name in Terraform + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "download_bandwidth": { + Type: schema.TypeInt, + Optional: true, + }, + "upload_bandwidth": { + Type: schema.TypeInt, + Optional: true, + }, + "latency": { + Type: schema.TypeInt, + Optional: true, + }, + "packet_loss": { + Type: schema.TypeFloat, + Optional: true, + }, + }, + }, + }, + "tags": { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, + } +} + +func resourceHttpCheckCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + c := meta.(*sc.Client) + + // Warning or errors can be collected in a slice type + var diags diag.Diagnostics + + check := sc.HttpCheckInput{} + + checkData := processHttpCheckItems(d, check) + + o, _, err := c.CreateHttpCheck(&checkData) + if err != nil { + return diag.FromErr(err) + } + d.SetId(strconv.Itoa(o.ID)) + + resourceHttpCheckRead(ctx, d, meta) + + return diags + // return nil +} + +func resourceHttpCheckRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + c := meta.(*sc.Client) + + // Warning or errors can be collected in a slice type + var diags diag.Diagnostics + + checkID, err := strconv.Atoi(d.Id()) + if err != nil { + return diag.FromErr(err) + } + + check, _, err := c.GetHttpCheck(checkID) + if err != nil { + return diag.FromErr(err) + } + log.Println("[DEBUG] GET check response data: ", check) + + return diags +} + +func resourceHttpCheckDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + c := meta.(*sc.Client) + + var diags diag.Diagnostics + + checkID := d.Id() + + checkIdString, err := strconv.Atoi(checkID) + if err != nil { + return diag.FromErr(err) + } + + resp, err := c.DeleteHttpCheck(checkIdString) + if err != nil { + return diag.FromErr(err) + } + + log.Println("[DEBUG] Delete check response data: ", resp) + d.SetId("") + + return diags +} + +func resourceHttpCheckUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + c := meta.(*sc.Client) + + checkID := d.Id() + + check := sc.HttpCheckInput{} + + checkData := processHttpCheckItems(d, check) + + checkIdString, err := strconv.Atoi(checkID) + if err != nil { + return diag.FromErr(err) + } + + o, _, err := c.UpdateHttpCheck(checkIdString, &checkData) + if err != nil { + return diag.FromErr(err) + } + log.Println("[DEBUG] Update check response data: ", o) + d.Set("last_updated", time.Now().Format(time.RFC850)) + + // return nil + return resourceHttpCheckRead(ctx, d, meta) +} + +func processHttpCheckItems(d *schema.ResourceData, check sc.HttpCheckInput) sc.HttpCheckInput { + + //These MUST exist of the request will fail + check.Name = d.Get("name").(string) + check.Frequency = d.Get("frequency").(int) + check.URL = d.Get("url").(string) + + check.AutoRetry = d.Get("auto_retry").(bool) + check.Enabled = d.Get("enabled").(bool) + check.HTTPRequestBody = d.Get("http_request_body").(string) + check.HTTPMethod = d.Get("http_method").(string) + check.RoundRobin = d.Get("round_robin").(bool) + + check.SuccessCriteria = buildSuccessCriteriaData(d) + check.Connection = buildConnectionData(d) + check.Tags = buildTagsData(d) + check.Locations = buildLocationsData(d) + check.Integrations = buildIntegrationsData(d) + check.Notifications = buildNotificationsData(check.Notifications, d) + + return check +} diff --git a/synthetics/resource_http_check_test.go b/synthetics/resource_http_check_test.go new file mode 100644 index 0000000..858c47f --- /dev/null +++ b/synthetics/resource_http_check_test.go @@ -0,0 +1,105 @@ +package synthetics + +import ( + "fmt" + "os" + "strconv" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + sc "github.com/splunk/syntheticsclient/syntheticsclient" +) + +func TestAccHttpCheckBasic(t *testing.T) { + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccHttpCheckDestroy, + Steps: []resource.TestStep{ + { + Config: testAccHttpCheckConfigBasic("ineffective test", "https://www.google.com", 15), + Check: resource.ComposeTestCheckFunc( + testAccHttpCheckExists("synthetics_create_http_check.http_check"), + resource.TestCheckResourceAttr("synthetics_create_http_check.http_check", "name", "ineffective test"), + resource.TestCheckResourceAttr("synthetics_create_http_check.http_check", "url", "https://www.google.com"), + resource.TestCheckResourceAttr("synthetics_create_http_check.http_check", "frequency", "15"), + ), + }, + { + ResourceName: "synthetics_create_http_check.http_check", + ImportState: true, + ImportStateIdFunc: testAccStateIdFunc("synthetics_create_http_check.http_check"), + }, + { + Config: testAccHttpCheckConfigBasic("updated test", "https://about.google/", 5), + Check: resource.ComposeTestCheckFunc( + testAccHttpCheckExists("synthetics_create_http_check.http_check"), + resource.TestCheckResourceAttr("synthetics_create_http_check.http_check", "name", "updated test"), + resource.TestCheckResourceAttr("synthetics_create_http_check.http_check", "url", "https://about.google/"), + resource.TestCheckResourceAttr("synthetics_create_http_check.http_check", "frequency", "5"), + ), + }, + }, + }) +} + +func testAccHttpCheckConfigBasic(name string, url string, frequency int) string { + return fmt.Sprintf(` +resource "synthetics_create_http_check" "http_check" { + name = "%s" + url = "%s" + frequency = %d +} +`, name, url, frequency) +} + +func testAccHttpCheckExists(n string) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[n] + + if !ok { + return fmt.Errorf("Not found: %s", n) + } + + if rs.Primary.ID == "" { + return fmt.Errorf("No Check Id set") + } + + return nil + } +} + +func testAccHttpCheckDestroy(s *terraform.State) error { + token := os.Getenv("API_ACCESS_TOKEN") + client := sc.NewClient(token) + for _, rs := range s.RootModule().Resources { + switch rs.Type { + case "synthetics_create_http_check": + checkId, err := strconv.Atoi(rs.Primary.ID) + if err != nil { + return fmt.Errorf("Error converting check id: %s", err) + } + check, _, err := client.GetCheck(checkId) + if check.ID != checkId || err != nil { + return fmt.Errorf("Found deleted check %s", rs.Primary.ID) + } + default: + return fmt.Errorf("Unexpected resource of type: %s", rs.Type) + } + } + + return nil +} + +func testAccStateIdFunc(resourceName string) resource.ImportStateIdFunc { + return func(s *terraform.State) (string, error) { + rs, ok := s.RootModule().Resources[resourceName] + if !ok { + return "", fmt.Errorf("Not found: %s", resourceName) + } + + return rs.Primary.Attributes["id"], nil + } +} diff --git a/synthetics/structures.go b/synthetics/structures.go new file mode 100644 index 0000000..0d290cc --- /dev/null +++ b/synthetics/structures.go @@ -0,0 +1,515 @@ +package synthetics + +import ( + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + sc "github.com/splunk/syntheticsclient/syntheticsclient" +) + +func flattenLinkData(checkLinks *sc.Links) []interface{} { + links := make(map[string]interface{}) + + if checkLinks.Self != "" { + links["self"] = checkLinks.Self + } + if checkLinks.SelfHTML != "" { + links["self_html"] = checkLinks.SelfHTML + } + if checkLinks.Metrics != "" { + links["metrics"] = checkLinks.Metrics + } + if checkLinks.LastRun != "" { + links["last_run"] = checkLinks.LastRun + } + + return []interface{}{links} +} + +func flattenStatusData(checkStatus *sc.Status) []interface{} { + status := make(map[string]interface{}) + + status["last_code"] = checkStatus.LastCode + status["last_message"] = checkStatus.LastMessage + status["last_response_time"] = checkStatus.LastResponseTime + status["last_run_at"] = checkStatus.LastRunAt + status["last_failure_at"] = checkStatus.LastFailureAt + status["last_alert_at"] = checkStatus.LastAlertAt + status["has_failure"] = checkStatus.HasFailure + status["has_location_failure"] = checkStatus.HasLocationFailure + + return []interface{}{status} +} + +func buildTagsData(d *schema.ResourceData) []string { + tags := d.Get("tags").([]interface{}) + tagsList := make([]string, len(tags)) + for i, tag := range tags { + tagsList[i] = tag.(string) + } + return tagsList +} + +func flattenTagsData(checkTags *sc.Tags) []interface{} { + if checkTags != nil { + cls := make([]interface{}, len(*checkTags)) + + for i, checkTags := range *checkTags { + cl := make(map[string]interface{}) + + cl["id"] = checkTags.ID + cl["name"] = checkTags.Name + + cls[i] = cl + } + + return cls + } + + return make([]interface{}, 0) + +} + +func flattenBlackoutData(checkBlackout *sc.BlackoutPeriods) []interface{} { + if checkBlackout != nil { + cls := make([]interface{}, len(*checkBlackout)) + + for i, checkBlackout := range *checkBlackout { + cl := make(map[string]interface{}) + + cl["start_date"] = checkBlackout.StartDate + cl["end_date"] = checkBlackout.EndDate + cl["timezone"] = checkBlackout.Timezone + cl["start_time"] = checkBlackout.StartTime + cl["end_time"] = checkBlackout.EndTime + cl["repeat_type"] = checkBlackout.RepeatType + cl["duration_in_minutes"] = checkBlackout.DurationInMinutes + cl["is_repeat"] = checkBlackout.IsRepeat + cl["monthly_repeat_type"] = checkBlackout.MonthlyRepeatType + cl["created_at"] = checkBlackout.CreatedAt + cl["updated_at"] = checkBlackout.UpdatedAt + + cls[i] = cl + } + return cls + } + + return make([]interface{}, 0) +} + +func buildNotificationsData(notifications sc.Notifications, d *schema.ResourceData) sc.Notifications { + notificationData := d.Get("notifications").(*schema.Set).List() + for _, notif := range notificationData { + notif := notif.(map[string]interface{}) + notifications.Sms = notif["sms"].(bool) + notifications.Call = notif["call"].(bool) + notifications.Email = notif["email"].(bool) + notifications.NotifyAfterFailureCount = notif["notify_after_failure_count"].(int) + notifications.NotifyOnLocationFailure = notif["notify_on_location_failure"].(bool) + notifications.NotifyWho = buildNotifyWhoData(notif["notify_who"].(*schema.Set).List()) + notifications.Escalations = buildEscalationsData(notif["escalations"].(*schema.Set).List()) + } + return notifications +} + +func flattenNotificationsData(checkNotifications *sc.Notifications) []interface{} { + notifications := make(map[string]interface{}) + + notifications["sms"] = checkNotifications.Sms + notifications["call"] = checkNotifications.Call + notifications["email"] = checkNotifications.Email + notifications["notify_after_failure_count"] = checkNotifications.NotifyAfterFailureCount + notifications["notify_on_location_failure"] = checkNotifications.NotifyOnLocationFailure + notifications["muted"] = checkNotifications.Muted + + checkNotifyWho := flattenNotifyWhoData(checkNotifications.NotifyWho) + notifications["notify_who"] = checkNotifyWho + + checkNotificationWindows := flattenNotificationWindowsData(&checkNotifications.NotificationWindows) + notifications["notification_windows"] = checkNotificationWindows + + checkEscalations := flattenEscalationsData(checkNotifications.Escalations) + notifications["escalations"] = checkEscalations + + return []interface{}{notifications} +} + +func buildNotifyWhoData(notifyWhoCrit []interface{}) []sc.NotifyWho { + notifyWhoList := make([]sc.NotifyWho, len(notifyWhoCrit)) + for i, notifyWho := range notifyWhoCrit { + notifyWho := notifyWho.(map[string]interface{}) + notif := sc.NotifyWho{ + Sms: notifyWho["sms"].(bool), + Call: notifyWho["call"].(bool), + Email: notifyWho["email"].(bool), + CustomUserEmail: notifyWho["custom_user_email"].(string), + Type: notifyWho["type"].(string), + ID: notifyWho["id"].(int), + } + notifyWhoList[i] = notif + + } + return notifyWhoList +} + +func flattenNotifyWhoData(checkNotifyWho []sc.NotifyWho) []interface{} { + if checkNotifyWho != nil { + cls := make([]interface{}, len(checkNotifyWho)) + + for i, checkNotifyWho := range checkNotifyWho { + cl := make(map[string]interface{}) + + if val := checkNotifyWho.Sms; val { + cl["sms"] = checkNotifyWho.Sms + } + if val := checkNotifyWho.Call; val { + cl["call"] = checkNotifyWho.Call + } + if val := checkNotifyWho.Email; val { + cl["email"] = checkNotifyWho.Email + } + if checkNotifyWho.CustomUserEmail != "" { + cl["custom_user_email"] = checkNotifyWho.CustomUserEmail + } + if checkNotifyWho.Type != "" { + cl["type"] = checkNotifyWho.Type + } + if checkNotifyWho.ID != 0 { + cl["id"] = checkNotifyWho.ID + } + + checkNotifyWhoLinks := flattenLinkData(&checkNotifyWho.Links) + cl["links"] = checkNotifyWhoLinks + + cls[i] = cl + } + + return cls + } + + return make([]interface{}, 0) +} + +func flattenNotificationWindowsData(checkNotificationWindows *sc.NotificationWindows) []interface{} { + if checkNotificationWindows != nil { + cls := make([]interface{}, len(*checkNotificationWindows)) + + for i, checkNotificationWindows := range *checkNotificationWindows { + cl := make(map[string]interface{}) + + cl["start_time"] = checkNotificationWindows.StartTime + cl["end_time"] = checkNotificationWindows.EndTime + cl["duration_in_minutes"] = checkNotificationWindows.DurationInMinutes + cl["time_zone"] = checkNotificationWindows.TimeZone + + cls[i] = cl + } + + return cls + } + + return make([]interface{}, 0) +} + +func flattenNotificationWindowData(checkNotificationWindow *sc.NotificationWindow) []interface{} { + notificationWindow := make(map[string]interface{}) + + notificationWindow["start_time"] = checkNotificationWindow.StartTime + notificationWindow["end_time"] = checkNotificationWindow.EndTime + notificationWindow["duration_in_minutes"] = checkNotificationWindow.DurationInMinutes + notificationWindow["time_zone"] = checkNotificationWindow.TimeZone + + return []interface{}{notificationWindow} +} + +func buildConnectionData(d *schema.ResourceData) sc.Connection { + connectionData := d.Get("check_connection").(*schema.Set).List() + var connection sc.Connection + for _, connect := range connectionData { + connect := connect.(map[string]interface{}) + connection.DownloadBandwidth = connect["download_bandwidth"].(int) + connection.UploadBandwidth = connect["upload_bandwidth"].(int) + connection.Latency = connect["latency"].(int) + connection.PacketLoss = connect["packet_loss"].(float64) + } + return connection +} + +func flattenConnectionData(checkConnection *sc.Connection) []interface{} { + connection := make(map[string]interface{}) + + connection["download_bandwidth"] = checkConnection.DownloadBandwidth + connection["upload_bandwidth"] = checkConnection.UploadBandwidth + connection["latency"] = checkConnection.Latency + connection["packet_loss"] = checkConnection.PacketLoss + + return []interface{}{connection} +} + +func buildIntegrationsData(d *schema.ResourceData) []int { + integrations := d.Get("integrations").([]interface{}) + integrationList := make([]int, len(integrations)) + for i, integration := range integrations { + integrationList[i] = integration.(int) + } + return integrationList +} + +func flattenIntegrationsData(checkIntegrations *sc.Integrations) []interface{} { + if checkIntegrations != nil { + cls := make([]interface{}, len(*checkIntegrations)) + + for i, checkIntegrations := range *checkIntegrations { + cl := make(map[string]interface{}) + + cl["id"] = checkIntegrations.ID + cl["name"] = checkIntegrations.Name + + cls[i] = cl + } + + return cls + } + + return make([]interface{}, 0) + +} + +func buildLocationsData(d *schema.ResourceData) []int { + locations := d.Get("locations").([]interface{}) + locationList := make([]int, len(locations)) + for i, location := range locations { + locationList[i] = location.(int) + } + return locationList +} + +func flattenLocationsData(checkLocations *sc.Locations) []interface{} { + if checkLocations != nil { + cls := make([]interface{}, len(*checkLocations)) + + for i, checkLocations := range *checkLocations { + cl := make(map[string]interface{}) + + cl["id"] = checkLocations.ID + cl["name"] = checkLocations.Name + cl["world_region"] = checkLocations.WorldRegion + cl["region_code"] = checkLocations.RegionCode + + cls[i] = cl + } + + return cls + } + + return make([]interface{}, 0) +} + +func buildSuccessCriteriaData(d *schema.ResourceData) []sc.SuccessCriteria { + + successCrit := d.Get("success_criteria").(*schema.Set).List() + successList := make([]sc.SuccessCriteria, len(successCrit)) + for i, success := range successCrit { + success := success.(map[string]interface{}) + suc := sc.SuccessCriteria{ + ActionType: success["action_type"].(string), + ComparisonString: success["comparison_string"].(string), + CreatedAt: success["created_at"].(string), + UpdatedAt: success["updated_at"].(string), + } + successList[i] = suc + } + return successList +} + +func flattenSuccessCriteriaData(checkSuccessCriteria *[]sc.SuccessCriteria) []interface{} { + if checkSuccessCriteria != nil { + cls := make([]interface{}, len(*checkSuccessCriteria)) + + for i, checkSuccessCriteria := range *checkSuccessCriteria { + cl := make(map[string]interface{}) + + cl["action_type"] = checkSuccessCriteria.ActionType + cl["created_at"] = checkSuccessCriteria.CreatedAt + cl["updated_at"] = checkSuccessCriteria.UpdatedAt + cl["comparison_string"] = checkSuccessCriteria.ComparisonString + + cls[i] = cl + } + + return cls + } + + return make([]interface{}, 0) + +} + +func buildEscalationsData(escalations []interface{}) []sc.Escalations { + escalationsList := make([]sc.Escalations, len(escalations)) + for i, escalation := range escalations { + escalation := escalation.(map[string]interface{}) + esca := sc.Escalations{ + Sms: escalation["sms"].(bool), + Email: escalation["email"].(bool), + Call: escalation["call"].(bool), + AfterMinutes: escalation["after_minutes"].(int), + NotifyWho: buildNotifyWhoData(escalation["notify_who"].(*schema.Set).List()), + } + escalationsList[i] = esca + + } + return escalationsList +} + +func flattenEscalationsData(checkEscalations []sc.Escalations) []interface{} { + if checkEscalations != nil { + cls := make([]interface{}, len(checkEscalations)) + + for i, checkEscalations := range checkEscalations { + cl := make(map[string]interface{}) + + cl["sms"] = checkEscalations.Sms + cl["call"] = checkEscalations.Call + cl["email"] = checkEscalations.Email + cl["after_minutes"] = checkEscalations.AfterMinutes + cl["is_repeat"] = checkEscalations.IsRepeat + checkNotifyWho := flattenNotifyWhoData(checkEscalations.NotifyWho) + cl["notify_who"] = checkNotifyWho + checkNotificationWindow := flattenNotificationWindowData(&checkEscalations.NotificationWindow) + cl["notification_window"] = checkNotificationWindow + + cls[i] = cl + } + return cls + } + + return make([]interface{}, 0) +} + +func buildViewportData(d *schema.ResourceData) sc.Viewport { + viewportData := d.Get("viewport").(*schema.Set).List() + var viewport sc.Viewport + for _, view := range viewportData { + view := view.(map[string]interface{}) + viewport.Height = view["height"].(int) + viewport.Width = view["width"].(int) + } + return viewport +} + +func buildStepData(d *schema.ResourceData) []sc.Steps { + // This part of Rigor is not accessible from the public API and does not currently work. + steps := d.Get("steps").(*schema.Set).List() + stepsList := make([]sc.Steps, len(steps)) + for i, step := range steps { + step := step.(map[string]interface{}) + ste := sc.Steps{ + ItemMethod: step["item_method"].(string), + Value: step["value"].(string), + How: step["how"].(string), + What: step["what"].(string), + VariableName: step["variable_name"].(string), + Name: step["name"].(string), + Position: step["position"].(int), + } + stepsList[i] = ste + } + return stepsList +} + +func flattenStepData(checkSteps []sc.Steps) []interface{} { + if checkSteps != nil { + steps := make([]interface{}, len(checkSteps)) + + for i, checkStep := range checkSteps { + step := make(map[string]interface{}) + + step["item_method"] = checkStep.ItemMethod + step["value"] = checkStep.Value + step["how"] = checkStep.How + step["what"] = checkStep.What + step["variable_name"] = checkStep.VariableName + step["name"] = checkStep.Name + step["position"] = checkStep.Position + + steps[i] = step + } + + return steps + } + + return make([]interface{}, 0) +} + +func buildCookieData(d *schema.ResourceData) []sc.Cookies { + + cookies := d.Get("cookies").(*schema.Set).List() + cookiesList := make([]sc.Cookies, len(cookies)) + for i, cookie := range cookies { + cookie := cookie.(map[string]interface{}) + cke := sc.Cookies{ + Key: cookie["key"].(string), + Value: cookie["value"].(string), + Domain: cookie["domain"].(string), + Path: cookie["path"].(string), + } + cookiesList[i] = cke + } + return cookiesList +} + +func buildDnsOverridesData(d *schema.ResourceData) sc.DNSOverrides { + dnsOverridesData := d.Get("dns_overrides").(*schema.Set).List() + var dnsOverrides sc.DNSOverrides + for _, dns := range dnsOverridesData { + dns := dns.(map[string]interface{}) + dnsOverrides.OriginalDomainCom = dns["original_domain"].(string) + dnsOverrides.OriginalHostCom = dns["original_host"].(string) + } + return dnsOverrides +} + +func buildThresholdMonitorsData(d *schema.ResourceData) []sc.ThresholdMonitors { + + thresholdMonitors := d.Get("threshold_monitors").(*schema.Set).List() + thresholdMonitorsList := make([]sc.ThresholdMonitors, len(thresholdMonitors)) + for i, thresholdMonitor := range thresholdMonitors { + thresholdMonitor := thresholdMonitor.(map[string]interface{}) + thm := sc.ThresholdMonitors{ + Matcher: thresholdMonitor["matcher"].(string), + MetricName: thresholdMonitor["metric_name"].(string), + ComparisonType: thresholdMonitor["comparison_type"].(string), + Value: thresholdMonitor["value"].(int), + } + thresholdMonitorsList[i] = thm + } + return thresholdMonitorsList +} + +func buildJavascriptFilesData(d *schema.ResourceData) []sc.JavascriptFiles { + // This part of Rigor is not accessible from the public API and does not currently work. + javascriptFiles := d.Get("javascript_files").(*schema.Set).List() + javascriptFilesList := make([]sc.JavascriptFiles, len(javascriptFiles)) + for i, javascriptFile := range javascriptFiles { + javascriptFile := javascriptFile.(map[string]interface{}) + thm := sc.JavascriptFiles{ + ID: javascriptFile["id"].(int), + Name: javascriptFile["name"].(string), + } + javascriptFilesList[i] = thm + } + return javascriptFilesList +} + +func buildExcludedFilesData(d *schema.ResourceData) []sc.ExcludedFiles { + excludedFiles := d.Get("excluded_files").(*schema.Set).List() + excludedFilesList := make([]sc.ExcludedFiles, len(excludedFiles)) + for i, excludedFile := range excludedFiles { + excludedFile := excludedFile.(map[string]interface{}) + exf := sc.ExcludedFiles{ + ExclusionType: excludedFile["exclusion_type"].(string), + PresetName: excludedFile["preset_name"].(string), + URL: excludedFile["pattern"].(string), + } + excludedFilesList[i] = exf + } + return excludedFilesList +}