From e93d58192fa6297be19a7e47b437bcc693f6d703 Mon Sep 17 00:00:00 2001 From: HashiCorp Cloud Services <> Date: Wed, 15 Mar 2023 04:55:38 +0000 Subject: [PATCH] Sync with public Provider --- .copywrite.hcl | 22 + .goreleaser.yml | 3 + .release/release-metadata.hcl | 3 + CHANGELOG.md | 42 + GNUmakefile | 5 +- docs/data-sources/consul_cluster.md | 10 + docs/index.md | 2 +- docs/resources/consul_cluster.md | 15 +- docs/resources/packer_channel.md | 120 +++ docs/resources/vault_cluster.md | 2 +- examples/provider/provider.tf | 2 +- .../resources/hcp_packer_channel/import.sh | 2 + .../resources/hcp_packer_channel/resource.tf | 4 + .../hcp_packer_channel/resource_assignment.tf | 27 + .../resource_using_latest_channel.tf | 12 + go.mod | 55 +- go.sum | 429 ++-------- golangci-config.yml | 3 + internal/clients/boundary_cluster.go | 7 +- internal/clients/client.go | 21 +- internal/clients/consul_cluster.go | 3 + internal/clients/consul_snapshot.go | 3 + internal/clients/hvn.go | 7 +- internal/clients/hvn_route.go | 7 +- internal/clients/logging.go | 3 + internal/clients/operation.go | 5 +- internal/clients/packer.go | 100 ++- internal/clients/peering.go | 7 +- internal/clients/project.go | 9 +- internal/clients/response.go | 3 + internal/clients/retry_request.go | 7 +- internal/clients/retry_request_test.go | 3 + internal/clients/tgw.go | 7 +- internal/clients/vault_cluster.go | 3 + internal/consul/version.go | 3 + internal/consul/version_test.go | 3 + internal/input/input.go | 3 + internal/input/input_test.go | 3 + .../data_source_aws_network_peering.go | 5 +- ...a_source_aws_transit_gateway_attachment.go | 5 +- .../data_source_azure_peering_connection.go | 5 +- .../provider/data_source_boundary_cluster.go | 3 + .../data_source_consul_agent_helm_config.go | 3 + ...a_source_consul_agent_kubernetes_secret.go | 3 + .../provider/data_source_consul_cluster.go | 36 + .../provider/data_source_consul_versions.go | 3 + internal/provider/data_source_hvn.go | 3 + .../data_source_hvn_peering_connection.go | 3 + internal/provider/data_source_hvn_route.go | 3 + internal/provider/data_source_packer_image.go | 3 + .../data_source_packer_image_iteration.go | 3 + ...data_source_packer_image_iteration_test.go | 9 +- .../provider/data_source_packer_image_test.go | 19 +- .../provider/data_source_packer_iteration.go | 3 + .../data_source_packer_iteration_test.go | 3 + .../provider/data_source_vault_cluster.go | 3 + internal/provider/link.go | 3 + internal/provider/link_test.go | 3 + internal/provider/peering.go | 3 + internal/provider/peering_test.go | 3 + internal/provider/provider.go | 14 +- internal/provider/provider_test.go | 18 +- .../provider/resource_aws_network_peering.go | 7 +- .../resource_aws_network_peering_test.go | 3 + ...resource_aws_transit_gateway_attachment.go | 7 +- ...rce_aws_transit_gateway_attachment_test.go | 3 + .../resource_azure_peering_connection.go | 7 +- .../resource_azure_peering_connection_test.go | 7 +- .../provider/resource_boundary_cluster.go | 5 +- .../resource_boundary_cluster_test.go | 3 + internal/provider/resource_consul_cluster.go | 99 ++- .../resource_consul_cluster_root_token.go | 3 + .../provider/resource_consul_cluster_test.go | 97 ++- internal/provider/resource_consul_snapshot.go | 3 + .../provider/resource_consul_snapshot_test.go | 3 + internal/provider/resource_hvn.go | 7 +- .../resource_hvn_peering_connection.go | 7 +- .../resource_hvn_peering_connection_test.go | 3 + internal/provider/resource_hvn_route.go | 5 +- internal/provider/resource_hvn_route_test.go | 3 + internal/provider/resource_hvn_test.go | 4 +- internal/provider/resource_packer_channel.go | 380 +++++++++ .../provider/resource_packer_channel_test.go | 247 ++++++ internal/provider/resource_vault_cluster.go | 9 +- .../resource_vault_cluster_admin_token.go | 3 + .../resource_vault_cluster_config_test.go | 3 + .../resource_vault_cluster_const_test.go | 111 +++ ...rce_vault_cluster_perf_replication_test.go | 369 +++++++++ .../provider/resource_vault_cluster_test.go | 760 ++++++------------ internal/provider/test_helpers.go | 3 + internal/provider/validators.go | 40 + internal/provider/validators_test.go | 79 +- main.go | 3 + scripts/changelog-links.sh | 3 + scripts/gofmtcheck.sh | 3 + templates/resources/packer_channel.md.tmpl | 32 + tools/tools.go | 3 + version/version.go | 3 + 98 files changed, 2446 insertions(+), 1005 deletions(-) create mode 100644 .copywrite.hcl create mode 100644 docs/resources/packer_channel.md create mode 100644 examples/resources/hcp_packer_channel/import.sh create mode 100644 examples/resources/hcp_packer_channel/resource.tf create mode 100644 examples/resources/hcp_packer_channel/resource_assignment.tf create mode 100644 examples/resources/hcp_packer_channel/resource_using_latest_channel.tf create mode 100644 internal/provider/resource_packer_channel.go create mode 100644 internal/provider/resource_packer_channel_test.go create mode 100644 internal/provider/resource_vault_cluster_const_test.go create mode 100644 internal/provider/resource_vault_cluster_perf_replication_test.go create mode 100644 templates/resources/packer_channel.md.tmpl diff --git a/.copywrite.hcl b/.copywrite.hcl new file mode 100644 index 000000000..1ed8b00f3 --- /dev/null +++ b/.copywrite.hcl @@ -0,0 +1,22 @@ +# Overrides the copywrite config schema version +# Default: 1 +schema_version = 1 + +project { + # SPDX-compatible license identifier + # Leave blank if you don't wish to license the project + # Default: "MPL-2.0" + # license = "" + + # Represents the year that the project initially began + # Default: + # copyright_year = 0 + + # A list of globs that should not have copyright or license headers + # Supports doublestar glob patterns for more flexibility in defining which + # files or folders should be ignored + # Default: [] + header_ignore = [ + "examples/**" + ] +} diff --git a/.goreleaser.yml b/.goreleaser.yml index 3e1157c78..091624871 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + archives: - files: # Ensure only built binary is archived diff --git a/.release/release-metadata.hcl b/.release/release-metadata.hcl index 1435e855a..7e5fa9ea2 100644 --- a/.release/release-metadata.hcl +++ b/.release/release-metadata.hcl @@ -1,2 +1,5 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + url_source_repository = "https://github.com/hashicorp/terraform-provider-hcp" url_license = "https://github.com/hashicorp/terraform-provider-hcp/blob/main/LICENSE" diff --git a/CHANGELOG.md b/CHANGELOG.md index debd3dfb5..80a979ca4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,45 @@ +## v0.56.0 (March 15, 2023) + +IMPROVEMENTS: + +* Bump github.com/hashicorp/hcp-sdk-go from 0.35.0 to 0.37.0 [[GH-482](https://github.com/hashicorp/terraform-provider-hcp/pull/482)] + +BUG FIXES: + +* Update pricing information for vault and consul. [[GH-480](https://github.com/hashicorp/terraform-provider-hcp/pull/480)] +## v0.55.0 (March 08, 2023) + +FEATURES: + +* New field `ip_allowlist` for `hcp_consul_cluster` to create, or update allowed IP address ranges (CIDRs) for inbound traffic. [[GH-455](https://github.com/hashicorp/terraform-provider-hcp/pull/455)] + +IMPROVEMENTS: + +* Add cluster scaling acceptance tests for Azure [[GH-465](https://github.com/hashicorp/terraform-provider-hcp/pull/465)] +* Bump github.com/hashicorp/hcp-sdk-go from 0.31.0 to 0.35.0 [[GH-458](https://github.com/hashicorp/terraform-provider-hcp/pull/458)] +* Bump github.com/hashicorp/terraform-plugin-sdk/v2 from 2.24.1 to 2.25.0 [[GH-459](https://github.com/hashicorp/terraform-provider-hcp/pull/459)] +* Bump google.golang.org/grpc from 1.52.3 to 1.53.0 [[GH-452](https://github.com/hashicorp/terraform-provider-hcp/pull/452)] + +BUG FIXES: + +* resource/hcp_packer_channel: Fix documentation for incorrectly documented attributes [[GH-462](https://github.com/hashicorp/terraform-provider-hcp/pull/462)] +## v0.54.0 (February 15, 2023) + +FEATURES: + +* New resource `hcp_packer_channel` to create, or update an existing, channel with or without an assigned iteration. [[GH-435](https://github.com/hashicorp/terraform-provider-hcp/pull/435)] + +IMPROVEMENTS: + +* Bump github.com/hashicorp/hcp-sdk-go from 0.28.0 to 0.29.0 [[GH-431](https://github.com/hashicorp/terraform-provider-hcp/pull/431)] +* Bump github.com/hashicorp/hcp-sdk-go from 0.29.0 to 0.31.0 [[GH-445](https://github.com/hashicorp/terraform-provider-hcp/pull/445)] +* Bump google.golang.org/grpc from 1.51.0 to 1.52.3 [[GH-444](https://github.com/hashicorp/terraform-provider-hcp/pull/444)] +* Refactor HCP Vault TF acceptance test harness to include test for Azure [[GH-441](https://github.com/hashicorp/terraform-provider-hcp/pull/441)] +* resource/hcp_packer_channel: Label resource as public beta [[GH-457](https://github.com/hashicorp/terraform-provider-hcp/pull/457)] + +BUG FIXES: + +* Do not exit acceptance test when provider returns a warning [[GH-448](https://github.com/hashicorp/terraform-provider-hcp/pull/448)] ## v0.53.0 (January 20, 2023) FEATURES: diff --git a/GNUmakefile b/GNUmakefile index f829e77b8..c96f79c85 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -5,6 +5,7 @@ BUILD_ALL_PATH=${PWD}/bin TEST?=./internal/... GO_LINT ?= golangci-lint GO_LINT_CONFIG_PATH ?= ./golangci-config.yml +TIMEOUT?=360m ifeq ($(GOOS), darwin) INSTALL_PATH=~/Library/Application\ Support/io.terraform/plugins/localhost/providers/hcp/0.0.1/darwin_$(GOARCH) @@ -51,7 +52,7 @@ testacc: fmtcheck echo "See the contributing guide for more information: https://github.com/hashicorp/terraform-provider-hcp/blob/main/contributing/writing-tests.md"; \ exit 1; \ fi - TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 210m + TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout $(TIMEOUT) -parallel=10 testacc-ci: fmtcheck @if [ "$(TESTARGS)" = "-run=TestAccXXX" ]; then \ @@ -64,7 +65,7 @@ testacc-ci: fmtcheck echo "See the contributing guide for more information: https://github.com/hashicorp/terraform-provider-hcp/blob/main/contributing/writing-tests.md"; \ exit 1; \ fi - TF_ACC=1 go test -short -coverprofile=coverage-e2e.out $(TEST) -v $(TESTARGS) -timeout 360m + TF_ACC=1 go test -short -coverprofile=coverage-e2e.out $(TEST) -v $(TESTARGS) -timeout $(TIMEOUT) -parallel=10 go tool cover -html=coverage-e2e.out -o coverage-e2e.html depscheck: diff --git a/docs/data-sources/consul_cluster.md b/docs/data-sources/consul_cluster.md index 9d478dff3..ee64c3b95 100644 --- a/docs/data-sources/consul_cluster.md +++ b/docs/data-sources/consul_cluster.md @@ -45,6 +45,7 @@ data "hcp_consul_cluster" "example" { - `datacenter` (String) The Consul data center name of the cluster. If not specified, it is defaulted to the value of `cluster_id`. - `hvn_id` (String) The ID of the HVN this HCP Consul cluster is associated to. - `id` (String) The ID of this resource. +- `ip_allowlist` (List of Object) Allowed IPV4 address ranges (CIDRs) for inbound traffic. Each entry must be a unique CIDR. Maximum 3 CIDRS supported at this time. (see [below for nested schema](#nestedatt--ip_allowlist)) - `organization_id` (String) The ID of the organization the project for this HCP Consul cluster is located. - `primary_link` (String) The `self_link` of the HCP Consul cluster which is the primary in the federation setup with this HCP Consul cluster. If not specified, it is a standalone cluster. - `project_id` (String) The ID of the project this HCP Consul cluster is located. @@ -64,3 +65,12 @@ Optional: - `default` (String) + +### Nested Schema for `ip_allowlist` + +Read-Only: + +- `address` (String) +- `description` (String) + + diff --git a/docs/index.md b/docs/index.md index 6e605f8fd..2550bce60 100644 --- a/docs/index.md +++ b/docs/index.md @@ -38,7 +38,7 @@ terraform { required_providers { hcp = { source = "hashicorp/hcp" - version = "~> 0.53.0" + version = "~> 0.56.0" } } } diff --git a/docs/resources/consul_cluster.md b/docs/resources/consul_cluster.md index 6bad11375..575077a93 100644 --- a/docs/resources/consul_cluster.md +++ b/docs/resources/consul_cluster.md @@ -34,13 +34,14 @@ resource "hcp_consul_cluster" "example" { - `cluster_id` (String) The ID of the HCP Consul cluster. - `hvn_id` (String) The ID of the HVN this HCP Consul cluster is associated to. -- `tier` (String) The tier that the HCP Consul cluster will be provisioned as. Only `development`, `standard` and `plus` are available at this time. See [pricing information](https://cloud.hashicorp.com/pricing/consul). +- `tier` (String) The tier that the HCP Consul cluster will be provisioned as. Only `development`, `standard` and `plus` are available at this time. See [pricing information](https://www.hashicorp.com/products/consul/pricing). ### Optional - `auto_hvn_to_hvn_peering` (Boolean) Enables automatic HVN to HVN peering when creating a secondary cluster in a federation. The alternative to using the auto-accept feature is to create an [`hcp_hvn_peering_connection`](hvn_peering_connection.md) resource that explicitly defines the HVN resources that are allowed to communicate with each other. - `connect_enabled` (Boolean) Denotes the Consul connect feature should be enabled for this cluster. Default to true. - `datacenter` (String) The Consul data center name of the cluster. If not specified, it is defaulted to the value of `cluster_id`. +- `ip_allowlist` (Block List, Max: 3) Allowed IPV4 address ranges (CIDRs) for inbound traffic. Each entry must be a unique CIDR. Maximum 3 CIDRS supported at this time. (see [below for nested schema](#nestedblock--ip_allowlist)) - `min_consul_version` (String) The minimum Consul patch version of the cluster. Allows only the rightmost version component to increment (E.g: `1.13.0` will allow installation of `1.13.2` and `1.13.3` etc., but not `1.14.0`). If not specified, it is defaulted to the version that is currently recommended by HCP. - `primary_link` (String) The `self_link` of the HCP Consul cluster which is the primary in the federation setup with this HCP Consul cluster. If not specified, it is a standalone cluster. - `public_endpoint` (Boolean) Denotes that the cluster has a public endpoint for the Consul UI. Defaults to false. @@ -68,6 +69,18 @@ resource "hcp_consul_cluster" "example" { - `self_link` (String) A unique URL identifying the HCP Consul cluster. - `state` (String) The state of the HCP Consul cluster. + +### Nested Schema for `ip_allowlist` + +Required: + +- `address` (String) IP address range in CIDR notation. + +Optional: + +- `description` (String) Description to help identify source (maximum 255 chars). + + ### Nested Schema for `timeouts` diff --git a/docs/resources/packer_channel.md b/docs/resources/packer_channel.md new file mode 100644 index 000000000..eb93a1c97 --- /dev/null +++ b/docs/resources/packer_channel.md @@ -0,0 +1,120 @@ +--- +page_title: "Resource hcp_packer_channel - terraform-provider-hcp" +subcategory: "" +description: |- + The Packer Channel resource allows you to manage image bucket channels within an active HCP Packer Registry. +--- + +# hcp_packer_channel (Resource) + +-> **Note:** This resource is currently in public beta. + +The Packer Channel resource allows you to manage image bucket channels within an active HCP Packer Registry. + +## Example Usage + +To create a channel with no assigned iteration. +```terraform +resource "hcp_packer_channel" "staging" { + name = "staging" + bucket_name = "alpine" +} +``` + +To create, or update an existing, channel with an assigned iteration. +```terraform +resource "hcp_packer_channel" "staging" { + name = "staging" + bucket_name = "alpine" + iteration { + id = "iteration-id" + } +} + +# Update assigned iteration using an iteration fingerprint +resource "hcp_packer_channel" "staging" { + name = "staging" + bucket_name = "alpine" + iteration { + fingerprint = "fingerprint-associated-to-iteration" + } +} + +# Update assigned iteration using an iteration incremental version +resource "hcp_packer_channel" "staging" { + name = "staging" + bucket_name = "alpine" + iteration { + // incremental_version is the version number assigned to a completed iteration. + incremental_version = 1 + } +} +``` + +Using the latest channel to create a new channel with an assigned iteration. +```terraform +data "hcp_packer_image_iteration" "latest" { + bucket_name = "alpine" + channel = "latest" +} + +resource "hcp_packer_channel" "staging" { + name = staging + bucket_name = alpine + iteration { + id = data.hcp_packer_image_iteration.latest.id + } +} +``` + + + +## Schema + +### Required + +- `bucket_name` (String) The slug of the HCP Packer Registry image bucket where the channel should be created in. +- `name` (String) The name of the channel being managed. + +### Optional + +- `iteration` (Block List, Max: 1) The iteration assigned to the channel. (see [below for nested schema](#nestedblock--iteration)) +- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) + +### Read-Only + +- `author_id` (String) The author of this channel. +- `created_at` (String) The creation time of this channel. +- `id` (String) The ID of this resource. +- `organization_id` (String) The ID of the HCP organization where this channel is located in. +- `project_id` (String) The ID of the HCP project where this channel is located in. +- `updated_at` (String) The time this channel was last updated. + + +### Nested Schema for `iteration` + +Optional: + +- `fingerprint` (String) The fingerprint of the iteration assigned to the channel. +- `id` (String) The ID of the iteration assigned to the channel. +- `incremental_version` (Number) The incremental_version of the iteration assigned to the channel. + + + +### Nested Schema for `timeouts` + +Optional: + +- `create` (String) +- `default` (String) +- `delete` (String) +- `update` (String) + +## Import + +Import is supported using the following syntax: + +```shell +# The import ID requires the bucket and channel name in the following format {bucket_name}:{name} +terraform import hcp_packer_channel.staging alpine:staging +``` diff --git a/docs/resources/vault_cluster.md b/docs/resources/vault_cluster.md index 451fbc7b0..8cb71267b 100644 --- a/docs/resources/vault_cluster.md +++ b/docs/resources/vault_cluster.md @@ -56,7 +56,7 @@ resource "hcp_vault_cluster" "example" { - `paths_filter` (List of String) The performance replication [paths filter](https://developer.hashicorp.com/vault/tutorials/cloud-ops/vault-replication-terraform). Applies to performance replication secondaries only and operates in "deny" mode only. - `primary_link` (String) The `self_link` of the HCP Vault Plus tier cluster which is the primary in the performance replication setup with this HCP Vault Plus tier cluster. If not specified, it is a standalone Plus tier HCP Vault cluster. - `public_endpoint` (Boolean) Denotes that the cluster has a public endpoint. Defaults to false. -- `tier` (String) Tier of the HCP Vault cluster. Valid options for tiers - `dev`, `starter_small`, `standard_small`, `standard_medium`, `standard_large`, `plus_small`, `plus_medium`, `plus_large`. See [pricing information](https://cloud.hashicorp.com/pricing/vault). Changing a cluster's size or tier is only available to admins. See [Scale a cluster](https://registry.terraform.io/providers/hashicorp/hcp/latest/docs/guides/vault-scaling). +- `tier` (String) Tier of the HCP Vault cluster. Valid options for tiers - `dev`, `starter_small`, `standard_small`, `standard_medium`, `standard_large`, `plus_small`, `plus_medium`, `plus_large`. See [pricing information](https://www.hashicorp.com/products/vault/pricing). Changing a cluster's size or tier is only available to admins. See [Scale a cluster](https://registry.terraform.io/providers/hashicorp/hcp/latest/docs/guides/vault-scaling). - `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) ### Read-Only diff --git a/examples/provider/provider.tf b/examples/provider/provider.tf index 1e9841d0b..3401ba6b2 100644 --- a/examples/provider/provider.tf +++ b/examples/provider/provider.tf @@ -3,7 +3,7 @@ terraform { required_providers { hcp = { source = "hashicorp/hcp" - version = "~> 0.53.0" + version = "~> 0.56.0" } } } diff --git a/examples/resources/hcp_packer_channel/import.sh b/examples/resources/hcp_packer_channel/import.sh new file mode 100644 index 000000000..67b5d9509 --- /dev/null +++ b/examples/resources/hcp_packer_channel/import.sh @@ -0,0 +1,2 @@ +# The import ID requires the bucket and channel name in the following format {bucket_name}:{name} +terraform import hcp_packer_channel.staging alpine:staging diff --git a/examples/resources/hcp_packer_channel/resource.tf b/examples/resources/hcp_packer_channel/resource.tf new file mode 100644 index 000000000..5518dc1bd --- /dev/null +++ b/examples/resources/hcp_packer_channel/resource.tf @@ -0,0 +1,4 @@ +resource "hcp_packer_channel" "staging" { + name = "staging" + bucket_name = "alpine" +} diff --git a/examples/resources/hcp_packer_channel/resource_assignment.tf b/examples/resources/hcp_packer_channel/resource_assignment.tf new file mode 100644 index 000000000..56b18f8ff --- /dev/null +++ b/examples/resources/hcp_packer_channel/resource_assignment.tf @@ -0,0 +1,27 @@ +resource "hcp_packer_channel" "staging" { + name = "staging" + bucket_name = "alpine" + iteration { + id = "iteration-id" + } +} + +# Update assigned iteration using an iteration fingerprint +resource "hcp_packer_channel" "staging" { + name = "staging" + bucket_name = "alpine" + iteration { + fingerprint = "fingerprint-associated-to-iteration" + } +} + +# Update assigned iteration using an iteration incremental version +resource "hcp_packer_channel" "staging" { + name = "staging" + bucket_name = "alpine" + iteration { + // incremental_version is the version number assigned to a completed iteration. + incremental_version = 1 + } +} + diff --git a/examples/resources/hcp_packer_channel/resource_using_latest_channel.tf b/examples/resources/hcp_packer_channel/resource_using_latest_channel.tf new file mode 100644 index 000000000..ca6a7ad62 --- /dev/null +++ b/examples/resources/hcp_packer_channel/resource_using_latest_channel.tf @@ -0,0 +1,12 @@ +data "hcp_packer_image_iteration" "latest" { + bucket_name = "alpine" + channel = "latest" +} + +resource "hcp_packer_channel" "staging" { + name = staging + bucket_name = alpine + iteration { + id = data.hcp_packer_image_iteration.latest.id + } +} diff --git a/go.mod b/go.mod index 786beca05..9a88112a0 100644 --- a/go.mod +++ b/go.mod @@ -9,19 +9,17 @@ require ( github.com/google/uuid v1.3.0 github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 github.com/hashicorp/go-version v1.6.0 - github.com/hashicorp/hcp-sdk-go v0.28.0 + github.com/hashicorp/hcp-sdk-go v0.37.0 github.com/hashicorp/terraform-plugin-docs v0.13.0 - github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.1 - github.com/stretchr/testify v1.8.1 - google.golang.org/grpc v1.51.0 + github.com/hashicorp/terraform-plugin-sdk/v2 v2.25.0 + github.com/stretchr/testify v1.8.2 + google.golang.org/grpc v1.53.0 ) require ( github.com/Masterminds/goutils v1.1.1 // indirect github.com/Masterminds/semver/v3 v3.1.1 // indirect github.com/Masterminds/sprig/v3 v3.2.2 // indirect - github.com/PuerkitoBio/purell v1.1.1 // indirect - github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect github.com/agext/levenshtein v1.2.2 // indirect github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect github.com/armon/go-radix v1.0.0 // indirect @@ -31,31 +29,31 @@ require ( github.com/fatih/color v1.13.0 // indirect github.com/go-logr/logr v1.2.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/go-openapi/analysis v0.21.2 // indirect + github.com/go-openapi/analysis v0.21.4 // indirect github.com/go-openapi/errors v0.20.3 // indirect github.com/go-openapi/jsonpointer v0.19.5 // indirect - github.com/go-openapi/jsonreference v0.19.6 // indirect - github.com/go-openapi/loads v0.21.1 // indirect - github.com/go-openapi/spec v0.20.4 // indirect - github.com/go-openapi/swag v0.21.1 // indirect - github.com/go-openapi/validate v0.21.0 // indirect + github.com/go-openapi/jsonreference v0.20.0 // indirect + github.com/go-openapi/loads v0.21.2 // indirect + github.com/go-openapi/spec v0.20.8 // indirect + github.com/go-openapi/swag v0.22.3 // indirect + github.com/go-openapi/validate v0.22.1 // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/google/go-cmp v0.5.9 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-checkpoint v0.5.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect - github.com/hashicorp/go-hclog v1.2.1 // indirect + github.com/hashicorp/go-hclog v1.4.0 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect - github.com/hashicorp/go-plugin v1.4.6 // indirect + github.com/hashicorp/go-plugin v1.4.8 // indirect github.com/hashicorp/go-uuid v1.0.3 // indirect - github.com/hashicorp/hc-install v0.4.0 // indirect - github.com/hashicorp/hcl/v2 v2.15.0 // indirect + github.com/hashicorp/hc-install v0.5.0 // indirect + github.com/hashicorp/hcl/v2 v2.16.1 // indirect github.com/hashicorp/logutils v1.0.0 // indirect github.com/hashicorp/terraform-exec v0.17.3 // indirect - github.com/hashicorp/terraform-json v0.14.0 // indirect - github.com/hashicorp/terraform-plugin-go v0.14.1 // indirect - github.com/hashicorp/terraform-plugin-log v0.7.0 // indirect - github.com/hashicorp/terraform-registry-address v0.0.0-20220623143253-7d51757b572c // indirect + github.com/hashicorp/terraform-json v0.15.0 // indirect + github.com/hashicorp/terraform-plugin-go v0.14.3 // indirect + github.com/hashicorp/terraform-plugin-log v0.8.0 // indirect + github.com/hashicorp/terraform-registry-address v0.1.0 // indirect github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 // indirect github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d // indirect github.com/huandu/xstrings v1.3.2 // indirect @@ -64,7 +62,7 @@ require ( github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.16 // indirect - github.com/mitchellh/cli v1.1.4 // indirect + github.com/mitchellh/cli v1.1.5 // indirect github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect @@ -87,13 +85,14 @@ require ( go.mongodb.org/mongo-driver v1.11.0 // indirect go.opentelemetry.io/otel v1.11.1 // indirect go.opentelemetry.io/otel/trace v1.11.1 // indirect - golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d // indirect - golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect - golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58 // indirect - golang.org/x/sys v0.1.0 // indirect - golang.org/x/text v0.4.0 // indirect - google.golang.org/appengine v1.6.6 // indirect - google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d // indirect + golang.org/x/crypto v0.6.0 // indirect + golang.org/x/mod v0.8.0 // indirect + golang.org/x/net v0.8.0 // indirect + golang.org/x/oauth2 v0.6.0 // indirect + golang.org/x/sys v0.6.0 // indirect + golang.org/x/text v0.8.0 // indirect + google.golang.org/appengine v1.6.7 // indirect + google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f // indirect google.golang.org/protobuf v1.28.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index 3dbab2737..c699f100b 100644 --- a/go.sum +++ b/go.sum @@ -1,44 +1,10 @@ -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.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -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/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/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= -github.com/Masterminds/sprig/v3 v3.2.0/go.mod h1:tWhwTbUTndesPNeF0C900vKoq283u6zp4APT9vaF3SI= +github.com/Masterminds/sprig/v3 v3.2.1/go.mod h1:UoaO7Yp8KlPnJIYWTFkMaqPUYKTfGFPhxNuwnnxkKlk= github.com/Masterminds/sprig/v3 v3.2.2 h1:17jRggJu518dr3QaafizSXOjKYp94wKfABxUmyxvxX8= github.com/Masterminds/sprig/v3 v3.2.2/go.mod h1:UoaO7Yp8KlPnJIYWTFkMaqPUYKTfGFPhxNuwnnxkKlk= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= @@ -46,16 +12,13 @@ github.com/Microsoft/go-winio v0.4.16 h1:FtSW/jqD+l4ba5iPBj9CODVtgfYAD8w2wS923g/ 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/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= 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.2 h1:0S/Yg6LYmFJ5stwQeRp6EeOcCbj7xiqQSdNelsXvaqE= github.com/agext/levenshtein v1.2.2/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= -github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0 h1:MzVXffFUye+ZcSR6opIgz9Co7WcDx6ZcY+RjfFHoA0I= 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= @@ -71,22 +34,12 @@ github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -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/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= @@ -101,16 +54,14 @@ github.com/go-git/go-billy/v5 v5.3.1/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI 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-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-openapi/analysis v0.21.2 h1:hXFrOYFHUAMQdu6zwAiKKJHJQ8kqZs1ux/ru1P1wLJU= github.com/go-openapi/analysis v0.21.2/go.mod h1:HZwRk4RRisyG8vx2Oe6aqeSQcoxRp47Xkp3+K6q+LdY= +github.com/go-openapi/analysis v0.21.4 h1:ZDFLvSNxpDaomuCueM0BlSXxpANBlFYiBvr+GXrvIHc= +github.com/go-openapi/analysis v0.21.4/go.mod h1:4zQ35W4neeZTqh3ol0rv/O8JBbka9QyAgQRPp9y3pfo= github.com/go-openapi/errors v0.19.8/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= github.com/go-openapi/errors v0.19.9/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= github.com/go-openapi/errors v0.20.2/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= @@ -119,24 +70,29 @@ github.com/go-openapi/errors v0.20.3/go.mod h1:Z3FlZ4I8jEGxjUK+bugx3on2mIAk4txuA github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.19.6 h1:UBIxjkht+AWIgYzCDSv2GN+E/togfwXUJFRTWhl2Jjs= github.com/go-openapi/jsonreference v0.19.6/go.mod h1:diGHMEHg2IqXZGKxqyvWdfWU/aim5Dprw5bqpKkTvns= -github.com/go-openapi/loads v0.21.1 h1:Wb3nVZpdEzDTcly8S4HMkey6fjARRzb7iEaySimlDW0= +github.com/go-openapi/jsonreference v0.20.0 h1:MYlu0sBgChmCfJxxUKZ8g1cPWFOB37YSZqewK7OKeyA= +github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= github.com/go-openapi/loads v0.21.1/go.mod h1:/DtAMXXneXFjbQMGEtbamCZb+4x7eGwkvZCvBmwUG+g= +github.com/go-openapi/loads v0.21.2 h1:r2a/xFIYeZ4Qd2TnGpWDIQNcP80dIaZgf704za8enro= +github.com/go-openapi/loads v0.21.2/go.mod h1:Jq58Os6SSGz0rzh62ptiu8Z31I+OTHqmULx5e/gJbNw= github.com/go-openapi/runtime v0.25.0 h1:7yQTCdRbWhX8vnIjdzU8S00tBYf7Sg71EBeorlPHvhc= github.com/go-openapi/runtime v0.25.0/go.mod h1:Ux6fikcHXyyob6LNWxtE96hWwjBPYF0DXgVFuMTneOs= -github.com/go-openapi/spec v0.20.4 h1:O8hJrt0UMnhHcluhIdUgCLRWyM2x7QkBXRvOs7m+O1M= github.com/go-openapi/spec v0.20.4/go.mod h1:faYFR1CvsJZ0mNsmsphTMSoRrNV3TEDoAM7FOEWeq8I= +github.com/go-openapi/spec v0.20.6/go.mod h1:2OpW+JddWPrpXSCIX8eOx7lZ5iyuWj3RYR6VaaBKcWA= +github.com/go-openapi/spec v0.20.8 h1:ubHmXNY3FCIOinT8RNrrPfGc9t7I1qhPtdOGoG2AxRU= +github.com/go-openapi/spec v0.20.8/go.mod h1:2OpW+JddWPrpXSCIX8eOx7lZ5iyuWj3RYR6VaaBKcWA= github.com/go-openapi/strfmt v0.21.0/go.mod h1:ZRQ409bWMj+SOgXofQAGTIo2Ebu72Gs+WaRADcS5iNg= github.com/go-openapi/strfmt v0.21.1/go.mod h1:I/XVKeLc5+MM5oPNN7P6urMOpuLXEcNrCX/rPGuWb0k= github.com/go-openapi/strfmt v0.21.3 h1:xwhj5X6CjXEZZHMWy1zKJxvW9AfHC9pkyUjLvHtKG7o= github.com/go-openapi/strfmt v0.21.3/go.mod h1:k+RzNO0Da+k3FrrynSNN8F7n/peCmQQqbbXjtDfvmGg= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-openapi/swag v0.21.1 h1:wm0rhTb5z7qpJRHBdPOMuY4QjVUMbF6/kwoYeRAOrKU= github.com/go-openapi/swag v0.21.1/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-openapi/validate v0.21.0 h1:+Wqk39yKOhfpLqNLEC0/eViCkzM5FVXVqrvt526+wcI= -github.com/go-openapi/validate v0.21.0/go.mod h1:rjnrwK57VJ7A8xqfpAOEKRH8yQSGUriMu5/zuPSQ1hg= +github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= +github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-openapi/validate v0.22.1 h1:G+c2ub6q47kfX1sOBLwIQwzBVt8qmOAARyo/9Fqs9NU= +github.com/go-openapi/validate v0.22.1/go.mod h1:rjnrwK57VJ7A8xqfpAOEKRH8yQSGUriMu5/zuPSQ1hg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= @@ -163,65 +119,24 @@ github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWe github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= -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/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/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= 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/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= 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.1/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.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -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.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/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/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -233,44 +148,41 @@ github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9n 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-hclog v1.2.1 h1:YQsLlGDJgwhXFpucSPyVbCBviQtjlHv3jLTlp8YmtEw= -github.com/hashicorp/go-hclog v1.2.1/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= +github.com/hashicorp/go-hclog v1.4.0 h1:ctuWFGrhFha8BnnzxqeRGidlEcQkDyL5u8J8t5eA11I= +github.com/hashicorp/go-hclog v1.4.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= -github.com/hashicorp/go-plugin v1.4.6 h1:MDV3UrKQBM3du3G7MApDGvOsMYy3JQJ4exhSoKBAeVA= -github.com/hashicorp/go-plugin v1.4.6/go.mod h1:viDMjcLJuDui6pXb8U4HVfb8AamCWhHGUjr2IrTF67s= +github.com/hashicorp/go-plugin v1.4.8 h1:CHGwpxYDOttQOY7HOWgETU9dyVjOXzniXDqJcYJE1zM= +github.com/hashicorp/go-plugin v1.4.8/go.mod h1:viDMjcLJuDui6pXb8U4HVfb8AamCWhHGUjr2IrTF67s= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go-version v1.5.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/go-version v1.6.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/hc-install v0.4.0 h1:cZkRFr1WVa0Ty6x5fTvL1TuO1flul231rWkGH92oYYk= -github.com/hashicorp/hc-install v0.4.0/go.mod h1:5d155H8EC5ewegao9A4PUTMNPZaq+TbOzkJJZ4vrXeI= -github.com/hashicorp/hcl/v2 v2.15.0 h1:CPDXO6+uORPjKflkWCCwoWc9uRp+zSIPcCQ+BrxV7m8= -github.com/hashicorp/hcl/v2 v2.15.0/go.mod h1:JRmR89jycNkrrqnMmvPDMd56n1rQJ2Q6KocSLCMCXng= -github.com/hashicorp/hcp-sdk-go v0.28.0 h1:QO03avWHSp2wkZMYR0ma7kjMkHC70eziz75qJGiuSNU= -github.com/hashicorp/hcp-sdk-go v0.28.0/go.mod h1:BRtYrm9RwAAtnuGU/rwTeAyzKTNH/d4WlHa6eNvcEHQ= +github.com/hashicorp/hc-install v0.5.0 h1:D9bl4KayIYKEeJ4vUDe9L5huqxZXczKaykSRcmQ0xY0= +github.com/hashicorp/hc-install v0.5.0/go.mod h1:JyzMfbzfSBSjoDCRPna1vi/24BEDxFaCPfdHtM5SCdo= +github.com/hashicorp/hcl/v2 v2.16.1 h1:BwuxEMD/tsYgbhIW7UuI3crjovf3MzuFWiVgiv57iHg= +github.com/hashicorp/hcl/v2 v2.16.1/go.mod h1:JRmR89jycNkrrqnMmvPDMd56n1rQJ2Q6KocSLCMCXng= +github.com/hashicorp/hcp-sdk-go v0.37.0 h1:CP2sdNMksK/Xf6EqSF6FDYdA2JVmlJjq4snuFWlC3DE= +github.com/hashicorp/hcp-sdk-go v0.37.0/go.mod h1:hZqky4HEzsKwvLOt4QJlZUrjeQmb4UCZUhDP2HyQFfc= 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.17.3 h1:MX14Kvnka/oWGmIkyuyvL6POx25ZmKrjlaclkx3eErU= github.com/hashicorp/terraform-exec v0.17.3/go.mod h1:+NELG0EqQekJzhvikkeQsOAZpsw0cv/03rbeQJqscAI= -github.com/hashicorp/terraform-json v0.14.0 h1:sh9iZ1Y8IFJLx+xQiKHGud6/TSUCM0N8e17dKDpqV7s= -github.com/hashicorp/terraform-json v0.14.0/go.mod h1:5A9HIWPkk4e5aeeXIBbkcOvaZbIYnAIkEyqP2pNSckM= +github.com/hashicorp/terraform-json v0.15.0 h1:/gIyNtR6SFw6h5yzlbDbACyGvIhKtQi8mTsbkNd79lE= +github.com/hashicorp/terraform-json v0.15.0/go.mod h1:+L1RNzjDU5leLFZkHTFTbJXaoqUC6TqXlFgDoOXrtvk= github.com/hashicorp/terraform-plugin-docs v0.13.0 h1:6e+VIWsVGb6jYJewfzq2ok2smPzZrt1Wlm9koLeKazY= github.com/hashicorp/terraform-plugin-docs v0.13.0/go.mod h1:W0oCmHAjIlTHBbvtppWHe8fLfZ2BznQbuv8+UD8OucQ= -github.com/hashicorp/terraform-plugin-go v0.14.1 h1:cwZzPYla82XwAqpLhSzdVsOMU+6H29tczAwrB0z9Zek= -github.com/hashicorp/terraform-plugin-go v0.14.1/go.mod h1:Bc/K6K26BQ2FHqIELPbpKtt2CzzbQou+0UQF3/0NsCQ= -github.com/hashicorp/terraform-plugin-log v0.7.0 h1:SDxJUyT8TwN4l5b5/VkiTIaQgY6R+Y2BQ0sRZftGKQs= -github.com/hashicorp/terraform-plugin-log v0.7.0/go.mod h1:p4R1jWBXRTvL4odmEkFfDdhUjHf9zcs/BCoNHAc7IK4= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.1 h1:zHcMbxY0+rFO9gY99elV/XC/UnQVg7FhRCbj1i5b7vM= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.1/go.mod h1:+tNlb0wkfdsDJ7JEiERLz4HzM19HyiuIoGzTsM7rPpw= -github.com/hashicorp/terraform-registry-address v0.0.0-20220623143253-7d51757b572c h1:D8aRO6+mTqHfLsK/BC3j5OAoogv1WLRWzY1AaTo3rBg= -github.com/hashicorp/terraform-registry-address v0.0.0-20220623143253-7d51757b572c/go.mod h1:Wn3Na71knbXc1G8Lh+yu/dQWWJeFQEpDeJMtWMtlmNI= +github.com/hashicorp/terraform-plugin-go v0.14.3 h1:nlnJ1GXKdMwsC8g1Nh05tK2wsC3+3BL/DBBxFEki+j0= +github.com/hashicorp/terraform-plugin-go v0.14.3/go.mod h1:7ees7DMZ263q8wQ6E4RdIdR6nHHJtrdt4ogX5lPkX1A= +github.com/hashicorp/terraform-plugin-log v0.8.0 h1:pX2VQ/TGKu+UU1rCay0OlzosNKe4Nz1pepLXj95oyy0= +github.com/hashicorp/terraform-plugin-log v0.8.0/go.mod h1:1myFrhVsBLeylQzYYEV17VVjtG8oYPRFdaZs7xdW2xs= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.25.0 h1:iNRjaJCatQS1rIbHs/vDvJ0GECsaGgxx780chA2Irpk= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.25.0/go.mod h1:XnVNLIS6bdMJbjSDujhX4Rlk24QpbGKbnrVFM4tZ7OU= +github.com/hashicorp/terraform-registry-address v0.1.0 h1:W6JkV9wbum+m516rCl5/NjKxCyTVaaUBbzYcMzBDO3U= +github.com/hashicorp/terraform-registry-address v0.1.0/go.mod h1:EnyO2jYO6j29DTHbJcm00E5nQTFeTtyZH3H5ycydQ5A= github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 h1:HKLsbzeOsfXmKNpr3GiT18XAblV0BjCbzL8KQAMZGa0= github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734/go.mod h1:kNDNcF7sN4DocDLBkQYz73HGKwN1ANB1blq4lIYLYvg= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d h1:kJCB4vdITiW1eC1vq2e6IsrXKrZit1bv/TDYFGMp4BQ= @@ -278,7 +190,6 @@ github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKe github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/huandu/xstrings v1.3.2 h1:L18LIDzqlW6xN2rEkpdV8+oL/IXWJ1APd+vsdYy4Wdw= 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/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= @@ -291,13 +202,10 @@ github.com/jhump/protoreflect v1.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZ github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -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/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= 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.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -328,8 +236,8 @@ github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Ky github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mitchellh/cli v1.1.4 h1:qj8czE26AU4PbiaPXK5uVmMSM+V5BYsFBiM9HhGRLUA= -github.com/mitchellh/cli v1.1.4/go.mod h1:vTLESy5mRhKOs9KDp0/RATawxP1UqBmdrpVRMnpcvKQ= +github.com/mitchellh/cli v1.1.5 h1:OxRIeJXpAMztws/XHlN2vu6imG5Dpq+j61AzAX5fLng= +github.com/mitchellh/cli v1.1.5/go.mod h1:v8+iFts2sPIKUV1ltktPXMCC8fumSKFItNcD2cLtRR4= github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db h1:62I3jR2EmQ4l5rM/4FEfDWcRD+abF5XlKShorW5LRoQ= github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db/go.mod h1:l0dey0ia/Uv7NcFFVbCLtqEBQbrT4OCwCSKTEv6enCw= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= @@ -350,7 +258,6 @@ github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zx github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= 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/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= @@ -366,7 +273,6 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/posener/complete v1.2.3 h1:NP0eAhjcjImqslEwo/1hq7gpajME0fTLTezBKDqfXqo= github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -402,8 +308,8 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= +github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= @@ -421,9 +327,7 @@ github.com/xdg-go/scram v1.1.1/go.mod h1:RaEWvsqvNKKvBPvcKeFjrG2cJqOkHTiyTpzz23n github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8= github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= -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/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/zclconf/go-cty v1.1.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s= github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= github.com/zclconf/go-cty v1.10.0/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= @@ -435,11 +339,6 @@ go.mongodb.org/mongo-driver v1.7.5/go.mod h1:VXEWRZ6URJIkUq2SCAyapmhH0ZLRBP+FT4x go.mongodb.org/mongo-driver v1.10.0/go.mod h1:wsihk0Kdgv8Kqu1Anit4sfK+22vSFbUrAVEYRhCXrA8= go.mongodb.org/mongo-driver v1.11.0 h1:FZKhBSTydeuffHj9CBjXlR8vQLee1cQyTWYPA6/tqiE= go.mongodb.org/mongo-driver v1.11.0/go.mod h1:s7p5vEtfbeR1gYi6pnj3c3/urpbLv2T5Sfd6Rp2HBB8= -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/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opentelemetry.io/otel v1.11.1 h1:4WLLAmcfkmDk2ukNXJyq3/kiz/3UzCaYq6PskJsaou4= go.opentelemetry.io/otel v1.11.1/go.mod h1:1nNhXBbWSD0nsL38H6btgnFN2k4i0sNLHNNMZMSbUGE= go.opentelemetry.io/otel/sdk v1.11.1 h1:F7KmQgoHljhUuJyA+9BiU+EkJfyX5nVVF4wyzWZpKxs= @@ -449,132 +348,61 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf 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-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= -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-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -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/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d h1:sK3txAijHtOK88l68nt020reeT1ZdKLIYetKl95FzVY= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -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/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/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= +golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= +golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= 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-20191009170851-d66e71096ffb/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-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k= golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b h1:PxfKdU9lEEDYjdIzOtC4qFWgkU2rGHdKlKowJSMN9h0= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -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/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= +golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= 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/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58 h1:Mj83v+wSRNEar42a/MQgxk9X42TdEmrOl9i+y8WbxLo= -golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.6.0 h1:Lh8GPgSKBfWSwFvtuWOfeI3aAAnbXTSutYxJiOJFgIw= +golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw= 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-20190412183630-56d357773e84/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/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190419153524-e8e3143a4f4a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/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-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-20200116001909-b77594299b42/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-20200803210538-64077c9b5642/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= @@ -585,149 +413,42 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 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/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= 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/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg= -golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -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/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= 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-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190416151739-9c9e1878f421/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190420181800-aa740d480789/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-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -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-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= 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/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/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/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= 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-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-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d h1:92D1fum1bJLKSdr11OJ+54YeCMCGYIygTA7R/YZxH5M= -google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -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.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.51.0 h1:E1eGv1FTqoLIdnBCZufiSHgKjlqG6fKFf6pPWtMTh8U= -google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww= -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/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f h1:BWUVssLB0HVOSY78gIdvk1dTVYtT1y8SBWtPYuTJ/6w= +google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/grpc v1.53.0 h1:LAv2ds7cmFV/XTS3XG1NneeENYrXGmorPxsBbptIjNc= +google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= @@ -754,13 +475,3 @@ gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/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/golangci-config.yml b/golangci-config.yml index 237735795..8ea326a24 100644 --- a/golangci-config.yml +++ b/golangci-config.yml @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + run: timeout: 10m tests: true diff --git a/internal/clients/boundary_cluster.go b/internal/clients/boundary_cluster.go index 68714fd1b..624fd0710 100644 --- a/internal/clients/boundary_cluster.go +++ b/internal/clients/boundary_cluster.go @@ -1,10 +1,13 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package clients import ( "context" - "github.com/hashicorp/hcp-sdk-go/clients/cloud-boundary-service/preview/2021-12-21/client/boundary_service" - boundarymodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-boundary-service/preview/2021-12-21/models" + "github.com/hashicorp/hcp-sdk-go/clients/cloud-boundary-service/stable/2021-12-21/client/boundary_service" + boundarymodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-boundary-service/stable/2021-12-21/models" sharedmodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" ) diff --git a/internal/clients/client.go b/internal/clients/client.go index de4a7782d..5ed38a9a9 100644 --- a/internal/clients/client.go +++ b/internal/clients/client.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package clients import ( @@ -6,13 +9,13 @@ import ( "log" "strings" - cloud_network "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/preview/2020-09-07/client" - "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/preview/2020-09-07/client/network_service" - cloud_operation "github.com/hashicorp/hcp-sdk-go/clients/cloud-operation/preview/2020-05-05/client" - "github.com/hashicorp/hcp-sdk-go/clients/cloud-operation/preview/2020-05-05/client/operation_service" - cloud_resource_manager "github.com/hashicorp/hcp-sdk-go/clients/cloud-resource-manager/preview/2019-12-10/client" - "github.com/hashicorp/hcp-sdk-go/clients/cloud-resource-manager/preview/2019-12-10/client/organization_service" - "github.com/hashicorp/hcp-sdk-go/clients/cloud-resource-manager/preview/2019-12-10/client/project_service" + cloud_network "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/stable/2020-09-07/client" + "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/stable/2020-09-07/client/network_service" + cloud_operation "github.com/hashicorp/hcp-sdk-go/clients/cloud-operation/stable/2020-05-05/client" + "github.com/hashicorp/hcp-sdk-go/clients/cloud-operation/stable/2020-05-05/client/operation_service" + cloud_resource_manager "github.com/hashicorp/hcp-sdk-go/clients/cloud-resource-manager/stable/2019-12-10/client" + "github.com/hashicorp/hcp-sdk-go/clients/cloud-resource-manager/stable/2019-12-10/client/organization_service" + "github.com/hashicorp/hcp-sdk-go/clients/cloud-resource-manager/stable/2019-12-10/client/project_service" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" cloud_consul "github.com/hashicorp/hcp-sdk-go/clients/cloud-consul-service/stable/2021-02-04/client" @@ -24,8 +27,8 @@ import ( cloud_packer "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/stable/2021-04-30/client" "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/stable/2021-04-30/client/packer_service" - cloud_boundary "github.com/hashicorp/hcp-sdk-go/clients/cloud-boundary-service/preview/2021-12-21/client" - "github.com/hashicorp/hcp-sdk-go/clients/cloud-boundary-service/preview/2021-12-21/client/boundary_service" + cloud_boundary "github.com/hashicorp/hcp-sdk-go/clients/cloud-boundary-service/stable/2021-12-21/client" + "github.com/hashicorp/hcp-sdk-go/clients/cloud-boundary-service/stable/2021-12-21/client/boundary_service" sdk "github.com/hashicorp/hcp-sdk-go/httpclient" ) diff --git a/internal/clients/consul_cluster.go b/internal/clients/consul_cluster.go index 7d5843682..6151a11d0 100644 --- a/internal/clients/consul_cluster.go +++ b/internal/clients/consul_cluster.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package clients import ( diff --git a/internal/clients/consul_snapshot.go b/internal/clients/consul_snapshot.go index 11b8be9cc..98768b367 100644 --- a/internal/clients/consul_snapshot.go +++ b/internal/clients/consul_snapshot.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package clients import ( diff --git a/internal/clients/hvn.go b/internal/clients/hvn.go index 3d8547bdf..2ba3359db 100644 --- a/internal/clients/hvn.go +++ b/internal/clients/hvn.go @@ -1,10 +1,13 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package clients import ( "context" - "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/preview/2020-09-07/client/network_service" - networkmodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/preview/2020-09-07/models" + "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/stable/2020-09-07/client/network_service" + networkmodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/stable/2020-09-07/models" sharedmodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" ) diff --git a/internal/clients/hvn_route.go b/internal/clients/hvn_route.go index 842b7f8c0..981c7aaf8 100644 --- a/internal/clients/hvn_route.go +++ b/internal/clients/hvn_route.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package clients import ( @@ -6,8 +9,8 @@ import ( "log" "time" - "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/preview/2020-09-07/client/network_service" - networkmodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/preview/2020-09-07/models" + "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/stable/2020-09-07/client/network_service" + networkmodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/stable/2020-09-07/models" sharedmodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) diff --git a/internal/clients/logging.go b/internal/clients/logging.go index 0b82e5a1c..3e8a1bfae 100644 --- a/internal/clients/logging.go +++ b/internal/clients/logging.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package clients import ( diff --git a/internal/clients/operation.go b/internal/clients/operation.go index 0af1be67e..24bdc37b8 100644 --- a/internal/clients/operation.go +++ b/internal/clients/operation.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package clients import ( @@ -6,7 +9,7 @@ import ( "log" "time" - "github.com/hashicorp/hcp-sdk-go/clients/cloud-operation/preview/2020-05-05/client/operation_service" + "github.com/hashicorp/hcp-sdk-go/clients/cloud-operation/stable/2020-05-05/client/operation_service" sharedmodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" ) diff --git a/internal/clients/packer.go b/internal/clients/packer.go index 78391639c..6bf521738 100644 --- a/internal/clients/packer.go +++ b/internal/clients/packer.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package clients import ( @@ -28,7 +31,7 @@ func GetPackerChannelBySlug(ctx context.Context, client *Client, loc *sharedmode return getResp.Payload.Channel, nil } -// GetIteration queries the HCP Packer registry for an existing bucket iteration. +// GetIterationFromID queries the HCP Packer registry for an existing bucket iteration. func GetIterationFromID(ctx context.Context, client *Client, loc *sharedmodels.HashicorpCloudLocationLocation, bucketslug string, iterationID string) (*packermodels.HashicorpCloudPackerIteration, error) { params := packer_service.NewPackerServiceGetIterationParamsWithContext(ctx) @@ -48,6 +51,101 @@ func GetIterationFromID(ctx context.Context, client *Client, loc *sharedmodels.H return it.Payload.Iteration, nil } +// CreateBucketChannel creates a channel on the named bucket. +func CreateBucketChannel(ctx context.Context, client *Client, loc *sharedmodels.HashicorpCloudLocationLocation, bucketSlug string, channelSlug string, + iteration *packermodels.HashicorpCloudPackerIteration) (*packermodels.HashicorpCloudPackerChannel, error) { + params := packer_service.NewPackerServiceCreateChannelParamsWithContext(ctx) + params.LocationOrganizationID = loc.OrganizationID + params.LocationProjectID = loc.ProjectID + params.BucketSlug = bucketSlug + params.Body.Slug = channelSlug + + if iteration != nil { + switch { + case iteration.ID != "": + params.Body.IterationID = iteration.ID + case iteration.Fingerprint != "": + params.Body.Fingerprint = iteration.Fingerprint + case iteration.IncrementalVersion > 0: + params.Body.IncrementalVersion = iteration.IncrementalVersion + } + } + + channel, err := client.Packer.PackerServiceCreateChannel(params, nil) + if err != nil { + err := err.(*packer_service.PackerServiceCreateChannelDefault) + return nil, errors.New(err.Payload.Message) + } + + return channel.GetPayload().Channel, nil +} + +// UpdateBucketChannel updates the named channel. +func UpdateBucketChannel(ctx context.Context, client *Client, loc *sharedmodels.HashicorpCloudLocationLocation, bucketSlug string, channelSlug string, + iteration *packermodels.HashicorpCloudPackerIteration) (*packermodels.HashicorpCloudPackerChannel, error) { + params := packer_service.NewPackerServiceUpdateChannelParamsWithContext(ctx) + params.LocationOrganizationID = loc.OrganizationID + params.LocationProjectID = loc.ProjectID + params.BucketSlug = bucketSlug + params.Slug = channelSlug + + if iteration != nil { + switch { + case iteration.ID != "": + params.Body.IterationID = iteration.ID + case iteration.Fingerprint != "": + params.Body.Fingerprint = iteration.Fingerprint + case iteration.IncrementalVersion > 0: + params.Body.IncrementalVersion = iteration.IncrementalVersion + } + } + + channel, err := client.Packer.PackerServiceUpdateChannel(params, nil) + if err != nil { + err := err.(*packer_service.PackerServiceUpdateChannelDefault) + return nil, errors.New(err.Payload.Message) + } + + return channel.GetPayload().Channel, nil +} + +// DeleteBucketChannel deletes a channel from the named bucket. +func DeleteBucketChannel(ctx context.Context, client *Client, loc *sharedmodels.HashicorpCloudLocationLocation, bucketSlug, channelSlug string) (*packermodels.HashicorpCloudPackerChannel, error) { + params := packer_service.NewPackerServiceDeleteChannelParamsWithContext(ctx) + params.LocationOrganizationID = loc.OrganizationID + params.LocationProjectID = loc.ProjectID + params.BucketSlug = bucketSlug + params.Slug = channelSlug + + req, err := client.Packer.PackerServiceDeleteChannel(params, nil) + if err != nil { + err := err.(*packer_service.PackerServiceDeleteChannelDefault) + return nil, errors.New(err.Payload.Message) + } + + if !req.IsSuccess() { + return nil, errors.New("failed to delete channel") + } + + return nil, nil +} + +// ListBucketChannels queries the HCP Packer registry for channels associated to the specified bucket. +func ListBucketChannels(ctx context.Context, client *Client, loc *sharedmodels.HashicorpCloudLocationLocation, bucketSlug string) (*packermodels.HashicorpCloudPackerListChannelsResponse, error) { + params := packer_service.NewPackerServiceListChannelsParams() + params.LocationOrganizationID = loc.OrganizationID + params.LocationProjectID = loc.ProjectID + params.BucketSlug = bucketSlug + + req, err := client.Packer.PackerServiceListChannels(params, nil) + if err != nil { + err := err.(*packer_service.PackerServiceListChannelsDefault) + return nil, errors.New(err.Payload.Message) + } + + return req.Payload, nil +} + // handleGetChannelError returns a formatted error for the GetChannel error. // The upstream API does a good job of providing detailed error messages so we just display the error message, with no status code. func handleGetChannelError(err *packer_service.PackerServiceGetChannelDefault) error { diff --git a/internal/clients/peering.go b/internal/clients/peering.go index 3718454bb..e8d6956b8 100644 --- a/internal/clients/peering.go +++ b/internal/clients/peering.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package clients import ( @@ -5,8 +8,8 @@ import ( "fmt" "time" - "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/preview/2020-09-07/client/network_service" - networkmodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/preview/2020-09-07/models" + "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/stable/2020-09-07/client/network_service" + networkmodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/stable/2020-09-07/models" sharedmodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) diff --git a/internal/clients/project.go b/internal/clients/project.go index 437c252ed..c0684c297 100644 --- a/internal/clients/project.go +++ b/internal/clients/project.go @@ -1,14 +1,17 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package clients import ( "context" - "github.com/hashicorp/hcp-sdk-go/clients/cloud-resource-manager/preview/2019-12-10/client/project_service" - resourcemodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-resource-manager/preview/2019-12-10/models" + "github.com/hashicorp/hcp-sdk-go/clients/cloud-resource-manager/stable/2019-12-10/client/project_service" + resourcemodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-resource-manager/stable/2019-12-10/models" ) // GetProjectByID gets a project by its ID -func GetProjectByID(ctx context.Context, client *Client, projectID string) (*resourcemodels.HashicorpCloudResourcemanagerProject, error) { +func GetProjectByID(ctx context.Context, client *Client, projectID string) (*resourcemodels.ResourcemanagerProject, error) { getParams := project_service.NewProjectServiceGetParams() getParams.Context = ctx getParams.ID = projectID diff --git a/internal/clients/response.go b/internal/clients/response.go index ebaffb2c0..977fa9252 100644 --- a/internal/clients/response.go +++ b/internal/clients/response.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package clients import ( diff --git a/internal/clients/retry_request.go b/internal/clients/retry_request.go index 0e0fc3787..fb0e19bf6 100644 --- a/internal/clients/retry_request.go +++ b/internal/clients/retry_request.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package clients import ( @@ -6,8 +9,8 @@ import ( "reflect" "time" - "github.com/hashicorp/hcp-sdk-go/clients/cloud-resource-manager/preview/2019-12-10/client/organization_service" - "github.com/hashicorp/hcp-sdk-go/clients/cloud-resource-manager/preview/2019-12-10/client/project_service" + "github.com/hashicorp/hcp-sdk-go/clients/cloud-resource-manager/stable/2019-12-10/client/organization_service" + "github.com/hashicorp/hcp-sdk-go/clients/cloud-resource-manager/stable/2019-12-10/client/project_service" ) const ( diff --git a/internal/clients/retry_request_test.go b/internal/clients/retry_request_test.go index 6ecc0a737..ca34abdbf 100644 --- a/internal/clients/retry_request_test.go +++ b/internal/clients/retry_request_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package clients import "testing" diff --git a/internal/clients/tgw.go b/internal/clients/tgw.go index 6c6c95a71..38f39cd67 100644 --- a/internal/clients/tgw.go +++ b/internal/clients/tgw.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package clients import ( @@ -5,8 +8,8 @@ import ( "fmt" "time" - "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/preview/2020-09-07/client/network_service" - networkmodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/preview/2020-09-07/models" + "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/stable/2020-09-07/client/network_service" + networkmodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/stable/2020-09-07/models" sharedmodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) diff --git a/internal/clients/vault_cluster.go b/internal/clients/vault_cluster.go index bf24b4789..281e30e23 100644 --- a/internal/clients/vault_cluster.go +++ b/internal/clients/vault_cluster.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package clients import ( diff --git a/internal/consul/version.go b/internal/consul/version.go index 43032d023..7c9987ace 100644 --- a/internal/consul/version.go +++ b/internal/consul/version.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package consul import ( diff --git a/internal/consul/version_test.go b/internal/consul/version_test.go index e9df9c8a5..f411fb749 100644 --- a/internal/consul/version_test.go +++ b/internal/consul/version_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package consul import ( diff --git a/internal/input/input.go b/internal/input/input.go index b193a3fbf..42eeba6ea 100644 --- a/internal/input/input.go +++ b/internal/input/input.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package input import ( diff --git a/internal/input/input_test.go b/internal/input/input_test.go index 5f0958b4f..ba4843016 100644 --- a/internal/input/input_test.go +++ b/internal/input/input_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package input import ( diff --git a/internal/provider/data_source_aws_network_peering.go b/internal/provider/data_source_aws_network_peering.go index ea0f7336c..50e36781f 100644 --- a/internal/provider/data_source_aws_network_peering.go +++ b/internal/provider/data_source_aws_network_peering.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( @@ -5,7 +8,7 @@ import ( "fmt" "log" - "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/preview/2020-09-07/models" + "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/stable/2020-09-07/models" sharedmodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" diff --git a/internal/provider/data_source_aws_transit_gateway_attachment.go b/internal/provider/data_source_aws_transit_gateway_attachment.go index 2e819645a..e2e0ac302 100644 --- a/internal/provider/data_source_aws_transit_gateway_attachment.go +++ b/internal/provider/data_source_aws_transit_gateway_attachment.go @@ -1,10 +1,13 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( "context" "fmt" - "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/preview/2020-09-07/models" + "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/stable/2020-09-07/models" sharedmodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" diff --git a/internal/provider/data_source_azure_peering_connection.go b/internal/provider/data_source_azure_peering_connection.go index ea26865b4..641bfa88b 100644 --- a/internal/provider/data_source_azure_peering_connection.go +++ b/internal/provider/data_source_azure_peering_connection.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( @@ -5,7 +8,7 @@ import ( "fmt" "log" - "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/preview/2020-09-07/models" + "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/stable/2020-09-07/models" sharedmodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" diff --git a/internal/provider/data_source_boundary_cluster.go b/internal/provider/data_source_boundary_cluster.go index 244d5d127..60d42878e 100644 --- a/internal/provider/data_source_boundary_cluster.go +++ b/internal/provider/data_source_boundary_cluster.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( diff --git a/internal/provider/data_source_consul_agent_helm_config.go b/internal/provider/data_source_consul_agent_helm_config.go index c235615a9..7252660d4 100644 --- a/internal/provider/data_source_consul_agent_helm_config.go +++ b/internal/provider/data_source_consul_agent_helm_config.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( diff --git a/internal/provider/data_source_consul_agent_kubernetes_secret.go b/internal/provider/data_source_consul_agent_kubernetes_secret.go index 405953ce9..2757c173f 100644 --- a/internal/provider/data_source_consul_agent_kubernetes_secret.go +++ b/internal/provider/data_source_consul_agent_kubernetes_secret.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( diff --git a/internal/provider/data_source_consul_cluster.go b/internal/provider/data_source_consul_cluster.go index 2d0594c08..6e7756a14 100644 --- a/internal/provider/data_source_consul_cluster.go +++ b/internal/provider/data_source_consul_cluster.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( @@ -144,6 +147,25 @@ func dataSourceConsulCluster() *schema.Resource { Type: schema.TypeBool, Computed: true, }, + "ip_allowlist": { + Description: "Allowed IPV4 address ranges (CIDRs) for inbound traffic. Each entry must be a unique CIDR. Maximum 3 CIDRS supported at this time.", + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "address": { + Description: "IP address range in CIDR notation.", + Type: schema.TypeString, + Computed: true, + }, + "description": { + Description: "Description to help identify source (maximum 255 chars).", + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, }, } } @@ -300,6 +322,20 @@ func setConsulClusterDataSourceAttributes( } } + if cluster.Config.NetworkConfig != nil { + ipAllowlist := make([]map[string]interface{}, len(cluster.Config.NetworkConfig.IPAllowlist)) + for i, cidrRange := range cluster.Config.NetworkConfig.IPAllowlist { + cidr := map[string]interface{}{ + "description": cidrRange.Description, + "address": cidrRange.Address, + } + ipAllowlist[i] = cidr + } + if err := d.Set("ip_allowlist", ipAllowlist); err != nil { + return err + } + } + return nil } diff --git a/internal/provider/data_source_consul_versions.go b/internal/provider/data_source_consul_versions.go index 36a50c130..893e253d6 100644 --- a/internal/provider/data_source_consul_versions.go +++ b/internal/provider/data_source_consul_versions.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( diff --git a/internal/provider/data_source_hvn.go b/internal/provider/data_source_hvn.go index 9fecea7d4..2bf33c5aa 100644 --- a/internal/provider/data_source_hvn.go +++ b/internal/provider/data_source_hvn.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( diff --git a/internal/provider/data_source_hvn_peering_connection.go b/internal/provider/data_source_hvn_peering_connection.go index a1dc5b8ed..2e806bb14 100644 --- a/internal/provider/data_source_hvn_peering_connection.go +++ b/internal/provider/data_source_hvn_peering_connection.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( diff --git a/internal/provider/data_source_hvn_route.go b/internal/provider/data_source_hvn_route.go index c406c42e1..f9e21a1a7 100644 --- a/internal/provider/data_source_hvn_route.go +++ b/internal/provider/data_source_hvn_route.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( diff --git a/internal/provider/data_source_packer_image.go b/internal/provider/data_source_packer_image.go index cf43c03e7..391623e1f 100644 --- a/internal/provider/data_source_packer_image.go +++ b/internal/provider/data_source_packer_image.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( diff --git a/internal/provider/data_source_packer_image_iteration.go b/internal/provider/data_source_packer_image_iteration.go index d13587cc9..ec82d37d2 100644 --- a/internal/provider/data_source_packer_image_iteration.go +++ b/internal/provider/data_source_packer_image_iteration.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( diff --git a/internal/provider/data_source_packer_image_iteration_test.go b/internal/provider/data_source_packer_image_iteration_test.go index 2a9d94bc8..15d78bcef 100644 --- a/internal/provider/data_source_packer_image_iteration_test.go +++ b/internal/provider/data_source_packer_image_iteration_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( @@ -9,7 +12,7 @@ import ( "github.com/cenkalti/backoff" "github.com/go-openapi/strfmt" "github.com/google/uuid" - "github.com/hashicorp/hcp-sdk-go/clients/cloud-operation/preview/2020-05-05/client/operation_service" + "github.com/hashicorp/hcp-sdk-go/clients/cloud-operation/stable/2020-05-05/client/operation_service" "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/stable/2021-04-30/client/packer_service" "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/stable/2021-04-30/models" sharedmodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" @@ -22,7 +25,7 @@ import ( var ( acctestAlpineBucket = fmt.Sprintf("alpine-acc-%s", time.Now().Format("200601021504")) acctestUbuntuBucket = fmt.Sprintf("ubuntu-acc-%s", time.Now().Format("200601021504")) - acctestProductionChannel = "production" + acctestProductionChannel = fmt.Sprintf("packer-acc-channel-%s", time.Now().Format("200601021504")) ) var ( @@ -305,7 +308,7 @@ func upsertBuild(t *testing.T, bucketSlug, fingerprint, iterationID string) { }, { ImageID: "ami-43", - Region: "us-east-1", + Region: "us-east-2", }, }, Labels: map[string]string{"test-key": "test-value"}, diff --git a/internal/provider/data_source_packer_image_test.go b/internal/provider/data_source_packer_image_test.go index 5a2ecfeb4..3bcb74bab 100644 --- a/internal/provider/data_source_packer_image_test.go +++ b/internal/provider/data_source_packer_image_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( @@ -162,18 +165,16 @@ func TestAcc_dataSourcePackerImage_revokedIteration(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t, map[string]bool{"aws": false, "azure": false}) }, ProviderFactories: providerFactories, + CheckDestroy: func(*terraform.State) error { + deleteChannel(t, acctestUbuntuImageBucket, acctestImageChannel, true) + deleteIteration(t, acctestUbuntuImageBucket, fingerprint, true) + deleteBucket(t, acctestUbuntuImageBucket, true) + return nil + }, Steps: []resource.TestStep{ - // testing that getting a revoked iteration fails properly { PlanOnly: true, PreConfig: func() { - // CheckDestroy doesn't get called when the test fails and doesn't - // produce any tf state. In this case we destroy any existing resource - // before creating them. - deleteChannel(t, acctestUbuntuImageBucket, acctestImageChannel, false) - deleteIteration(t, acctestUbuntuImageBucket, fingerprint, false) - deleteBucket(t, acctestUbuntuImageBucket, false) - upsertRegistry(t) upsertBucket(t, acctestUbuntuImageBucket) upsertIteration(t, acctestUbuntuImageBucket, fingerprint) @@ -192,7 +193,7 @@ func TestAcc_dataSourcePackerImage_revokedIteration(t *testing.T) { Config: testConfig(testAccPackerImageUbuntuProduction), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("data.hcp_packer_image.ubuntu-foo", "revoke_at", revokeAt.String()), - resource.TestCheckResourceAttr("data.hcp_packer_image.ubuntu-foo", "cloud_image_id", "error_revoked"), + resource.TestCheckResourceAttr("data.hcp_packer_image.ubuntu-foo", "cloud_image_id", "ami-42"), ), }, }, diff --git a/internal/provider/data_source_packer_iteration.go b/internal/provider/data_source_packer_iteration.go index 12dfcf9e0..6a492116f 100644 --- a/internal/provider/data_source_packer_iteration.go +++ b/internal/provider/data_source_packer_iteration.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( diff --git a/internal/provider/data_source_packer_iteration_test.go b/internal/provider/data_source_packer_iteration_test.go index db25e5985..edfa405b3 100644 --- a/internal/provider/data_source_packer_iteration_test.go +++ b/internal/provider/data_source_packer_iteration_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( diff --git a/internal/provider/data_source_vault_cluster.go b/internal/provider/data_source_vault_cluster.go index ba55e58c1..db5ac3b49 100644 --- a/internal/provider/data_source_vault_cluster.go +++ b/internal/provider/data_source_vault_cluster.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( diff --git a/internal/provider/link.go b/internal/provider/link.go index c3adbeea6..400bcc2d2 100644 --- a/internal/provider/link.go +++ b/internal/provider/link.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( diff --git a/internal/provider/link_test.go b/internal/provider/link_test.go index 120ef4449..3262d8886 100644 --- a/internal/provider/link_test.go +++ b/internal/provider/link_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( diff --git a/internal/provider/peering.go b/internal/provider/peering.go index e8e8ef469..8eff87647 100644 --- a/internal/provider/peering.go +++ b/internal/provider/peering.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( diff --git a/internal/provider/peering_test.go b/internal/provider/peering_test.go index 21481cd00..3e6f2d3fb 100644 --- a/internal/provider/peering_test.go +++ b/internal/provider/peering_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( diff --git a/internal/provider/provider.go b/internal/provider/provider.go index e081a18e7..347e4db67 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( @@ -8,9 +11,9 @@ import ( "net/http" "os" - "github.com/hashicorp/hcp-sdk-go/clients/cloud-resource-manager/preview/2019-12-10/client/organization_service" - "github.com/hashicorp/hcp-sdk-go/clients/cloud-resource-manager/preview/2019-12-10/client/project_service" - "github.com/hashicorp/hcp-sdk-go/clients/cloud-resource-manager/preview/2019-12-10/models" + "github.com/hashicorp/hcp-sdk-go/clients/cloud-resource-manager/stable/2019-12-10/client/organization_service" + "github.com/hashicorp/hcp-sdk-go/clients/cloud-resource-manager/stable/2019-12-10/client/project_service" + "github.com/hashicorp/hcp-sdk-go/clients/cloud-resource-manager/stable/2019-12-10/models" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -49,6 +52,7 @@ func New() func() *schema.Provider { "hcp_hvn": resourceHvn(), "hcp_hvn_peering_connection": resourceHvnPeeringConnection(), "hcp_hvn_route": resourceHvnRoute(), + "hcp_packer_channel": resourcePackerChannel(), "hcp_vault_cluster": resourceVaultCluster(), "hcp_vault_cluster_admin_token": resourceVaultClusterAdminToken(), }, @@ -128,7 +132,7 @@ func configure(p *schema.Provider) func(context.Context, *schema.ResourceData) ( // getProjectFromCredentials uses the configured client credentials to // fetch the associated organization and returns that organization's // single project. -func getProjectFromCredentials(ctx context.Context, client *clients.Client) (*models.HashicorpCloudResourcemanagerProject, error) { +func getProjectFromCredentials(ctx context.Context, client *clients.Client) (*models.ResourcemanagerProject, error) { // Get the organization ID. listOrgParams := organization_service.NewOrganizationServiceListParams() listOrgResp, err := clients.RetryOrganizationServiceList(client, listOrgParams) @@ -144,7 +148,7 @@ func getProjectFromCredentials(ctx context.Context, client *clients.Client) (*mo // Get the project using the organization ID. listProjParams := project_service.NewProjectServiceListParams() listProjParams.ScopeID = &orgID - scopeType := string(models.HashicorpCloudResourcemanagerResourceIDResourceTypeORGANIZATION) + scopeType := string(models.ResourceIDResourceTypeORGANIZATION) listProjParams.ScopeType = &scopeType listProjResp, err := clients.RetryProjectServiceList(client, listProjParams) if err != nil { diff --git a/internal/provider/provider_test.go b/internal/provider/provider_test.go index e6b8cb63f..c6a7ab65e 100644 --- a/internal/provider/provider_test.go +++ b/internal/provider/provider_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( @@ -80,18 +83,23 @@ func testAccPreCheck(t *testing.T, requiredCreds map[string]bool) { } if requiredCreds["azure"] { - if os.Getenv("AZURE_TENANT_ID") == "" { - t.Fatal("AZURE_TENANT_ID must be set for acceptance tests") + if os.Getenv("ARM_TENANT_ID") == "" { + t.Fatal("ARM_TENANT_ID must be set for acceptance tests") } - if os.Getenv("AZURE_SUBSCRIPTION_ID") == "" { - t.Fatal("AZURE_SUBSCRIPTION_ID must be set for acceptance tests") + if os.Getenv("ARM_SUBSCRIPTION_ID") == "" { + t.Fatal("ARM_SUBSCRIPTION_ID must be set for acceptance tests") } } err := testAccProvider.Configure(context.Background(), terraform.NewResourceConfigRaw(nil)) if err != nil { - t.Fatal(err) + if err[0].Severity == 1 { + // Severity 1 = Warning, which can be ignored during test + return + } + + t.Fatalf("unexpected error, exiting test: %#v", err) } }) } diff --git a/internal/provider/resource_aws_network_peering.go b/internal/provider/resource_aws_network_peering.go index fc5d76580..40f7e081d 100644 --- a/internal/provider/resource_aws_network_peering.go +++ b/internal/provider/resource_aws_network_peering.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( @@ -5,8 +8,8 @@ import ( "log" "strings" - "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/preview/2020-09-07/client/network_service" - networkmodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/preview/2020-09-07/models" + "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/stable/2020-09-07/client/network_service" + networkmodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/stable/2020-09-07/models" sharedmodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" diff --git a/internal/provider/resource_aws_network_peering_test.go b/internal/provider/resource_aws_network_peering_test.go index 11e27bfc7..f36ed5ae0 100644 --- a/internal/provider/resource_aws_network_peering_test.go +++ b/internal/provider/resource_aws_network_peering_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( diff --git a/internal/provider/resource_aws_transit_gateway_attachment.go b/internal/provider/resource_aws_transit_gateway_attachment.go index 1f406ec28..b89c04af6 100644 --- a/internal/provider/resource_aws_transit_gateway_attachment.go +++ b/internal/provider/resource_aws_transit_gateway_attachment.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( @@ -7,8 +10,8 @@ import ( "strings" "time" - "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/preview/2020-09-07/client/network_service" - networkmodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/preview/2020-09-07/models" + "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/stable/2020-09-07/client/network_service" + networkmodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/stable/2020-09-07/models" sharedmodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" diff --git a/internal/provider/resource_aws_transit_gateway_attachment_test.go b/internal/provider/resource_aws_transit_gateway_attachment_test.go index 7083afef4..03fca8bbc 100644 --- a/internal/provider/resource_aws_transit_gateway_attachment_test.go +++ b/internal/provider/resource_aws_transit_gateway_attachment_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( diff --git a/internal/provider/resource_azure_peering_connection.go b/internal/provider/resource_azure_peering_connection.go index 921949d61..badd2acc3 100644 --- a/internal/provider/resource_azure_peering_connection.go +++ b/internal/provider/resource_azure_peering_connection.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( @@ -5,8 +8,8 @@ import ( "log" "strings" - "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/preview/2020-09-07/client/network_service" - networkmodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/preview/2020-09-07/models" + "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/stable/2020-09-07/client/network_service" + networkmodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/stable/2020-09-07/models" sharedmodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" diff --git a/internal/provider/resource_azure_peering_connection_test.go b/internal/provider/resource_azure_peering_connection_test.go index 27d490e1c..d4c94ba1f 100644 --- a/internal/provider/resource_azure_peering_connection_test.go +++ b/internal/provider/resource_azure_peering_connection_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( @@ -14,8 +17,8 @@ import ( var ( uniqueAzurePeeringTestID = fmt.Sprintf("hcp-provider-test-%s", time.Now().Format("200601021504")) - subscriptionID = os.Getenv("AZURE_SUBSCRIPTION_ID") - tenantID = os.Getenv("AZURE_TENANT_ID") + subscriptionID = os.Getenv("ARM_SUBSCRIPTION_ID") + tenantID = os.Getenv("ARM_TENANT_ID") testAccAzurePeeringConfig = fmt.Sprintf(` provider "azurerm" { features {} diff --git a/internal/provider/resource_boundary_cluster.go b/internal/provider/resource_boundary_cluster.go index 8b9a61c0f..f6db5efba 100644 --- a/internal/provider/resource_boundary_cluster.go +++ b/internal/provider/resource_boundary_cluster.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( @@ -5,7 +8,7 @@ import ( "log" "time" - boundarymodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-boundary-service/preview/2021-12-21/models" + boundarymodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-boundary-service/stable/2021-12-21/models" sharedmodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" diff --git a/internal/provider/resource_boundary_cluster_test.go b/internal/provider/resource_boundary_cluster_test.go index 98c624556..2f6c412e3 100644 --- a/internal/provider/resource_boundary_cluster_test.go +++ b/internal/provider/resource_boundary_cluster_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( diff --git a/internal/provider/resource_consul_cluster.go b/internal/provider/resource_consul_cluster.go index c28514403..3a7e361d0 100644 --- a/internal/provider/resource_consul_cluster.go +++ b/internal/provider/resource_consul_cluster.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( @@ -64,7 +67,7 @@ func resourceConsulCluster() *schema.Resource { ValidateDiagFunc: validateSlugID, }, "tier": { - Description: "The tier that the HCP Consul cluster will be provisioned as. Only `development`, `standard` and `plus` are available at this time. See [pricing information](https://cloud.hashicorp.com/pricing/consul).", + Description: "The tier that the HCP Consul cluster will be provisioned as. Only `development`, `standard` and `plus` are available at this time. See [pricing information](https://www.hashicorp.com/products/consul/pricing).", Type: schema.TypeString, Required: true, ForceNew: true, @@ -207,6 +210,28 @@ func resourceConsulCluster() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "ip_allowlist": { + Description: "Allowed IPV4 address ranges (CIDRs) for inbound traffic. Each entry must be a unique CIDR. Maximum 3 CIDRS supported at this time.", + Type: schema.TypeList, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "address": { + Description: "IP address range in CIDR notation.", + Type: schema.TypeString, + Required: true, + ValidateDiagFunc: validateConsulClusterCIDR, + }, + "description": { + Description: "Description to help identify source (maximum 255 chars).", + Type: schema.TypeString, + Optional: true, + ValidateDiagFunc: validateConsulClusterCIDRDescription, + }, + }, + }, + MaxItems: 3, + }, "consul_root_token_accessor_id": { Description: "The accessor ID of the root ACL token that is generated upon cluster creation.", Type: schema.TypeString, @@ -329,6 +354,13 @@ func resourceConsulClusterCreate(ctx context.Context, d *schema.ResourceData, me // The peering happens within the secondary cluster create operation. autoHvnToHvnPeering := d.Get("auto_hvn_to_hvn_peering").(bool) + // Convert ip_allowlist to consul model. + cidrs := d.Get("ip_allowlist").([]interface{}) + ipAllowlist, err := buildIPAllowlist(cidrs) + if err != nil { + return diag.Errorf("Invalid ip_allowlist for Consul cluster (%s): %v", clusterID, err) + } + log.Printf("[INFO] Creating Consul cluster (%s)", clusterID) var tier *consulmodels.HashicorpCloudConsul20210204ClusterConfigTier @@ -356,8 +388,9 @@ func resourceConsulClusterCreate(ctx context.Context, d *schema.ResourceData, me }, MaintenanceConfig: nil, NetworkConfig: &consulmodels.HashicorpCloudConsul20210204NetworkConfig{ - Network: newLink(loc, "hvn", hvnID), - Private: !publicEndpoint, + Network: newLink(loc, "hvn", hvnID), + Private: !publicEndpoint, + IPAllowlist: ipAllowlist, }, AutoHvnToHvnPeering: autoHvnToHvnPeering, }, @@ -534,6 +567,21 @@ func setConsulClusterResourceData(d *schema.ResourceData, cluster *consulmodels. } } + if cluster.Config.NetworkConfig != nil { + ipAllowlist := make([]map[string]interface{}, len(cluster.Config.NetworkConfig.IPAllowlist)) + for i, cidrRange := range cluster.Config.NetworkConfig.IPAllowlist { + cidr := map[string]interface{}{ + "description": cidrRange.Description, + "address": cidrRange.Address, + } + ipAllowlist[i] = cidr + } + + if err := d.Set("ip_allowlist", ipAllowlist); err != nil { + return err + } + } + return nil } @@ -629,9 +677,10 @@ func resourceConsulClusterUpdate(ctx context.Context, d *schema.ResourceData, me // Confirm update fields have been changed sizeChanged := d.HasChange("size") versionChanged := d.HasChange("min_consul_version") + ipAllowlistChanged := d.HasChange("ip_allowlist") - if !sizeChanged && !versionChanged { - return diag.Errorf("at least one of: [min_consul_version, size] is required in order to update the cluster") + if !sizeChanged && !versionChanged && !ipAllowlistChanged { + return diag.Errorf("at least one of: [min_consul_version, size, ip_allowlist] is required in order to update the cluster") } targetCluster := consulmodels.HashicorpCloudConsul20210204Cluster{ @@ -683,6 +732,26 @@ func resourceConsulClusterUpdate(ctx context.Context, d *schema.ResourceData, me } } + if ipAllowlistChanged { + cidrs := d.Get("ip_allowlist").([]interface{}) + ipAllowlist, err := buildIPAllowlist(cidrs) + if err != nil { + return diag.Errorf("Invalid ip_allowlist for Consul cluster (%s): %v", clusterID, err) + } + + // Do not override if previous config objects exist. + if targetCluster.Config == nil { + targetCluster.Config = &consulmodels.HashicorpCloudConsul20210204ClusterConfig{} + } + + if targetCluster.Config.NetworkConfig == nil { + targetCluster.Config.NetworkConfig = &consulmodels.HashicorpCloudConsul20210204NetworkConfig{} + } + + // Update IP allowlist. + targetCluster.Config.NetworkConfig.IPAllowlist = ipAllowlist + } + // Invoke update cluster endpoint updateResp, err := clients.UpdateConsulCluster(ctx, client, &targetCluster) if err != nil { @@ -767,3 +836,23 @@ func resourceConsulClusterImport(ctx context.Context, d *schema.ResourceData, me return []*schema.ResourceData{d}, nil } + +// buildIPAllowlist returns a consul model for the IP allowlist. +func buildIPAllowlist(cidrs []interface{}) ([]*consulmodels.HashicorpCloudConsul20210204CidrRange, error) { + ipAllowList := make([]*consulmodels.HashicorpCloudConsul20210204CidrRange, len(cidrs)) + + for i, cidr := range cidrs { + cidrMap := cidr.(map[string]interface{}) + address := cidrMap["address"].(string) + description := cidrMap["description"].(string) + + cidrRange := &consulmodels.HashicorpCloudConsul20210204CidrRange{ + Address: address, + Description: description, + } + + ipAllowList[i] = cidrRange + } + + return ipAllowList, nil +} diff --git a/internal/provider/resource_consul_cluster_root_token.go b/internal/provider/resource_consul_cluster_root_token.go index 733cc87f9..b09c407f5 100644 --- a/internal/provider/resource_consul_cluster_root_token.go +++ b/internal/provider/resource_consul_cluster_root_token.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( diff --git a/internal/provider/resource_consul_cluster_test.go b/internal/provider/resource_consul_cluster_test.go index 7b3838665..e21432a5d 100644 --- a/internal/provider/resource_consul_cluster_test.go +++ b/internal/provider/resource_consul_cluster_test.go @@ -1,8 +1,12 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( "context" "fmt" + "regexp" "testing" "time" @@ -14,26 +18,60 @@ import ( var consulClusterUniqueID = fmt.Sprintf("test-%s", time.Now().Format("200601021504")) var consulClusterHVNUniqueID = fmt.Sprintf("test-hvn-%s", time.Now().Format("200601021504")) -var consulCluster = fmt.Sprintf(` -resource "hcp_consul_cluster" "test" { - cluster_id = "%s" - hvn_id = hcp_hvn.test.hvn_id - tier = "development" - min_consul_version = data.hcp_consul_versions.test.recommended -} -`, consulClusterUniqueID) +var consulCluster = consulClusterConfig(consulClusterUniqueID, ` + ip_allowlist { + address = "172.25.16.0/24" + description = "this is an IPV4 address" + } +`) + +var updatedConsulCluster = consulClusterConfig(consulClusterUniqueID, ` + size = "medium" + + ip_allowlist { + address = "172.25.14.0/24" + description = "this is an updated IPV4 address" + } +`) + +var createConsulClusterCIDRExceeded = consulClusterConfig("test-failure", ` + ip_allowlist { + address = "172.25.16.0/24" + description = "this is a first IPV4 address" + } + + ip_allowlist { + address = "172.25.10.0/24" + description = "this is a secondIPV4 address" + } + + ip_allowlist { + address = "172.25.13.0/24" + description = "this is a third IPV4 address" + } + + ip_allowlist { + address = "172.25.12.0/24" + description = "this is a fourth IPV4 address, exceeding allowed limit" + } +`) -var updatedConsulCluster = fmt.Sprintf(` -resource "hcp_consul_cluster" "test" { - cluster_id = "%s" - hvn_id = hcp_hvn.test.hvn_id - tier = "standard" - size = "small" +func consulClusterConfig(clusterID string, opt string) string { + return fmt.Sprintf(` + resource "hcp_consul_cluster" "test" { + cluster_id = "%s" + hvn_id = hcp_hvn.test.hvn_id + tier = "STANDARD" + min_consul_version = data.hcp_consul_versions.test.recommended + + %s + } + `, clusterID, opt) } -`, consulClusterUniqueID) func setTestAccConsulClusterConfig(consulCluster string) string { return fmt.Sprintf(` + resource "hcp_hvn" "test" { hvn_id = "%s" cloud_provider = "aws" @@ -68,6 +106,12 @@ func TestAccConsulCluster(t *testing.T) { ProviderFactories: providerFactories, CheckDestroy: testAccCheckConsulClusterDestroy, Steps: []resource.TestStep{ + // Tests create failure for IP Allowlist with too many CIDRs + { + Config: testConfig(setTestAccConsulClusterConfig(createConsulClusterCIDRExceeded)), + PlanOnly: true, + ExpectError: regexp.MustCompile(`Too many ip_allowlist blocks`), + }, // Tests create { Config: testConfig(setTestAccConsulClusterConfig(consulCluster)), @@ -75,12 +119,12 @@ func TestAccConsulCluster(t *testing.T) { testAccCheckConsulClusterExists(resourceName), resource.TestCheckResourceAttr(resourceName, "cluster_id", consulClusterUniqueID), resource.TestCheckResourceAttr(resourceName, "hvn_id", consulClusterHVNUniqueID), - resource.TestCheckResourceAttr(resourceName, "tier", "DEVELOPMENT"), + resource.TestCheckResourceAttr(resourceName, "tier", "STANDARD"), resource.TestCheckResourceAttr(resourceName, "cloud_provider", "aws"), resource.TestCheckResourceAttr(resourceName, "region", "us-west-2"), resource.TestCheckResourceAttr(resourceName, "public_endpoint", "false"), resource.TestCheckResourceAttr(resourceName, "datacenter", consulClusterUniqueID), - resource.TestCheckResourceAttr(resourceName, "scale", "1"), + resource.TestCheckResourceAttr(resourceName, "scale", "3"), resource.TestCheckResourceAttr(resourceName, "consul_snapshot_interval", "24h"), resource.TestCheckResourceAttr(resourceName, "consul_snapshot_retention", "30d"), resource.TestCheckResourceAttr(resourceName, "connect_enabled", "true"), @@ -99,6 +143,10 @@ func TestAccConsulCluster(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "consul_root_token_accessor_id"), resource.TestCheckResourceAttrSet(resourceName, "consul_root_token_secret_id"), resource.TestCheckResourceAttrSet(resourceName, "size"), + resource.TestCheckTypeSetElemNestedAttrs(resourceName, "ip_allowlist.*", map[string]string{ + "address": "172.25.16.0/24", + "description": "this is an IPV4 address", + }), ), }, // Tests import @@ -123,12 +171,12 @@ func TestAccConsulCluster(t *testing.T) { testAccCheckConsulClusterExists(resourceName), resource.TestCheckResourceAttr(resourceName, "cluster_id", consulClusterUniqueID), resource.TestCheckResourceAttr(resourceName, "hvn_id", consulClusterHVNUniqueID), - resource.TestCheckResourceAttr(resourceName, "tier", "DEVELOPMENT"), + resource.TestCheckResourceAttr(resourceName, "tier", "STANDARD"), resource.TestCheckResourceAttr(resourceName, "cloud_provider", "aws"), resource.TestCheckResourceAttr(resourceName, "region", "us-west-2"), resource.TestCheckResourceAttr(resourceName, "public_endpoint", "false"), resource.TestCheckResourceAttr(resourceName, "datacenter", consulClusterUniqueID), - resource.TestCheckResourceAttr(resourceName, "scale", "1"), + resource.TestCheckResourceAttr(resourceName, "scale", "3"), resource.TestCheckResourceAttr(resourceName, "consul_snapshot_interval", "24h"), resource.TestCheckResourceAttr(resourceName, "consul_snapshot_retention", "30d"), resource.TestCheckResourceAttr(resourceName, "connect_enabled", "true"), @@ -146,6 +194,10 @@ func TestAccConsulCluster(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "consul_root_token_accessor_id"), resource.TestCheckResourceAttrSet(resourceName, "consul_root_token_secret_id"), resource.TestCheckResourceAttrSet(resourceName, "size"), + resource.TestCheckTypeSetElemNestedAttrs(resourceName, "ip_allowlist.*", map[string]string{ + "address": "172.25.16.0/24", + "description": "this is an IPV4 address", + }), ), }, // Tests datasource @@ -176,6 +228,7 @@ func TestAccConsulCluster(t *testing.T) { resource.TestCheckResourceAttrPair(resourceName, "size", dataSourceName, "size"), resource.TestCheckResourceAttrPair(resourceName, "self_link", dataSourceName, "self_link"), resource.TestCheckResourceAttrPair(resourceName, "primary_link", dataSourceName, "primary_link"), + resource.TestCheckResourceAttrPair(resourceName, "ip_allowlist", dataSourceName, "ip_allowlist"), ), }, // Tests root token @@ -193,7 +246,11 @@ func TestAccConsulCluster(t *testing.T) { Config: testConfig(setTestAccConsulClusterConfig(updatedConsulCluster)), Check: resource.ComposeTestCheckFunc( testAccCheckConsulClusterExists(resourceName), - resource.TestCheckResourceAttr(resourceName, "size", "SMALL"), + resource.TestCheckResourceAttr(resourceName, "size", "MEDIUM"), + resource.TestCheckTypeSetElemNestedAttrs(resourceName, "ip_allowlist.*", map[string]string{ + "address": "172.25.14.0/24", + "description": "this is an updated IPV4 address", + }), ), }, }, diff --git a/internal/provider/resource_consul_snapshot.go b/internal/provider/resource_consul_snapshot.go index 5f0615565..9af6e7174 100644 --- a/internal/provider/resource_consul_snapshot.go +++ b/internal/provider/resource_consul_snapshot.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( diff --git a/internal/provider/resource_consul_snapshot_test.go b/internal/provider/resource_consul_snapshot_test.go index 739c40ad3..8d8d0b4e8 100644 --- a/internal/provider/resource_consul_snapshot_test.go +++ b/internal/provider/resource_consul_snapshot_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( diff --git a/internal/provider/resource_hvn.go b/internal/provider/resource_hvn.go index 33300c788..c490cade6 100644 --- a/internal/provider/resource_hvn.go +++ b/internal/provider/resource_hvn.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( @@ -8,8 +11,8 @@ import ( sharedmodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" - "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/preview/2020-09-07/client/network_service" - networkmodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/preview/2020-09-07/models" + "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/stable/2020-09-07/client/network_service" + networkmodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/stable/2020-09-07/models" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" diff --git a/internal/provider/resource_hvn_peering_connection.go b/internal/provider/resource_hvn_peering_connection.go index 40784cbae..825d0a939 100644 --- a/internal/provider/resource_hvn_peering_connection.go +++ b/internal/provider/resource_hvn_peering_connection.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( @@ -5,8 +8,8 @@ import ( "log" "strings" - "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/preview/2020-09-07/client/network_service" - networkmodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/preview/2020-09-07/models" + "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/stable/2020-09-07/client/network_service" + networkmodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/stable/2020-09-07/models" sharedmodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" diff --git a/internal/provider/resource_hvn_peering_connection_test.go b/internal/provider/resource_hvn_peering_connection_test.go index 00cd2b14e..22da5a20c 100644 --- a/internal/provider/resource_hvn_peering_connection_test.go +++ b/internal/provider/resource_hvn_peering_connection_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( diff --git a/internal/provider/resource_hvn_route.go b/internal/provider/resource_hvn_route.go index 8416ab1a1..0991a9271 100644 --- a/internal/provider/resource_hvn_route.go +++ b/internal/provider/resource_hvn_route.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( @@ -7,7 +10,7 @@ import ( "strings" "time" - networkmodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/preview/2020-09-07/models" + networkmodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/stable/2020-09-07/models" sharedmodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" diff --git a/internal/provider/resource_hvn_route_test.go b/internal/provider/resource_hvn_route_test.go index 1bfa4dcdf..ef3dcb2a3 100644 --- a/internal/provider/resource_hvn_route_test.go +++ b/internal/provider/resource_hvn_route_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( diff --git a/internal/provider/resource_hvn_test.go b/internal/provider/resource_hvn_test.go index 2f4f55811..c5d54b20c 100644 --- a/internal/provider/resource_hvn_test.go +++ b/internal/provider/resource_hvn_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( @@ -121,7 +124,6 @@ func TestAccAwsHvnOnly(t *testing.T) { }) } -// Currently in public beta func TestAccAzureHvnOnly(t *testing.T) { resourceName := "hcp_hvn.test" dataSourceName := "data.hcp_hvn.test" diff --git a/internal/provider/resource_packer_channel.go b/internal/provider/resource_packer_channel.go new file mode 100644 index 000000000..8654da8f5 --- /dev/null +++ b/internal/provider/resource_packer_channel.go @@ -0,0 +1,380 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package provider + +import ( + "context" + "errors" + "fmt" + "log" + "strings" + + packermodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-packer-service/stable/2021-04-30/models" + sharedmodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-provider-hcp/internal/clients" +) + +func resourcePackerChannel() *schema.Resource { + return &schema.Resource{ + Description: "The Packer Channel resource allows you to manage image bucket channels within an active HCP Packer Registry.", + CreateContext: resourcePackerChannelCreate, + DeleteContext: resourcePackerChannelDelete, + ReadContext: resourcePackerChannelRead, + UpdateContext: resourcePackerChannelUpdate, + Timeouts: &schema.ResourceTimeout{ + Create: &defaultPackerTimeout, + Default: &defaultPackerTimeout, + Update: &defaultPackerTimeout, + Delete: &defaultPackerTimeout, + }, + Importer: &schema.ResourceImporter{ + StateContext: resourcePackerChannelImport, + }, + + Schema: map[string]*schema.Schema{ + // Required inputs + "name": { + Description: "The name of the channel being managed.", + Type: schema.TypeString, + ForceNew: true, + Required: true, + ValidateDiagFunc: validateSlugID, + }, + "bucket_name": { + Description: "The slug of the HCP Packer Registry image bucket where the channel should be created in.", + Type: schema.TypeString, + ForceNew: true, + Required: true, + ValidateDiagFunc: validateStringNotEmpty, + }, + // Optional inputs + "iteration": { + Description: "The iteration assigned to the channel.", + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "fingerprint": { + Description: "The fingerprint of the iteration assigned to the channel.", + Type: schema.TypeString, + Optional: true, + Computed: true, + ExactlyOneOf: []string{"iteration.0.id", "iteration.0.fingerprint", "iteration.0.incremental_version"}, + }, + "id": { + Description: "The ID of the iteration assigned to the channel.", + Type: schema.TypeString, + Optional: true, + Computed: true, + ExactlyOneOf: []string{"iteration.0.id", "iteration.0.fingerprint", "iteration.0.incremental_version"}, + }, + "incremental_version": { + Description: "The incremental_version of the iteration assigned to the channel.", + Type: schema.TypeInt, + Optional: true, + Computed: true, + ExactlyOneOf: []string{"iteration.0.id", "iteration.0.fingerprint", "iteration.0.incremental_version"}, + }, + }, + }, + }, + // Computed Values + "author_id": { + Description: "The author of this channel.", + Type: schema.TypeString, + Computed: true, + }, + "created_at": { + Description: "The creation time of this channel.", + Type: schema.TypeString, + Computed: true, + }, + "organization_id": { + Description: "The ID of the HCP organization where this channel is located in.", + Type: schema.TypeString, + Computed: true, + }, + "project_id": { + Description: "The ID of the HCP project where this channel is located in.", + Type: schema.TypeString, + Computed: true, + }, + "updated_at": { + Description: "The time this channel was last updated.", + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func resourcePackerChannelRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + bucketName := d.Get("bucket_name").(string) + client := meta.(*clients.Client) + + loc := &sharedmodels.HashicorpCloudLocationLocation{ + OrganizationID: client.Config.OrganizationID, + ProjectID: client.Config.ProjectID, + } + if err := setLocationData(d, loc); err != nil { + return diag.FromErr(err) + } + + resp, err := clients.ListBucketChannels(ctx, client, loc, bucketName) + if err != nil { + return diag.FromErr(err) + } + + channelName := d.Get("name").(string) + var channel packermodels.HashicorpCloudPackerChannel + for _, c := range resp.Channels { + if c.Slug == channelName { + channel = *c + break + } + } + if channel.ID == "" { + return diag.Errorf("Unable to find channel in bucket %s named %s.", bucketName, channelName) + } + return setPackerChannelResourceData(d, &channel) +} + +func resourcePackerChannelCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + bucketName := d.Get("bucket_name").(string) + channelName := d.Get("name").(string) + + client := meta.(*clients.Client) + loc := &sharedmodels.HashicorpCloudLocationLocation{ + OrganizationID: client.Config.OrganizationID, + ProjectID: client.Config.ProjectID, + } + if err := setLocationData(d, loc); err != nil { + return diag.FromErr(err) + } + + iterationConfig, ok := d.GetOk("iteration") + if !ok { + channel, err := clients.CreateBucketChannel(ctx, client, loc, bucketName, channelName, nil) + if err != nil { + return diag.FromErr(err) + } + + if channel == nil { + return diag.Errorf("Unable to create channel in bucket %s named %s.", bucketName, channelName) + } + + return setPackerChannelResourceData(d, channel) + } + + var iteration *packermodels.HashicorpCloudPackerIteration + if config, ok := iterationConfig.([]interface{})[0].(map[string]interface{}); ok { + iteration = expandIterationConfig(config) + } + + channel, err := clients.CreateBucketChannel(ctx, client, loc, bucketName, channelName, iteration) + if err != nil { + return diag.FromErr(err) + } + + if channel == nil { + return diag.Errorf("Unable to create channel in bucket %s named %s.", bucketName, channelName) + } + + return setPackerChannelResourceData(d, channel) +} + +func resourcePackerChannelUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + bucketName := d.Get("bucket_name").(string) + channelName := d.Get("name").(string) + + client := meta.(*clients.Client) + loc := &sharedmodels.HashicorpCloudLocationLocation{ + OrganizationID: client.Config.OrganizationID, + ProjectID: client.Config.ProjectID, + } + + if err := setLocationData(d, loc); err != nil { + return diag.FromErr(err) + } + + var iteration *packermodels.HashicorpCloudPackerIteration + iterationConfig, ok := d.GetOk("iteration") + if !ok { + channel, err := clients.UpdateBucketChannel(ctx, client, loc, bucketName, channelName, iteration) + if err != nil { + return diag.FromErr(err) + } + return setPackerChannelResourceData(d, channel) + } + + config, ok := iterationConfig.([]interface{})[0].(map[string]interface{}) + if !ok { + return diag.Errorf("Failed to read iteration configuration during update.") + } + + updatedIterationConfig := make(map[string]interface{}) + for key, value := range config { + fullKey := fmt.Sprintf("iteration.0.%s", key) + // Upstream API doesn't know how to handle the case when all params are set; + // So we keep the inputs that are not coming from state. + if d.HasChange(fullKey) { + updatedIterationConfig[key] = value + } + } + + if len(updatedIterationConfig) != 0 { + iteration = expandIterationConfig(updatedIterationConfig) + } + + channel, err := clients.UpdateBucketChannel(ctx, client, loc, bucketName, channelName, iteration) + if err != nil { + return diag.FromErr(err) + } + + return setPackerChannelResourceData(d, channel) +} + +func resourcePackerChannelDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + bucketName := d.Get("bucket_name").(string) + channelName := d.Get("name").(string) + + client := meta.(*clients.Client) + loc := &sharedmodels.HashicorpCloudLocationLocation{ + OrganizationID: client.Config.OrganizationID, + ProjectID: client.Config.ProjectID, + } + if err := setLocationData(d, loc); err != nil { + return diag.FromErr(err) + } + + _, err := clients.DeleteBucketChannel(ctx, client, loc, bucketName, channelName) + if err != nil { + return diag.FromErr(err) + } + + return nil +} + +func resourcePackerChannelImport(ctx context.Context, d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { + client := meta.(*clients.Client) + + var err error + // Updates the source channel to include data about the module used. + client, err = client.UpdateSourceChannel(d) + if err != nil { + log.Printf("[DEBUG] Failed to update analytics with module name (%s)", err) + } + + idParts := strings.SplitN(d.Id(), ":", 2) + if len(idParts) != 2 || idParts[0] == "" || idParts[1] == "" { + return nil, fmt.Errorf("unexpected format of ID (%q), expected {bucket_name}:{channel_name}", d.Id()) + } + + bucketName := idParts[0] + channelName := idParts[1] + + loc := &sharedmodels.HashicorpCloudLocationLocation{ + OrganizationID: client.Config.OrganizationID, + ProjectID: client.Config.ProjectID, + } + if err := setLocationData(d, loc); err != nil { + return nil, err + + } + resp, err := clients.ListBucketChannels(ctx, client, loc, bucketName) + if err != nil { + return nil, err + } + + var channel packermodels.HashicorpCloudPackerChannel + for _, c := range resp.Channels { + if c.Slug == channelName { + channel = *c + break + } + } + + if channel.ID == "" { + return nil, fmt.Errorf("unable to find channel in bucket %s named %s", bucketName, channelName) + } + + if channel.Managed { + return nil, fmt.Errorf("the channel %q is managed by HCP Packer and can not be imported", channel.Slug) + } + + d.SetId(channel.ID) + if err := d.Set("bucket_name", bucketName); err != nil { + return nil, err + } + if err := d.Set("name", channelName); err != nil { + return nil, err + } + + if channel.Iteration == nil { + return []*schema.ResourceData{d}, nil + } + + return []*schema.ResourceData{d}, nil +} + +func setPackerChannelResourceData(d *schema.ResourceData, channel *packermodels.HashicorpCloudPackerChannel) diag.Diagnostics { + if channel == nil { + err := errors.New("unexpected empty channel provided when setting state") + return diag.FromErr(err) + } + + d.SetId(channel.ID) + if err := d.Set("author_id", channel.AuthorID); err != nil { + return diag.FromErr(err) + } + + if err := d.Set("created_at", channel.CreatedAt.String()); err != nil { + return diag.FromErr(err) + } + + if err := d.Set("iteration", flattenIterationConfig(channel.Iteration)); err != nil { + return diag.FromErr(err) + } + + if err := d.Set("updated_at", channel.UpdatedAt.String()); err != nil { + return diag.FromErr(err) + } + + return nil +} + +func expandIterationConfig(config map[string]interface{}) *packermodels.HashicorpCloudPackerIteration { + if config == nil { + return nil + } + + var iteration packermodels.HashicorpCloudPackerIteration + if v, ok := config["id"]; ok && v.(string) != "" { + iteration.ID = v.(string) + } + if v, ok := config["fingerprint"]; ok && v.(string) != "" { + iteration.Fingerprint = v.(string) + } + if v, ok := config["incremental_version"]; ok && v.(int) != 0 { + iteration.IncrementalVersion = int32(v.(int)) + } + + return &iteration +} + +func flattenIterationConfig(iteration *packermodels.HashicorpCloudPackerIteration) []map[string]interface{} { + result := make([]map[string]interface{}, 0) + if iteration == nil { + return result + } + + item := make(map[string]interface{}) + item["id"] = iteration.ID + item["fingerprint"] = iteration.Fingerprint + item["incremental_version"] = iteration.IncrementalVersion + return append(result, item) +} diff --git a/internal/provider/resource_packer_channel_test.go b/internal/provider/resource_packer_channel_test.go new file mode 100644 index 000000000..292c9bd74 --- /dev/null +++ b/internal/provider/resource_packer_channel_test.go @@ -0,0 +1,247 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package provider + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" +) + +func TestAccPackerChannel(t *testing.T) { + resourceName := "hcp_packer_channel.production" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t, map[string]bool{"aws": false, "azure": false}) }, + ProviderFactories: providerFactories, + CheckDestroy: func(*terraform.State) error { + deleteBucket(t, acctestAlpineBucket, false) + return nil + }, + + Steps: []resource.TestStep{ + { + PreConfig: func() { upsertBucket(t, acctestAlpineBucket) }, + Config: testConfig(testAccPackerChannelBasic(acctestAlpineBucket, acctestProductionChannel)), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet(resourceName, "author_id"), + resource.TestCheckResourceAttr(resourceName, "bucket_name", acctestAlpineBucket), + resource.TestCheckResourceAttrSet(resourceName, "created_at"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "name", acctestProductionChannel), + resource.TestCheckResourceAttrSet(resourceName, "organization_id"), + resource.TestCheckResourceAttrSet(resourceName, "project_id"), + resource.TestCheckResourceAttrSet(resourceName, "updated_at"), + ), + }, + // Testing that we can import bucket channel created in the previous step and that the + // resource terraform state will be exactly the same + { + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: func(s *terraform.State) (string, error) { + rs, ok := s.RootModule().Resources[resourceName] + if !ok { + return "", fmt.Errorf("not found: %s", resourceName) + } + + bucketName := rs.Primary.Attributes["bucket_name"] + channelName := rs.Primary.Attributes["name"] + return fmt.Sprintf("%s:%s", bucketName, channelName), nil + }, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccPackerChannel_AssignedIteration(t *testing.T) { + resourceName := "hcp_packer_channel.production" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t, map[string]bool{"aws": false, "azure": false}) }, + ProviderFactories: providerFactories, + CheckDestroy: func(*terraform.State) error { + deleteBucket(t, acctestAlpineBucket, false) + return nil + }, + Steps: []resource.TestStep{ + { + PreConfig: func() { + fingerprint := "channel-assigned-iteration" + upsertBucket(t, acctestAlpineBucket) + upsertIteration(t, acctestAlpineBucket, fingerprint) + itID, err := getIterationIDFromFingerPrint(t, acctestAlpineBucket, fingerprint) + if err != nil { + t.Fatal(err.Error()) + } + upsertBuild(t, acctestAlpineBucket, fingerprint, itID) + }, + Config: testConfig(testAccPackerChannelAssignedLatestIteration(acctestAlpineBucket, acctestProductionChannel)), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet(resourceName, "author_id"), + resource.TestCheckResourceAttr(resourceName, "bucket_name", acctestAlpineBucket), + resource.TestCheckResourceAttrSet(resourceName, "created_at"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttrSet(resourceName, "iteration.0.id"), + resource.TestCheckResourceAttrSet(resourceName, "iteration.0.incremental_version"), + resource.TestCheckResourceAttr(resourceName, "iteration.0.fingerprint", "channel-assigned-iteration"), + resource.TestCheckResourceAttrSet(resourceName, "updated_at"), + ), + }, + // Testing that we can import bucket channel created in the previous step and that the + // resource terraform state will be exactly the same + { + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: func(s *terraform.State) (string, error) { + rs, ok := s.RootModule().Resources[resourceName] + if !ok { + return "", fmt.Errorf("not found: %s", resourceName) + } + + bucketName := rs.Primary.Attributes["bucket_name"] + channelName := rs.Primary.Attributes["name"] + return fmt.Sprintf("%s:%s", bucketName, channelName), nil + }, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccPackerChannel_UpdateAssignedIteration(t *testing.T) { + resourceName := "hcp_packer_channel.production" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t, map[string]bool{"aws": false, "azure": false}) }, + ProviderFactories: providerFactories, + CheckDestroy: func(*terraform.State) error { + deleteBucket(t, acctestAlpineBucket, false) + return nil + }, + Steps: []resource.TestStep{ + { + PreConfig: func() { + fingerprint := "channel-update-it1" + upsertBucket(t, acctestAlpineBucket) + upsertIteration(t, acctestAlpineBucket, fingerprint) + itID, err := getIterationIDFromFingerPrint(t, acctestAlpineBucket, fingerprint) + if err != nil { + t.Fatal(err.Error()) + } + upsertBuild(t, acctestAlpineBucket, fingerprint, itID) + }, + Config: testConfig(testAccPackerChannelAssignedLatestIteration(acctestAlpineBucket, acctestProductionChannel)), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet(resourceName, "author_id"), + resource.TestCheckResourceAttrSet(resourceName, "created_at"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "bucket_name", acctestAlpineBucket), + resource.TestCheckResourceAttr(resourceName, "name", acctestProductionChannel), + resource.TestCheckResourceAttrSet(resourceName, "iteration.0.id"), + resource.TestCheckResourceAttr(resourceName, "iteration.0.fingerprint", "channel-update-it1"), + ), + }, + { + PreConfig: func() { + fingerprint := "channel-update-it2" + upsertIteration(t, acctestAlpineBucket, fingerprint) + itID, err := getIterationIDFromFingerPrint(t, acctestAlpineBucket, fingerprint) + if err != nil { + t.Fatal(err.Error()) + } + upsertBuild(t, acctestAlpineBucket, fingerprint, itID) + }, + Config: testConfig(testAccPackerChannelAssignedLatestIteration(acctestAlpineBucket, acctestProductionChannel)), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet(resourceName, "author_id"), + resource.TestCheckResourceAttr(resourceName, "bucket_name", acctestAlpineBucket), + resource.TestCheckResourceAttrSet(resourceName, "created_at"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttrSet(resourceName, "iteration.0.id"), + resource.TestCheckResourceAttrSet(resourceName, "iteration.0.incremental_version"), + resource.TestCheckResourceAttr(resourceName, "iteration.0.fingerprint", "channel-update-it2"), + resource.TestCheckResourceAttr(resourceName, "name", acctestProductionChannel), + resource.TestCheckResourceAttrSet(resourceName, "updated_at"), + ), + }, + }, + }) +} + +func TestAccPackerChannel_UpdateAssignedIterationWithFingerprint(t *testing.T) { + resourceName := "hcp_packer_channel.production" + + fingerprint := "channel-update-it1" + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t, map[string]bool{"aws": false, "azure": false}) }, + ProviderFactories: providerFactories, + CheckDestroy: func(*terraform.State) error { + deleteBucket(t, acctestAlpineBucket, false) + return nil + }, + Steps: []resource.TestStep{ + { + PreConfig: func() { + upsertBucket(t, acctestAlpineBucket) + upsertIteration(t, acctestAlpineBucket, fingerprint) + itID, err := getIterationIDFromFingerPrint(t, acctestAlpineBucket, fingerprint) + if err != nil { + t.Fatal(err.Error()) + } + upsertBuild(t, acctestAlpineBucket, fingerprint, itID) + }, + Config: testConfig(testAccPackerChannelIterationFingerprint(acctestAlpineBucket, acctestProductionChannel, fingerprint)), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet(resourceName, "author_id"), + resource.TestCheckResourceAttr(resourceName, "bucket_name", acctestAlpineBucket), + resource.TestCheckResourceAttrSet(resourceName, "created_at"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttrSet(resourceName, "iteration.0.fingerprint"), + resource.TestCheckResourceAttrSet(resourceName, "iteration.0.id"), + resource.TestCheckResourceAttrSet(resourceName, "iteration.0.incremental_version"), + resource.TestCheckResourceAttr(resourceName, "name", acctestProductionChannel), + resource.TestCheckResourceAttrSet(resourceName, "updated_at"), + ), + }, + }, + }) +} + +var testAccPackerChannelBasic = func(bucketName, channelName string) string { + return fmt.Sprintf(` + resource "hcp_packer_channel" "production" { + bucket_name = %q + name = %q + }`, bucketName, channelName) +} + +var testAccPackerChannelAssignedLatestIteration = func(bucketName, channelName string) string { + return fmt.Sprintf(` + data "hcp_packer_image_iteration" "test" { + bucket_name = %[2]q + channel = "latest" + } + resource "hcp_packer_channel" "production" { + name = %[1]q + bucket_name = %[2]q + iteration { + id = data.hcp_packer_image_iteration.test.id + } + }`, channelName, bucketName) +} + +var testAccPackerChannelIterationFingerprint = func(bucketName, channelName, fingerprint string) string { + return fmt.Sprintf(` + resource "hcp_packer_channel" "production" { + bucket_name = %q + name = %q + iteration { + fingerprint = %q + } + }`, bucketName, channelName, fingerprint) +} diff --git a/internal/provider/resource_vault_cluster.go b/internal/provider/resource_vault_cluster.go index d74c02eeb..c9f68554c 100644 --- a/internal/provider/resource_vault_cluster.go +++ b/internal/provider/resource_vault_cluster.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( @@ -23,11 +26,11 @@ var defaultVaultClusterTimeout = time.Minute * 5 // createUpdateVaultClusterTimeout is the amount of time that can elapse // before a cluster create operation should timeout. -var createUpdateVaultClusterTimeout = time.Minute * 35 +var createUpdateVaultClusterTimeout = time.Minute * 75 // deleteVaultClusterTimeout is the amount of time that can elapse // before a cluster delete operation should timeout. -var deleteVaultClusterTimeout = time.Minute * 25 +var deleteVaultClusterTimeout = time.Minute * 75 func resourceVaultCluster() *schema.Resource { return &schema.Resource{ @@ -63,7 +66,7 @@ func resourceVaultCluster() *schema.Resource { }, // Optional fields "tier": { - Description: "Tier of the HCP Vault cluster. Valid options for tiers - `dev`, `starter_small`, `standard_small`, `standard_medium`, `standard_large`, `plus_small`, `plus_medium`, `plus_large`. See [pricing information](https://cloud.hashicorp.com/pricing/vault). Changing a cluster's size or tier is only available to admins. See [Scale a cluster](https://registry.terraform.io/providers/hashicorp/hcp/latest/docs/guides/vault-scaling).", + Description: "Tier of the HCP Vault cluster. Valid options for tiers - `dev`, `starter_small`, `standard_small`, `standard_medium`, `standard_large`, `plus_small`, `plus_medium`, `plus_large`. See [pricing information](https://www.hashicorp.com/products/vault/pricing). Changing a cluster's size or tier is only available to admins. See [Scale a cluster](https://registry.terraform.io/providers/hashicorp/hcp/latest/docs/guides/vault-scaling).", Type: schema.TypeString, Optional: true, Computed: true, diff --git a/internal/provider/resource_vault_cluster_admin_token.go b/internal/provider/resource_vault_cluster_admin_token.go index e28d46e39..1b076d78e 100644 --- a/internal/provider/resource_vault_cluster_admin_token.go +++ b/internal/provider/resource_vault_cluster_admin_token.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( diff --git a/internal/provider/resource_vault_cluster_config_test.go b/internal/provider/resource_vault_cluster_config_test.go index a7191317d..5bf830569 100644 --- a/internal/provider/resource_vault_cluster_config_test.go +++ b/internal/provider/resource_vault_cluster_config_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( diff --git a/internal/provider/resource_vault_cluster_const_test.go b/internal/provider/resource_vault_cluster_const_test.go new file mode 100644 index 000000000..b6dae1070 --- /dev/null +++ b/internal/provider/resource_vault_cluster_const_test.go @@ -0,0 +1,111 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package provider + +import ( + "bytes" + "fmt" + "testing" + "text/template" + + "github.com/stretchr/testify/require" +) + +const ( + cloudProviderAWS = "aws" + cloudProviderAzure = "azure" + azureRegion = "westus2" + awsRegion = "us-west-2" + vaultClusterResourceName = "hcp_vault_cluster.test" + vaultClusterDataSourceName = "data.hcp_vault_cluster.test" + adminTokenResourceName = "hcp_vault_cluster_admin_token.test" +) + +const vaultCluster = ` +resource "hcp_vault_cluster" "test" { + cluster_id = "{{ .ClusterID }}" + hvn_id = hcp_hvn.test.hvn_id + tier = "{{ .Tier }}" +} +` + +// sets public_endpoint to true and add metrics and audit log +const updatedVaultClusterPublicAndMetricsAuditLog = ` +resource "hcp_vault_cluster" "test" { + cluster_id = "{{ .ClusterID }}" + hvn_id = hcp_hvn.test.hvn_id + tier = "{{ .Tier }}" + public_endpoint = {{ .PublicEndpoint }} + metrics_config { + splunk_hecendpoint = "https://http-input-splunkcloud.com" + splunk_token = "test" + } + audit_log_config { + datadog_api_key = "test_datadog" + datadog_region = "us1" + } + major_version_upgrade_config { + upgrade_type = "MANUAL" + } +} +` + +// changes tier, remove any metrics or audit log config, optionally toggle public +// endpoint on or off +const updatedVaultClusterTierAndMVUConfig = ` +resource "hcp_vault_cluster" "test" { + cluster_id = "{{ .ClusterID }}" + hvn_id = hcp_hvn.test.hvn_id + tier = "{{ .Tier }}" + public_endpoint = {{ .PublicEndpoint }} + major_version_upgrade_config { + upgrade_type = "SCHEDULED" + maintenance_window_day = "WEDNESDAY" + maintenance_window_time = "WINDOW_12AM_4AM" + } +} +` + +func setTestAccVaultClusterConfig(t *testing.T, tfCode string, in inputT, tier string) string { + tfTemplate := fmt.Sprintf(` +resource "hcp_hvn" "test" { + hvn_id = "{{ .HvnID }}" + cloud_provider = "{{ .CloudProvider }}" + region = "{{ .Region }}" +} + +%s + +data "hcp_vault_cluster" "test" { + cluster_id = hcp_vault_cluster.test.cluster_id +} + +resource "hcp_vault_cluster_admin_token" "test" { + cluster_id = hcp_vault_cluster.test.cluster_id +} +`, tfCode) + + tmpl, err := template.New("tf_resources").Parse(tfTemplate) + require.NoError(t, err) + + tfResources := &bytes.Buffer{} + err = tmpl.Execute(tfResources, struct { + ClusterID string + HvnID string + HvnCidr string + CloudProvider string + Region string + Tier string + PublicEndpoint string + }{ + ClusterID: in.VaultClusterName, + HvnID: in.HvnName, + CloudProvider: in.CloudProvider, + Region: in.Region, + Tier: tier, + PublicEndpoint: in.PublicEndpoint, + }) + require.NoError(t, err) + return tfResources.String() +} diff --git a/internal/provider/resource_vault_cluster_perf_replication_test.go b/internal/provider/resource_vault_cluster_perf_replication_test.go new file mode 100644 index 000000000..cedb82d85 --- /dev/null +++ b/internal/provider/resource_vault_cluster_perf_replication_test.go @@ -0,0 +1,369 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package provider + +import ( + "bytes" + "fmt" + "regexp" + "testing" + "text/template" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/stretchr/testify/require" +) + +const ( + hvn1ResourceName = "hcp_hvn.hvn1" + hvn2ResourceName = "hcp_hvn.hvn2" + primaryVaultResourceName = "hcp_vault_cluster.c1" + secondaryVaultResourceName = "hcp_vault_cluster.c2" +) + +func setTestAccPerformanceReplicationE2E(t *testing.T, tfCode string, in *inputT) string { + templates := fmt.Sprintf(` + resource "hcp_hvn" "hvn1" { + hvn_id = "{{ .HvnName }}" + cidr_block = "{{ .GetHvnCidr }}" + cloud_provider = "{{ .CloudProvider }}" + region = "{{ .Region }}" + } + + resource "hcp_hvn" "hvn2" { + hvn_id = "{{ .Secondary.HvnName }}" + cidr_block = "{{ .Secondary.GetHvnCidr }}" + cloud_provider = "{{ .Secondary.CloudProvider }}" + region = "{{ .Secondary.Region }}" + } + + %s + `, tfCode) + + tmpl, err := template.New("tf_resources_perf_repl").Parse(templates) + require.NoError(t, err) + + tfResources := &bytes.Buffer{} + err = tmpl.Execute(tfResources, in) + require.NoError(t, err) + return tfResources.String() +} + +func TestAccPerformanceReplication_ValidationsAws(t *testing.T) { + awsPerfReplicationTestInput := &inputT{ + HvnName: addTimestampSuffix("test-perf-hvn-1-"), + HvnCidr: "172.25.16.0/20", + VaultClusterName: addTimestampSuffix("test-primary-aws-"), + VaultClusterResourceName: primaryVaultResourceName, + CloudProvider: cloudProviderAWS, + Region: awsRegion, + Tier: "PLUS_SMALL", + UpdateTier1: "PLUS_MEDIUM", + UpdateTier2: "STARTER_SMALL", + Secondary: &inputT{ + HvnName: addTimestampSuffix("test-perf-hvn-2-"), + HvnCidr: "172.24.16.0/20", + VaultClusterName: addTimestampSuffix("test-secondary-aws-"), + VaultClusterResourceName: secondaryVaultResourceName, + CloudProvider: cloudProviderAWS, + Region: awsRegion, + Tier: "PLUS_SMALL", + }, + } + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t, map[string]bool{"aws": false, "azure": false}) }, + ProviderFactories: providerFactories, + CheckDestroy: testAccCheckVaultClusterDestroy, + Steps: performanceReplicationSteps(t, awsPerfReplicationTestInput), + }) +} + +func performanceReplicationSteps(t *testing.T, in *inputT) []resource.TestStep { + return []resource.TestStep{ + { + Config: testConfig(setTestAccPerformanceReplicationE2E(t, "", in)), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(hvn1ResourceName, "hvn_id", in.HvnName), + resource.TestCheckResourceAttr(hvn1ResourceName, "cidr_block", in.HvnCidr), + resource.TestCheckResourceAttr(hvn2ResourceName, "hvn_id", in.Secondary.HvnName), + resource.TestCheckResourceAttr(hvn2ResourceName, "cidr_block", in.Secondary.HvnCidr), + ), + }, + { + // invalid primary link supplied + Config: testConfig(setTestAccPerformanceReplicationE2E(t, ` + resource "hcp_vault_cluster" "c1" { + cluster_id = "{{ .Secondary.VaultClusterName }}" + hvn_id = hcp_hvn.hvn1.hvn_id + tier = "{{ .Secondary.Tier }}" + primary_link = "something" + public_endpoint = true + } + `, in)), + ExpectError: regexp.MustCompile(`invalid primary_link supplied*`), + }, + { + // incorrectly specify a paths_filter on a non-secondary + Config: testConfig(setTestAccPerformanceReplicationE2E(t, ` + resource "hcp_vault_cluster" "c1" { + cluster_id = "{{ .VaultClusterName }}" + hvn_id = hcp_hvn.hvn1.hvn_id + tier = "{{ .Tier }}" + paths_filter = ["path/a"] + } + `, in)), + ExpectError: regexp.MustCompile(`only performance replication secondaries may specify a paths_filter`), + }, + { + // create a plus tier cluster successfully + Config: testConfig(setTestAccPerformanceReplicationE2E(t, ` + resource "hcp_vault_cluster" "c1" { + cluster_id = "{{ .VaultClusterName }}" + hvn_id = hcp_hvn.hvn1.hvn_id + tier = "{{ .Tier }}" + public_endpoint = true + } + `, in)), + Check: resource.ComposeTestCheckFunc( + testAccCheckVaultClusterExists(primaryVaultResourceName), + resource.TestCheckResourceAttr(primaryVaultResourceName, "cluster_id", in.VaultClusterName), + resource.TestCheckResourceAttr(primaryVaultResourceName, "hvn_id", in.HvnName), + resource.TestCheckResourceAttr(primaryVaultResourceName, "tier", in.Tier), + resource.TestCheckResourceAttr(primaryVaultResourceName, "cloud_provider", in.CloudProvider), + resource.TestCheckResourceAttr(primaryVaultResourceName, "region", in.Region), + resource.TestCheckResourceAttr(primaryVaultResourceName, "public_endpoint", "true"), + resource.TestCheckResourceAttr(primaryVaultResourceName, "namespace", "admin"), + resource.TestCheckResourceAttrSet(primaryVaultResourceName, "vault_version"), + resource.TestCheckResourceAttrSet(primaryVaultResourceName, "organization_id"), + resource.TestCheckResourceAttrSet(primaryVaultResourceName, "project_id"), + resource.TestCheckResourceAttrSet(primaryVaultResourceName, "vault_public_endpoint_url"), + resource.TestCheckResourceAttrSet(primaryVaultResourceName, "self_link"), + resource.TestCheckResourceAttrSet(primaryVaultResourceName, "vault_private_endpoint_url"), + testAccCheckFullURL(primaryVaultResourceName, "vault_private_endpoint_url", ""), + resource.TestCheckResourceAttrSet(primaryVaultResourceName, "created_at"), + ), + }, + { + // secondary cluster creation failed as tier doesn't match the tier of primary + Config: testConfig(setTestAccPerformanceReplicationE2E(t, ` + resource "hcp_vault_cluster" "c1" { + cluster_id = "{{ .VaultClusterName }}" + hvn_id = hcp_hvn.hvn1.hvn_id + tier = "{{ .Tier }}" + public_endpoint = true + } + resource "hcp_vault_cluster" "c2" { + cluster_id = "{{ .Secondary.VaultClusterName }}" + hvn_id = hcp_hvn.hvn1.hvn_id + tier = "plus_medium" + primary_link = hcp_vault_cluster.c1.self_link + } + `, in)), + ExpectError: regexp.MustCompile(`a secondary's tier must match that of its primary`), + }, + { + // secondary cluster creation failed as primary link is invalid + Config: testConfig(setTestAccPerformanceReplicationE2E(t, ` + resource "hcp_vault_cluster" "c1" { + cluster_id = "{{ .VaultClusterName }}" + hvn_id = hcp_hvn.hvn1.hvn_id + tier = "{{ .Tier }}" + public_endpoint = true + } + resource "hcp_vault_cluster" "c2" { + cluster_id = "{{ .Secondary.VaultClusterName }}" + hvn_id = hcp_hvn.hvn1.hvn_id + tier = hcp_vault_cluster.c1.tier + primary_link = "not-present" + } + `, in)), + ExpectError: regexp.MustCompile(`invalid primary_link supplied url`), + }, + { + // secondary cluster creation failed as min_vault_version is specified. + Config: testConfig(setTestAccPerformanceReplicationE2E(t, ` + resource "hcp_vault_cluster" "c1" { + cluster_id = "{{ .VaultClusterName }}" + hvn_id = hcp_hvn.hvn1.hvn_id + tier = "{{ .Tier }}" + public_endpoint = true + } + resource "hcp_vault_cluster" "c2" { + cluster_id = "{{ .Secondary.VaultClusterName }}" + hvn_id = hcp_hvn.hvn1.hvn_id + tier = hcp_vault_cluster.c1.tier + primary_link = hcp_vault_cluster.c1.self_link + min_vault_version = "v1.0.1" + } + `, in)), + ExpectError: regexp.MustCompile(`min_vault_version should either be unset or match the primary cluster's`), + }, + { + // secondary cluster created successfully (same hvn) + Config: testConfig(setTestAccPerformanceReplicationE2E(t, ` + resource "hcp_vault_cluster" "c1" { + cluster_id = "{{ .VaultClusterName }}" + hvn_id = hcp_hvn.hvn1.hvn_id + tier = "{{ .Tier }}" + public_endpoint = true + } + resource "hcp_vault_cluster" "c2" { + cluster_id = "{{ .Secondary.VaultClusterName }}" + hvn_id = hcp_hvn.hvn1.hvn_id + tier = lower(hcp_vault_cluster.c1.tier) + primary_link = hcp_vault_cluster.c1.self_link + paths_filter = ["path/a", "path/b"] + } + `, in)), + Check: resource.ComposeTestCheckFunc( + testAccCheckVaultClusterExists(primaryVaultResourceName), + resource.TestCheckResourceAttr(secondaryVaultResourceName, "cluster_id", in.Secondary.VaultClusterName), + resource.TestCheckResourceAttr(secondaryVaultResourceName, "hvn_id", in.HvnName), // same as primary + resource.TestCheckResourceAttr(secondaryVaultResourceName, "tier", in.Secondary.Tier), + resource.TestCheckResourceAttr(secondaryVaultResourceName, "cloud_provider", in.CloudProvider), // same as primary + resource.TestCheckResourceAttr(secondaryVaultResourceName, "region", in.Region), // samae as primary + resource.TestCheckResourceAttr(secondaryVaultResourceName, "public_endpoint", "false"), + resource.TestCheckResourceAttr(secondaryVaultResourceName, "paths_filter.0", "path/a"), + resource.TestCheckResourceAttr(secondaryVaultResourceName, "paths_filter.1", "path/b"), + resource.TestCheckResourceAttr(secondaryVaultResourceName, "namespace", "admin"), + resource.TestCheckResourceAttrSet(secondaryVaultResourceName, "vault_version"), + resource.TestCheckResourceAttrSet(secondaryVaultResourceName, "organization_id"), + resource.TestCheckResourceAttrSet(secondaryVaultResourceName, "project_id"), + resource.TestCheckNoResourceAttr(secondaryVaultResourceName, "vault_public_endpoint_url"), + resource.TestCheckResourceAttrSet(secondaryVaultResourceName, "self_link"), + resource.TestCheckResourceAttrSet(secondaryVaultResourceName, "vault_private_endpoint_url"), + testAccCheckFullURL(secondaryVaultResourceName, "vault_private_endpoint_url", ""), + resource.TestCheckResourceAttrSet(secondaryVaultResourceName, "created_at"), + ), + }, + { + // update paths filter + Config: testConfig(setTestAccPerformanceReplicationE2E(t, ` + resource "hcp_vault_cluster" "c1" { + cluster_id = "{{ .VaultClusterName }}" + hvn_id = hcp_hvn.hvn1.hvn_id + tier = "{{ .Tier }}" + public_endpoint = true + } + resource "hcp_vault_cluster" "c2" { + cluster_id = "{{ .Secondary.VaultClusterName }}" + hvn_id = hcp_hvn.hvn1.hvn_id + tier = hcp_vault_cluster.c1.tier + primary_link = hcp_vault_cluster.c1.self_link + paths_filter = ["path/a", "path/c"] + } + `, in)), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(secondaryVaultResourceName, "paths_filter.0", "path/a"), + resource.TestCheckResourceAttr(secondaryVaultResourceName, "paths_filter.1", "path/c"), + ), + }, + { + // delete paths filter + Config: testConfig(setTestAccPerformanceReplicationE2E(t, ` + resource "hcp_vault_cluster" "c1" { + cluster_id = "{{ .VaultClusterName }}" + hvn_id = hcp_hvn.hvn1.hvn_id + tier = "{{ .Tier }}" + public_endpoint = true + } + resource "hcp_vault_cluster" "c2" { + cluster_id = "{{ .Secondary.VaultClusterName }}" + hvn_id = hcp_hvn.hvn1.hvn_id + tier = hcp_vault_cluster.c1.tier + primary_link = hcp_vault_cluster.c1.self_link + } + `, in)), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckNoResourceAttr(secondaryVaultResourceName, "paths_filter.0"), + ), + }, + { + // secondary cluster created successfully (different hvn) + Config: testConfig(setTestAccPerformanceReplicationE2E(t, ` + resource "hcp_vault_cluster" "c1" { + cluster_id = "{{ .VaultClusterName }}" + hvn_id = hcp_hvn.hvn1.hvn_id + tier = "{{ .Tier }}" + public_endpoint = true + } + resource "hcp_vault_cluster" "c2" { + cluster_id = "{{ .Secondary.VaultClusterName }}" + hvn_id = hcp_hvn.hvn2.hvn_id + tier = lower(hcp_vault_cluster.c1.tier) + primary_link = hcp_vault_cluster.c1.self_link + } + `, in)), + Check: resource.ComposeTestCheckFunc( + testAccCheckVaultClusterExists(primaryVaultResourceName), + testAccCheckVaultClusterExists(secondaryVaultResourceName), + resource.TestCheckResourceAttr(secondaryVaultResourceName, "cluster_id", in.Secondary.VaultClusterName), + resource.TestCheckResourceAttr(secondaryVaultResourceName, "hvn_id", in.Secondary.HvnName), + resource.TestCheckResourceAttr(secondaryVaultResourceName, "tier", in.Secondary.Tier), + resource.TestCheckResourceAttr(secondaryVaultResourceName, "cloud_provider", in.Secondary.CloudProvider), + resource.TestCheckResourceAttr(secondaryVaultResourceName, "region", in.Secondary.Region), + resource.TestCheckResourceAttr(secondaryVaultResourceName, "public_endpoint", "false"), + resource.TestCheckResourceAttr(secondaryVaultResourceName, "namespace", "admin"), + resource.TestCheckResourceAttrSet(secondaryVaultResourceName, "vault_version"), + resource.TestCheckResourceAttrSet(secondaryVaultResourceName, "organization_id"), + resource.TestCheckResourceAttrSet(secondaryVaultResourceName, "project_id"), + resource.TestCheckNoResourceAttr(secondaryVaultResourceName, "vault_public_endpoint_url"), + resource.TestCheckResourceAttrSet(secondaryVaultResourceName, "self_link"), + resource.TestCheckResourceAttrSet(secondaryVaultResourceName, "vault_private_endpoint_url"), + testAccCheckFullURL(secondaryVaultResourceName, "vault_private_endpoint_url", ""), + resource.TestCheckResourceAttrSet(secondaryVaultResourceName, "created_at"), + ), + }, + { + // successfully scale replication group + Config: testConfig(setTestAccPerformanceReplicationE2E(t, ` + resource "hcp_vault_cluster" "c1" { + cluster_id = "{{ .VaultClusterName }}" + hvn_id = hcp_hvn.hvn1.hvn_id + tier = "{{ .UpdateTier1 }}" + public_endpoint = true + } + resource "hcp_vault_cluster" "c2" { + cluster_id = "{{ .Secondary.VaultClusterName }}" + hvn_id = hcp_hvn.hvn2.hvn_id + tier = lower(hcp_vault_cluster.c1.tier) + primary_link = hcp_vault_cluster.c1.self_link + } + `, in)), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(primaryVaultResourceName, "tier", in.UpdateTier1), + resource.TestCheckResourceAttr(secondaryVaultResourceName, "tier", in.UpdateTier1), + ), + }, + { + // successfully disable replication + Config: testConfig(setTestAccPerformanceReplicationE2E(t, ` + resource "hcp_vault_cluster" "c1" { + cluster_id = "{{ .VaultClusterName }}" + hvn_id = hcp_hvn.hvn1.hvn_id + tier = "{{ .UpdateTier1 }}" + public_endpoint = true + } + `, in)), + Check: resource.ComposeTestCheckFunc( + testAccCheckVaultClusterExists(primaryVaultResourceName), + ), + }, + { + // successfully scale out of the Plus tier + Config: testConfig(setTestAccPerformanceReplicationE2E(t, ` + resource "hcp_vault_cluster" "c1" { + cluster_id = "{{ .VaultClusterName }}" + hvn_id = hcp_hvn.hvn1.hvn_id + tier = "{{ .UpdateTier2 }}" + public_endpoint = true + } + `, in)), + Check: resource.ComposeTestCheckFunc( + testAccCheckVaultClusterExists(primaryVaultResourceName), + resource.TestCheckResourceAttr(primaryVaultResourceName, "tier", in.UpdateTier2), + ), + }, + } +} diff --git a/internal/provider/resource_vault_cluster_test.go b/internal/provider/resource_vault_cluster_test.go index 8c36b3d75..d80ffd8b8 100644 --- a/internal/provider/resource_vault_cluster_test.go +++ b/internal/provider/resource_vault_cluster_test.go @@ -1,231 +1,96 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( "context" "fmt" - "regexp" "testing" + "time" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" "github.com/hashicorp/terraform-provider-hcp/internal/clients" ) -const vaultCluster = ` -resource "hcp_vault_cluster" "test" { - cluster_id = "test-vault-cluster" - hvn_id = hcp_hvn.test.hvn_id - tier = "dev" -} -` - -// sets public_endpoint to true and add metrics and audit log -const updatedVaultClusterPublicAndMetricsAuditLog = ` -resource "hcp_vault_cluster" "test" { - cluster_id = "test-vault-cluster" - hvn_id = hcp_hvn.test.hvn_id - tier = "standard_small" - public_endpoint = true - metrics_config { - splunk_hecendpoint = "https://http-input-splunkcloud.com" - splunk_token = "test" - } - audit_log_config { - datadog_api_key = "test_datadog" - datadog_region = "us1" - } - major_version_upgrade_config { - upgrade_type = "MANUAL" - } -} -` - -// changes tier -const updatedVaultClusterTierAndMVUConfig = ` -resource "hcp_vault_cluster" "test" { - cluster_id = "test-vault-cluster" - hvn_id = hcp_hvn.test.hvn_id - tier = "standard_small" - major_version_upgrade_config { - upgrade_type = "SCHEDULED" - maintenance_window_day = "WEDNESDAY" - maintenance_window_time = "WINDOW_12AM_4AM" - } -} -` - -// changes tier and sets public_endpoint to true also removes the metric/audit logs -const updatedVaultClusterTierAndPublic = ` -resource "hcp_vault_cluster" "test" { - cluster_id = "test-vault-cluster" - hvn_id = hcp_hvn.test.hvn_id - tier = "standard_medium" - public_endpoint = true -} -` - -func setTestAccVaultClusterConfig(vaultCluster string) string { - return fmt.Sprintf(` -resource "hcp_hvn" "test" { - hvn_id = "test-hvn" - cloud_provider = "aws" - region = "us-west-2" +type inputT struct { + VaultClusterName string + HvnName string + HvnCidr string // optional + VaultClusterResourceName string + VaultClusterDataSourceName string + AdminTokenResourceName string + CloudProvider string + Region string + Tier string + UpdateTier1 string + UpdateTier2 string + PublicEndpoint string + Secondary *inputT // optional + tf string } -%s +func (in *inputT) GetHvnCidr() string { + if in.HvnCidr == "" { + return "172.25.16.0/20" + } -data "hcp_vault_cluster" "test" { - cluster_id = hcp_vault_cluster.test.cluster_id + return in.HvnCidr } -resource "hcp_vault_cluster_admin_token" "test" { - cluster_id = hcp_vault_cluster.test.cluster_id -} -`, vaultCluster) +// This includes tests against both the resource, the corresponding datasource, and the dependent admin token resource +// to shorten testing time. +func TestAccVaultClusterAzure(t *testing.T) { + azureTestInput := inputT{ + VaultClusterName: addTimestampSuffix("test-vault-azure-"), + HvnName: addTimestampSuffix("test-hvn-azure-"), + VaultClusterResourceName: vaultClusterResourceName, + VaultClusterDataSourceName: vaultClusterDataSourceName, + AdminTokenResourceName: adminTokenResourceName, + CloudProvider: cloudProviderAzure, + Region: azureRegion, + Tier: "DEV", + UpdateTier1: "STANDARD_SMALL", + UpdateTier2: "STANDARD_MEDIUM", + PublicEndpoint: "false", + } + tf := setTestAccVaultClusterConfig(t, vaultCluster, azureTestInput, azureTestInput.Tier) + // save so e don't have to generate this again and again + azureTestInput.tf = tf + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t, map[string]bool{"aws": false, "azure": false}) }, + ProviderFactories: providerFactories, + CheckDestroy: testAccCheckVaultClusterDestroy, + Steps: azureTestSteps(t, azureTestInput), + }) } // This includes tests against both the resource, the corresponding datasource, and the dependent admin token resource // to shorten testing time. -func TestAccVaultCluster(t *testing.T) { - vaultClusterResourceName := "hcp_vault_cluster.test" - vaultClusterDataSourceName := "data.hcp_vault_cluster.test" - adminTokenResourceName := "hcp_vault_cluster_admin_token.test" +func TestAccVaultClusterAWS(t *testing.T) { + awsTestInput := inputT{ + VaultClusterName: addTimestampSuffix("test-vault-aws-"), + HvnName: addTimestampSuffix("test-hvn-aws-"), + VaultClusterResourceName: vaultClusterResourceName, + VaultClusterDataSourceName: vaultClusterDataSourceName, + AdminTokenResourceName: adminTokenResourceName, + CloudProvider: cloudProviderAWS, + Region: awsRegion, + Tier: "DEV", + UpdateTier1: "STANDARD_SMALL", + UpdateTier2: "STANDARD_MEDIUM", + PublicEndpoint: "false", + } - resource.Test(t, resource.TestCase{ + tf := setTestAccVaultClusterConfig(t, vaultCluster, awsTestInput, awsTestInput.Tier) + // save so e don't have to generate this again and again + awsTestInput.tf = tf + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t, map[string]bool{"aws": false, "azure": false}) }, ProviderFactories: providerFactories, CheckDestroy: testAccCheckVaultClusterDestroy, - Steps: []resource.TestStep{ - // This step tests Vault cluster and admin token resource creation. - { - Config: testConfig(setTestAccVaultClusterConfig(vaultCluster)), - Check: resource.ComposeTestCheckFunc( - testAccCheckVaultClusterExists(vaultClusterResourceName), - resource.TestCheckResourceAttr(vaultClusterResourceName, "cluster_id", "test-vault-cluster"), - resource.TestCheckResourceAttr(vaultClusterResourceName, "hvn_id", "test-hvn"), - resource.TestCheckResourceAttr(vaultClusterResourceName, "tier", "DEV"), - resource.TestCheckResourceAttr(vaultClusterResourceName, "cloud_provider", "aws"), - resource.TestCheckResourceAttr(vaultClusterResourceName, "region", "us-west-2"), - resource.TestCheckResourceAttr(vaultClusterResourceName, "public_endpoint", "false"), - resource.TestCheckResourceAttr(vaultClusterResourceName, "namespace", "admin"), - resource.TestCheckResourceAttrSet(vaultClusterResourceName, "vault_version"), - resource.TestCheckResourceAttrSet(vaultClusterResourceName, "organization_id"), - resource.TestCheckResourceAttrSet(vaultClusterResourceName, "project_id"), - resource.TestCheckNoResourceAttr(vaultClusterResourceName, "vault_public_endpoint_url"), - resource.TestCheckResourceAttrSet(vaultClusterResourceName, "vault_private_endpoint_url"), - testAccCheckFullURL(vaultClusterResourceName, "vault_private_endpoint_url", ""), - resource.TestCheckResourceAttrSet(vaultClusterResourceName, "state"), - resource.TestCheckResourceAttrSet(vaultClusterResourceName, "created_at"), - - // Verifies admin token - resource.TestCheckResourceAttr(adminTokenResourceName, "cluster_id", "test-vault-cluster"), - resource.TestCheckResourceAttrSet(adminTokenResourceName, "token"), - resource.TestCheckResourceAttrSet(adminTokenResourceName, "created_at"), - ), - }, - // This step simulates an import of the resource. - { - ResourceName: vaultClusterResourceName, - ImportState: true, - ImportStateIdFunc: func(s *terraform.State) (string, error) { - rs, ok := s.RootModule().Resources[vaultClusterResourceName] - if !ok { - return "", fmt.Errorf("not found: %s", vaultClusterResourceName) - } - - return rs.Primary.Attributes["cluster_id"], nil - }, - ImportStateVerify: true, - }, - // This step is a subsequent terraform apply that verifies that no state is modified. - { - Config: testConfig(setTestAccVaultClusterConfig(vaultCluster)), - Check: resource.ComposeTestCheckFunc( - testAccCheckVaultClusterExists(vaultClusterResourceName), - resource.TestCheckResourceAttr(vaultClusterResourceName, "cluster_id", "test-vault-cluster"), - resource.TestCheckResourceAttr(vaultClusterResourceName, "hvn_id", "test-hvn"), - resource.TestCheckResourceAttr(vaultClusterResourceName, "tier", "DEV"), - resource.TestCheckResourceAttr(vaultClusterResourceName, "cloud_provider", "aws"), - resource.TestCheckResourceAttr(vaultClusterResourceName, "region", "us-west-2"), - resource.TestCheckResourceAttr(vaultClusterResourceName, "public_endpoint", "false"), - resource.TestCheckResourceAttr(vaultClusterResourceName, "namespace", "admin"), - resource.TestCheckResourceAttrSet(vaultClusterResourceName, "organization_id"), - resource.TestCheckResourceAttrSet(vaultClusterResourceName, "project_id"), - resource.TestCheckResourceAttrSet(vaultClusterResourceName, "vault_version"), - resource.TestCheckNoResourceAttr(vaultClusterResourceName, "vault_public_endpoint_url"), - resource.TestCheckResourceAttrSet(vaultClusterResourceName, "vault_private_endpoint_url"), - testAccCheckFullURL(vaultClusterResourceName, "vault_private_endpoint_url", "8200"), - resource.TestCheckResourceAttrSet(vaultClusterResourceName, "created_at"), - resource.TestCheckResourceAttrSet(vaultClusterResourceName, "state"), - ), - }, - // Tests datasource - { - Config: testConfig(setTestAccVaultClusterConfig(vaultCluster)), - Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttrPair(vaultClusterResourceName, "cluster_id", vaultClusterDataSourceName, "cluster_id"), - resource.TestCheckResourceAttrPair(vaultClusterResourceName, "hvn_id", vaultClusterDataSourceName, "hvn_id"), - resource.TestCheckResourceAttrPair(vaultClusterResourceName, "public_endpoint", vaultClusterDataSourceName, "public_endpoint"), - resource.TestCheckResourceAttrPair(vaultClusterResourceName, "min_vault_version", vaultClusterDataSourceName, "min_vault_version"), - resource.TestCheckResourceAttrPair(vaultClusterResourceName, "tier", vaultClusterDataSourceName, "tier"), - resource.TestCheckResourceAttrPair(vaultClusterResourceName, "organization_id", vaultClusterDataSourceName, "organization_id"), - resource.TestCheckResourceAttrPair(vaultClusterResourceName, "project_id", vaultClusterDataSourceName, "project_id"), - resource.TestCheckResourceAttrPair(vaultClusterResourceName, "cloud_provider", vaultClusterDataSourceName, "cloud_provider"), - resource.TestCheckResourceAttrPair(vaultClusterResourceName, "region", vaultClusterDataSourceName, "region"), - resource.TestCheckResourceAttrPair(vaultClusterResourceName, "namespace", vaultClusterDataSourceName, "namespace"), - resource.TestCheckResourceAttrPair(vaultClusterResourceName, "vault_version", vaultClusterDataSourceName, "vault_version"), - resource.TestCheckResourceAttrPair(vaultClusterResourceName, "vault_public_endpoint_url", vaultClusterDataSourceName, "vault_public_endpoint_url"), - resource.TestCheckResourceAttrPair(vaultClusterResourceName, "vault_private_endpoint_url", vaultClusterDataSourceName, "vault_private_endpoint_url"), - testAccCheckFullURL(vaultClusterResourceName, "vault_private_endpoint_url", "8200"), - resource.TestCheckResourceAttrPair(vaultClusterResourceName, "created_at", vaultClusterDataSourceName, "created_at"), - resource.TestCheckResourceAttrPair(vaultClusterResourceName, "state", vaultClusterDataSourceName, "state"), - ), - }, - // This step verifies the successful update of "tier" and mvu config - { - Config: testConfig(setTestAccVaultClusterConfig(updatedVaultClusterTierAndMVUConfig)), - Check: resource.ComposeTestCheckFunc( - testAccCheckVaultClusterExists(vaultClusterResourceName), - resource.TestCheckResourceAttr(vaultClusterResourceName, "tier", "STANDARD_SMALL"), - resource.TestCheckResourceAttr(vaultClusterResourceName, "major_version_upgrade_config.0.upgrade_type", "SCHEDULED"), - resource.TestCheckResourceAttr(vaultClusterResourceName, "major_version_upgrade_config.0.maintenance_window_day", "WEDNESDAY"), - resource.TestCheckResourceAttr(vaultClusterResourceName, "major_version_upgrade_config.0.maintenance_window_time", "WINDOW_12AM_4AM"), - ), - }, - // This step verifies the successful update of "public_endpoint", "audit_log", "metrics" and MVU config - { - Config: testConfig(setTestAccVaultClusterConfig(updatedVaultClusterPublicAndMetricsAuditLog)), - Check: resource.ComposeTestCheckFunc( - testAccCheckVaultClusterExists(vaultClusterResourceName), - resource.TestCheckResourceAttr(vaultClusterResourceName, "public_endpoint", "true"), - resource.TestCheckResourceAttrSet(vaultClusterResourceName, "vault_public_endpoint_url"), - testAccCheckFullURL(vaultClusterResourceName, "vault_public_endpoint_url", "8200"), - resource.TestCheckResourceAttrSet(vaultClusterResourceName, "vault_private_endpoint_url"), - testAccCheckFullURL(vaultClusterResourceName, "vault_private_endpoint_url", "8200"), - resource.TestCheckResourceAttr(vaultClusterResourceName, "metrics_config.0.splunk_hecendpoint", "https://http-input-splunkcloud.com"), - resource.TestCheckResourceAttrSet(vaultClusterResourceName, "metrics_config.0.splunk_token"), - resource.TestCheckResourceAttrSet(vaultClusterResourceName, "audit_log_config.0.datadog_api_key"), - resource.TestCheckResourceAttr(vaultClusterResourceName, "audit_log_config.0.datadog_region", "us1"), - resource.TestCheckResourceAttr(vaultClusterResourceName, "major_version_upgrade_config.0.upgrade_type", "MANUAL"), - ), - }, - - // This step verifies the successful update of both "tier" and "public_endpoint" and removal of "metrics" and "audit_log". - { - Config: testConfig(setTestAccVaultClusterConfig(updatedVaultClusterTierAndPublic)), - Check: resource.ComposeTestCheckFunc( - testAccCheckVaultClusterExists(vaultClusterResourceName), - resource.TestCheckResourceAttr(vaultClusterResourceName, "tier", "STANDARD_MEDIUM"), - resource.TestCheckResourceAttr(vaultClusterResourceName, "public_endpoint", "true"), - resource.TestCheckResourceAttrSet(vaultClusterResourceName, "vault_public_endpoint_url"), - testAccCheckFullURL(vaultClusterResourceName, "vault_public_endpoint_url", "8200"), - resource.TestCheckResourceAttrSet(vaultClusterResourceName, "vault_private_endpoint_url"), - testAccCheckFullURL(vaultClusterResourceName, "vault_private_endpoint_url", "8200"), - resource.TestCheckNoResourceAttr(vaultClusterResourceName, "metrics_config.0"), - resource.TestCheckNoResourceAttr(vaultClusterResourceName, "audit_log_config.0"), - ), - }, - }, + Steps: awsTestSteps(t, awsTestInput), }) } @@ -287,325 +152,188 @@ func testAccCheckVaultClusterDestroy(s *terraform.State) error { return nil } -func setTestAccPerformanceReplicationE2E(vaultCluster string) string { - return fmt.Sprintf(` -resource "hcp_hvn" "hvn1" { - hvn_id = "test-perf-hvn-1" - cidr_block = "172.25.16.0/20" - cloud_provider = "aws" - region = "us-west-2" +// utility functions +func awsTestSteps(t *testing.T, inp inputT) []resource.TestStep { + in := &inp + return []resource.TestStep{ + createClusteAndTestAdminTokenGeneration(t, in), + importResourcesInTFState(t, in), + tfApply(t, in), + testTFDataSources(t, in), + updateClusterTier(t, in), + updateVaultPublicEndpointObservabilityDataAndMVU(t, in), + updateTierPublicEndpointAndRemoveObservabilityData(t, in), + } } -resource "hcp_hvn" "hvn2" { - hvn_id = "test-perf-hvn-2" - cidr_block = "172.24.16.0/20" - cloud_provider = "aws" - region = "us-west-2" +func azureTestSteps(t *testing.T, inp inputT) []resource.TestStep { + in := &inp + return []resource.TestStep{ + createClusteAndTestAdminTokenGeneration(t, in), + importResourcesInTFState(t, in), + tfApply(t, in), + testTFDataSources(t, in), + updateClusterTier(t, in), + } } -%s -`, vaultCluster) +// This step tests Vault cluster and admin token resource creation. +func createClusteAndTestAdminTokenGeneration(t *testing.T, in *inputT) resource.TestStep { + return resource.TestStep{ + Config: testConfig(in.tf), + Check: resource.ComposeTestCheckFunc( + testAccCheckVaultClusterExists(in.VaultClusterResourceName), + resource.TestCheckResourceAttr(in.VaultClusterResourceName, "cluster_id", in.VaultClusterName), + resource.TestCheckResourceAttr(in.VaultClusterResourceName, "hvn_id", in.HvnName), + resource.TestCheckResourceAttr(in.VaultClusterResourceName, "tier", in.Tier), + resource.TestCheckResourceAttr(in.VaultClusterResourceName, "cloud_provider", in.CloudProvider), + resource.TestCheckResourceAttr(in.VaultClusterResourceName, "region", in.Region), + resource.TestCheckResourceAttr(in.VaultClusterResourceName, "public_endpoint", "false"), + resource.TestCheckResourceAttr(in.VaultClusterResourceName, "namespace", "admin"), + resource.TestCheckResourceAttrSet(in.VaultClusterResourceName, "vault_version"), + resource.TestCheckResourceAttrSet(in.VaultClusterResourceName, "organization_id"), + resource.TestCheckResourceAttrSet(in.VaultClusterResourceName, "project_id"), + resource.TestCheckNoResourceAttr(in.VaultClusterResourceName, "vault_public_endpoint_url"), + resource.TestCheckResourceAttrSet(in.VaultClusterResourceName, "vault_private_endpoint_url"), + testAccCheckFullURL(in.VaultClusterResourceName, "vault_private_endpoint_url", ""), + resource.TestCheckResourceAttrSet(in.VaultClusterResourceName, "state"), + resource.TestCheckResourceAttrSet(in.VaultClusterResourceName, "created_at"), + + // Verifies admin token + resource.TestCheckResourceAttr(in.AdminTokenResourceName, "cluster_id", in.VaultClusterName), + resource.TestCheckResourceAttrSet(in.AdminTokenResourceName, "token"), + resource.TestCheckResourceAttrSet(in.AdminTokenResourceName, "created_at"), + ), + } } -func TestAccPerformanceReplication_Validations(t *testing.T) { - // These tests seem to be flaky in GitHub Actions so for now we will skip them in CI until we can solve the issue - if testing.Short() { - t.Skip("skipping test in short mode (CI).") - } - hvn1ResourceName := "hcp_hvn.hvn1" - hvn2ResourceName := "hcp_hvn.hvn2" - primaryVaultResourceName := "hcp_vault_cluster.c1" - secondaryVaultResourceName := "hcp_vault_cluster.c2" +// This step simulates an import of the resource +func importResourcesInTFState(t *testing.T, in *inputT) resource.TestStep { + return resource.TestStep{ + ResourceName: in.VaultClusterResourceName, + ImportState: true, + ImportStateIdFunc: func(s *terraform.State) (string, error) { + rs, ok := s.RootModule().Resources[in.VaultClusterResourceName] + if !ok { + return "", fmt.Errorf("not found: %s", in.VaultClusterResourceName) + } - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t, map[string]bool{"aws": false, "azure": false}) }, - ProviderFactories: providerFactories, - CheckDestroy: testAccCheckVaultClusterDestroy, - Steps: []resource.TestStep{ - { - Config: testConfig(setTestAccPerformanceReplicationE2E("")), - Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr(hvn1ResourceName, "hvn_id", "test-perf-hvn-1"), - resource.TestCheckResourceAttr(hvn1ResourceName, "cidr_block", "172.25.16.0/20"), - resource.TestCheckResourceAttr(hvn2ResourceName, "hvn_id", "test-perf-hvn-2"), - resource.TestCheckResourceAttr(hvn2ResourceName, "cidr_block", "172.24.16.0/20"), - ), - }, - { - // invalid primary link supplied - Config: testConfig(setTestAccPerformanceReplicationE2E(` - resource "hcp_vault_cluster" "c1" { - cluster_id = "test-primary" - hvn_id = hcp_hvn.hvn1.hvn_id - tier = "plus_small" - primary_link = "something" - public_endpoint = true - } - `)), - ExpectError: regexp.MustCompile(`invalid primary_link supplied*`), - }, - { - // incorrectly specify a paths_filter on a non-secondary - Config: testConfig(setTestAccPerformanceReplicationE2E(` - resource "hcp_vault_cluster" "c1" { - cluster_id = "test-primary" - hvn_id = hcp_hvn.hvn1.hvn_id - tier = "plus_small" - paths_filter = ["path/a"] - } - `)), - ExpectError: regexp.MustCompile(`only performance replication secondaries may specify a paths_filter`), - }, - { - // create a plus tier cluster successfully - Config: testConfig(setTestAccPerformanceReplicationE2E(` - resource "hcp_vault_cluster" "c1" { - cluster_id = "test-primary" - hvn_id = hcp_hvn.hvn1.hvn_id - tier = "plus_small" - public_endpoint = true - } - `)), - Check: resource.ComposeTestCheckFunc( - testAccCheckVaultClusterExists(primaryVaultResourceName), - resource.TestCheckResourceAttr(primaryVaultResourceName, "cluster_id", "test-primary"), - resource.TestCheckResourceAttr(primaryVaultResourceName, "hvn_id", "test-perf-hvn-1"), - resource.TestCheckResourceAttr(primaryVaultResourceName, "tier", "PLUS_SMALL"), - resource.TestCheckResourceAttr(primaryVaultResourceName, "cloud_provider", "aws"), - resource.TestCheckResourceAttr(primaryVaultResourceName, "region", "us-west-2"), - resource.TestCheckResourceAttr(primaryVaultResourceName, "public_endpoint", "true"), - resource.TestCheckResourceAttr(primaryVaultResourceName, "namespace", "admin"), - resource.TestCheckResourceAttrSet(primaryVaultResourceName, "vault_version"), - resource.TestCheckResourceAttrSet(primaryVaultResourceName, "organization_id"), - resource.TestCheckResourceAttrSet(primaryVaultResourceName, "project_id"), - resource.TestCheckResourceAttrSet(primaryVaultResourceName, "vault_public_endpoint_url"), - resource.TestCheckResourceAttrSet(primaryVaultResourceName, "self_link"), - resource.TestCheckResourceAttrSet(primaryVaultResourceName, "vault_private_endpoint_url"), - testAccCheckFullURL(primaryVaultResourceName, "vault_private_endpoint_url", ""), - resource.TestCheckResourceAttrSet(primaryVaultResourceName, "created_at"), - ), - }, - { - // secondary cluster creation failed as tier doesn't match the tier of primary - Config: testConfig(setTestAccPerformanceReplicationE2E(` - resource "hcp_vault_cluster" "c1" { - cluster_id = "test-primary" - hvn_id = hcp_hvn.hvn1.hvn_id - tier = "plus_small" - public_endpoint = true - } - resource "hcp_vault_cluster" "c2" { - cluster_id = "test-secondary" - hvn_id = hcp_hvn.hvn1.hvn_id - tier = "plus_medium" - primary_link = hcp_vault_cluster.c1.self_link - } - `)), - ExpectError: regexp.MustCompile(`a secondary's tier must match that of its primary`), - }, - { - // secondary cluster creation failed as primary link is invalid - Config: testConfig(setTestAccPerformanceReplicationE2E(` - resource "hcp_vault_cluster" "c1" { - cluster_id = "test-primary" - hvn_id = hcp_hvn.hvn1.hvn_id - tier = "plus_small" - public_endpoint = true - } - resource "hcp_vault_cluster" "c2" { - cluster_id = "test-secondary" - hvn_id = hcp_hvn.hvn1.hvn_id - tier = hcp_vault_cluster.c1.tier - primary_link = "not-present" - } - `)), - ExpectError: regexp.MustCompile(`invalid primary_link supplied url`), - }, - { - // secondary cluster creation failed as min_vault_version is specified. - Config: testConfig(setTestAccPerformanceReplicationE2E(` - resource "hcp_vault_cluster" "c1" { - cluster_id = "test-primary" - hvn_id = hcp_hvn.hvn1.hvn_id - tier = "plus_small" - public_endpoint = true - } - resource "hcp_vault_cluster" "c2" { - cluster_id = "test-secondary" - hvn_id = hcp_hvn.hvn1.hvn_id - tier = hcp_vault_cluster.c1.tier - primary_link = hcp_vault_cluster.c1.self_link - min_vault_version = "v1.0.1" - } - `)), - ExpectError: regexp.MustCompile(`min_vault_version should either be unset or match the primary cluster's`), - }, - { - // secondary cluster created successfully (same hvn) - Config: testConfig(setTestAccPerformanceReplicationE2E(` - resource "hcp_vault_cluster" "c1" { - cluster_id = "test-primary" - hvn_id = hcp_hvn.hvn1.hvn_id - tier = "plus_small" - public_endpoint = true - } - resource "hcp_vault_cluster" "c2" { - cluster_id = "test-secondary" - hvn_id = hcp_hvn.hvn1.hvn_id - tier = hcp_vault_cluster.c1.tier - primary_link = hcp_vault_cluster.c1.self_link - paths_filter = ["path/a", "path/b"] - } - `)), - Check: resource.ComposeTestCheckFunc( - testAccCheckVaultClusterExists(primaryVaultResourceName), - resource.TestCheckResourceAttr(secondaryVaultResourceName, "cluster_id", "test-secondary"), - resource.TestCheckResourceAttr(secondaryVaultResourceName, "hvn_id", "test-perf-hvn-1"), - resource.TestCheckResourceAttr(secondaryVaultResourceName, "tier", "PLUS_SMALL"), - resource.TestCheckResourceAttr(secondaryVaultResourceName, "cloud_provider", "aws"), - resource.TestCheckResourceAttr(secondaryVaultResourceName, "region", "us-west-2"), - resource.TestCheckResourceAttr(secondaryVaultResourceName, "public_endpoint", "false"), - resource.TestCheckResourceAttr(secondaryVaultResourceName, "paths_filter.0", "path/a"), - resource.TestCheckResourceAttr(secondaryVaultResourceName, "paths_filter.1", "path/b"), - resource.TestCheckResourceAttr(secondaryVaultResourceName, "namespace", "admin"), - resource.TestCheckResourceAttrSet(secondaryVaultResourceName, "vault_version"), - resource.TestCheckResourceAttrSet(secondaryVaultResourceName, "organization_id"), - resource.TestCheckResourceAttrSet(secondaryVaultResourceName, "project_id"), - resource.TestCheckNoResourceAttr(secondaryVaultResourceName, "vault_public_endpoint_url"), - resource.TestCheckResourceAttrSet(secondaryVaultResourceName, "self_link"), - resource.TestCheckResourceAttrSet(secondaryVaultResourceName, "vault_private_endpoint_url"), - testAccCheckFullURL(secondaryVaultResourceName, "vault_private_endpoint_url", ""), - resource.TestCheckResourceAttrSet(secondaryVaultResourceName, "created_at"), - ), - }, - { - // update paths filter - Config: testConfig(setTestAccPerformanceReplicationE2E(` - resource "hcp_vault_cluster" "c1" { - cluster_id = "test-primary" - hvn_id = hcp_hvn.hvn1.hvn_id - tier = "plus_small" - public_endpoint = true - } - resource "hcp_vault_cluster" "c2" { - cluster_id = "test-secondary" - hvn_id = hcp_hvn.hvn1.hvn_id - tier = hcp_vault_cluster.c1.tier - primary_link = hcp_vault_cluster.c1.self_link - paths_filter = ["path/a", "path/c"] - } - `)), - Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr(secondaryVaultResourceName, "paths_filter.0", "path/a"), - resource.TestCheckResourceAttr(secondaryVaultResourceName, "paths_filter.1", "path/c"), - ), - }, - { - // delete paths filter - Config: testConfig(setTestAccPerformanceReplicationE2E(` - resource "hcp_vault_cluster" "c1" { - cluster_id = "test-primary" - hvn_id = hcp_hvn.hvn1.hvn_id - tier = "plus_small" - public_endpoint = true - } - resource "hcp_vault_cluster" "c2" { - cluster_id = "test-secondary" - hvn_id = hcp_hvn.hvn1.hvn_id - tier = hcp_vault_cluster.c1.tier - primary_link = hcp_vault_cluster.c1.self_link - } - `)), - Check: resource.ComposeTestCheckFunc( - resource.TestCheckNoResourceAttr(secondaryVaultResourceName, "paths_filter.0"), - ), - }, - { - // secondary cluster created successfully (different hvn) - Config: testConfig(setTestAccPerformanceReplicationE2E(` - resource "hcp_vault_cluster" "c1" { - cluster_id = "test-primary" - hvn_id = hcp_hvn.hvn1.hvn_id - tier = "plus_small" - public_endpoint = true - } - resource "hcp_vault_cluster" "c2" { - cluster_id = "test-secondary" - hvn_id = hcp_hvn.hvn2.hvn_id - tier = hcp_vault_cluster.c1.tier - primary_link = hcp_vault_cluster.c1.self_link - } - `)), - Check: resource.ComposeTestCheckFunc( - testAccCheckVaultClusterExists(primaryVaultResourceName), - testAccCheckVaultClusterExists(secondaryVaultResourceName), - resource.TestCheckResourceAttr(secondaryVaultResourceName, "cluster_id", "test-secondary"), - resource.TestCheckResourceAttr(secondaryVaultResourceName, "hvn_id", "test-perf-hvn-2"), - resource.TestCheckResourceAttr(secondaryVaultResourceName, "tier", "PLUS_SMALL"), - resource.TestCheckResourceAttr(secondaryVaultResourceName, "cloud_provider", "aws"), - resource.TestCheckResourceAttr(secondaryVaultResourceName, "region", "us-west-2"), - resource.TestCheckResourceAttr(secondaryVaultResourceName, "public_endpoint", "false"), - resource.TestCheckResourceAttr(secondaryVaultResourceName, "namespace", "admin"), - resource.TestCheckResourceAttrSet(secondaryVaultResourceName, "vault_version"), - resource.TestCheckResourceAttrSet(secondaryVaultResourceName, "organization_id"), - resource.TestCheckResourceAttrSet(secondaryVaultResourceName, "project_id"), - resource.TestCheckNoResourceAttr(secondaryVaultResourceName, "vault_public_endpoint_url"), - resource.TestCheckResourceAttrSet(secondaryVaultResourceName, "self_link"), - resource.TestCheckResourceAttrSet(secondaryVaultResourceName, "vault_private_endpoint_url"), - testAccCheckFullURL(secondaryVaultResourceName, "vault_private_endpoint_url", ""), - resource.TestCheckResourceAttrSet(secondaryVaultResourceName, "created_at"), - ), - }, - { - // successfully scale replication group - Config: testConfig(setTestAccPerformanceReplicationE2E(` - resource "hcp_vault_cluster" "c1" { - cluster_id = "test-primary" - hvn_id = hcp_hvn.hvn1.hvn_id - tier = "plus_medium" - public_endpoint = true - } - resource "hcp_vault_cluster" "c2" { - cluster_id = "test-secondary" - hvn_id = hcp_hvn.hvn2.hvn_id - tier = hcp_vault_cluster.c1.tier - primary_link = hcp_vault_cluster.c1.self_link - } - `)), - Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr(primaryVaultResourceName, "tier", "PLUS_MEDIUM"), - resource.TestCheckResourceAttr(secondaryVaultResourceName, "tier", "PLUS_MEDIUM"), - ), - }, - { - // successfully disable replication - Config: testConfig(setTestAccPerformanceReplicationE2E(` - resource "hcp_vault_cluster" "c1" { - cluster_id = "test-primary" - hvn_id = hcp_hvn.hvn1.hvn_id - tier = "plus_medium" - public_endpoint = true - } - `)), - Check: resource.ComposeTestCheckFunc( - testAccCheckVaultClusterExists(primaryVaultResourceName), - ), - }, - { - // successfully scale out of the Plus tier - Config: testConfig(setTestAccPerformanceReplicationE2E(` - resource "hcp_vault_cluster" "c1" { - cluster_id = "test-primary" - hvn_id = hcp_hvn.hvn1.hvn_id - tier = "starter_small" - public_endpoint = true - } - `)), - Check: resource.ComposeTestCheckFunc( - testAccCheckVaultClusterExists(primaryVaultResourceName), - resource.TestCheckResourceAttr(primaryVaultResourceName, "tier", "STARTER_SMALL"), - ), - }, + return rs.Primary.Attributes["cluster_id"], nil }, - }) + ImportStateVerify: true, + } +} + +// This step is a subsequent terraform apply that verifies that no state is modified +func tfApply(t *testing.T, in *inputT) resource.TestStep { + return resource.TestStep{ + Config: testConfig(in.tf), + Check: resource.ComposeTestCheckFunc( + testAccCheckVaultClusterExists(in.VaultClusterResourceName), + resource.TestCheckResourceAttr(in.VaultClusterResourceName, "cluster_id", in.VaultClusterName), + resource.TestCheckResourceAttr(in.VaultClusterResourceName, "hvn_id", in.HvnName), + resource.TestCheckResourceAttr(in.VaultClusterResourceName, "tier", in.Tier), + resource.TestCheckResourceAttr(in.VaultClusterResourceName, "cloud_provider", in.CloudProvider), + resource.TestCheckResourceAttr(in.VaultClusterResourceName, "region", in.Region), + resource.TestCheckResourceAttr(in.VaultClusterResourceName, "public_endpoint", "false"), + resource.TestCheckResourceAttr(in.VaultClusterResourceName, "namespace", "admin"), + resource.TestCheckResourceAttrSet(in.VaultClusterResourceName, "organization_id"), + resource.TestCheckResourceAttrSet(in.VaultClusterResourceName, "project_id"), + resource.TestCheckResourceAttrSet(in.VaultClusterResourceName, "vault_version"), + resource.TestCheckNoResourceAttr(in.VaultClusterResourceName, "vault_public_endpoint_url"), + resource.TestCheckResourceAttrSet(in.VaultClusterResourceName, "vault_private_endpoint_url"), + testAccCheckFullURL(in.VaultClusterResourceName, "vault_private_endpoint_url", "8200"), + resource.TestCheckResourceAttrSet(in.VaultClusterResourceName, "created_at"), + resource.TestCheckResourceAttrSet(in.VaultClusterResourceName, "state"), + ), + } +} + +// Tests datasource +func testTFDataSources(t *testing.T, in *inputT) resource.TestStep { + return resource.TestStep{ + Config: testConfig(in.tf), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrPair(in.VaultClusterResourceName, "cluster_id", in.VaultClusterDataSourceName, "cluster_id"), + resource.TestCheckResourceAttrPair(in.VaultClusterResourceName, "hvn_id", in.VaultClusterDataSourceName, "hvn_id"), + resource.TestCheckResourceAttrPair(in.VaultClusterResourceName, "public_endpoint", in.VaultClusterDataSourceName, "public_endpoint"), + resource.TestCheckResourceAttrPair(in.VaultClusterResourceName, "min_vault_version", in.VaultClusterDataSourceName, "min_vault_version"), + resource.TestCheckResourceAttrPair(in.VaultClusterResourceName, "tier", in.VaultClusterDataSourceName, "tier"), + resource.TestCheckResourceAttrPair(in.VaultClusterResourceName, "organization_id", in.VaultClusterDataSourceName, "organization_id"), + resource.TestCheckResourceAttrPair(in.VaultClusterResourceName, "project_id", in.VaultClusterDataSourceName, "project_id"), + resource.TestCheckResourceAttrPair(in.VaultClusterResourceName, "cloud_provider", in.VaultClusterDataSourceName, "cloud_provider"), + resource.TestCheckResourceAttrPair(in.VaultClusterResourceName, "region", in.VaultClusterDataSourceName, "region"), + resource.TestCheckResourceAttrPair(in.VaultClusterResourceName, "namespace", in.VaultClusterDataSourceName, "namespace"), + resource.TestCheckResourceAttrPair(in.VaultClusterResourceName, "vault_version", in.VaultClusterDataSourceName, "vault_version"), + resource.TestCheckResourceAttrPair(in.VaultClusterResourceName, "vault_public_endpoint_url", in.VaultClusterDataSourceName, "vault_public_endpoint_url"), + resource.TestCheckResourceAttrPair(in.VaultClusterResourceName, "vault_private_endpoint_url", in.VaultClusterDataSourceName, "vault_private_endpoint_url"), + testAccCheckFullURL(in.VaultClusterResourceName, "vault_private_endpoint_url", "8200"), + resource.TestCheckResourceAttrPair(in.VaultClusterResourceName, "created_at", in.VaultClusterDataSourceName, "created_at"), + resource.TestCheckResourceAttrPair(in.VaultClusterResourceName, "state", in.VaultClusterDataSourceName, "state"), + ), + } +} + +// This step verifies the successful update of "tier" and MVU config +func updateClusterTier(t *testing.T, in *inputT) resource.TestStep { + newIn := *in + return resource.TestStep{ + Config: testConfig(setTestAccVaultClusterConfig(t, updatedVaultClusterTierAndMVUConfig, newIn, newIn.UpdateTier1)), + Check: resource.ComposeTestCheckFunc( + testAccCheckVaultClusterExists(in.VaultClusterResourceName), + resource.TestCheckResourceAttr(in.VaultClusterResourceName, "tier", in.UpdateTier1), + resource.TestCheckResourceAttr(vaultClusterResourceName, "major_version_upgrade_config.0.upgrade_type", "SCHEDULED"), + resource.TestCheckResourceAttr(vaultClusterResourceName, "major_version_upgrade_config.0.maintenance_window_day", "WEDNESDAY"), + resource.TestCheckResourceAttr(vaultClusterResourceName, "major_version_upgrade_config.0.maintenance_window_time", "WINDOW_12AM_4AM"), + ), + } +} + +// This step verifies the successful update of "public_endpoint", "audit_log", "metrics" and MVU config +func updateVaultPublicEndpointObservabilityDataAndMVU(t *testing.T, in *inputT) resource.TestStep { + newIn := *in + newIn.PublicEndpoint = "true" + return resource.TestStep{ + Config: testConfig(setTestAccVaultClusterConfig(t, updatedVaultClusterPublicAndMetricsAuditLog, newIn, newIn.UpdateTier1)), + Check: resource.ComposeTestCheckFunc( + testAccCheckVaultClusterExists(in.VaultClusterResourceName), + resource.TestCheckResourceAttr(in.VaultClusterResourceName, "public_endpoint", "true"), + resource.TestCheckResourceAttrSet(in.VaultClusterResourceName, "vault_public_endpoint_url"), + testAccCheckFullURL(in.VaultClusterResourceName, "vault_public_endpoint_url", "8200"), + resource.TestCheckResourceAttrSet(in.VaultClusterResourceName, "vault_private_endpoint_url"), + testAccCheckFullURL(in.VaultClusterResourceName, "vault_private_endpoint_url", "8200"), + resource.TestCheckResourceAttr(in.VaultClusterResourceName, "metrics_config.0.splunk_hecendpoint", "https://http-input-splunkcloud.com"), + resource.TestCheckResourceAttrSet(in.VaultClusterResourceName, "metrics_config.0.splunk_token"), + resource.TestCheckResourceAttrSet(in.VaultClusterResourceName, "audit_log_config.0.datadog_api_key"), + resource.TestCheckResourceAttr(in.VaultClusterResourceName, "audit_log_config.0.datadog_region", "us1"), + resource.TestCheckResourceAttr(in.VaultClusterResourceName, "major_version_upgrade_config.0.upgrade_type", "MANUAL"), + ), + } +} + +// This step verifies the successful update of both "tier" and "public_endpoint" and removal of "metrics" and "audit_log" +func updateTierPublicEndpointAndRemoveObservabilityData(t *testing.T, in *inputT) resource.TestStep { + newIn := *in + newIn.PublicEndpoint = "false" + return resource.TestStep{ + Config: testConfig(setTestAccVaultClusterConfig(t, updatedVaultClusterTierAndMVUConfig, newIn, newIn.UpdateTier2)), + Check: resource.ComposeTestCheckFunc( + testAccCheckVaultClusterExists(in.VaultClusterResourceName), + resource.TestCheckResourceAttr(in.VaultClusterResourceName, "tier", in.UpdateTier2), + resource.TestCheckResourceAttr(in.VaultClusterResourceName, "public_endpoint", "false"), + resource.TestCheckResourceAttrSet(in.VaultClusterResourceName, "vault_public_endpoint_url"), + testAccCheckFullURL(in.VaultClusterResourceName, "vault_public_endpoint_url", "8200"), + resource.TestCheckResourceAttrSet(in.VaultClusterResourceName, "vault_private_endpoint_url"), + testAccCheckFullURL(in.VaultClusterResourceName, "vault_private_endpoint_url", "8200"), + resource.TestCheckNoResourceAttr(in.VaultClusterResourceName, "metrics_config.0"), + resource.TestCheckNoResourceAttr(in.VaultClusterResourceName, "audit_log_config.0"), + resource.TestCheckResourceAttr(in.VaultClusterResourceName, "major_version_upgrade_config.0.upgrade_type", "SCHEDULED"), + resource.TestCheckResourceAttr(in.VaultClusterResourceName, "major_version_upgrade_config.0.maintenance_window_day", "WEDNESDAY"), + resource.TestCheckResourceAttr(in.VaultClusterResourceName, "major_version_upgrade_config.0.maintenance_window_time", "WINDOW_12AM_4AM"), + ), + } +} + +func addTimestampSuffix(in string) string { + return in + time.Now().Format("200601021504") } diff --git a/internal/provider/test_helpers.go b/internal/provider/test_helpers.go index 87aa7946e..48a1a6c85 100644 --- a/internal/provider/test_helpers.go +++ b/internal/provider/test_helpers.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( diff --git a/internal/provider/validators.go b/internal/provider/validators.go index ce54b602a..d17720ea0 100644 --- a/internal/provider/validators.go +++ b/internal/provider/validators.go @@ -1,8 +1,12 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( "fmt" "net" + "net/netip" "regexp" "strings" @@ -178,6 +182,42 @@ func validateConsulClusterSize(v interface{}, path cty.Path) diag.Diagnostics { return diagnostics } +func validateConsulClusterCIDR(v interface{}, path cty.Path) diag.Diagnostics { + var diagnostics diag.Diagnostics + + addr := v.(string) + ip, err := netip.ParsePrefix(addr) + isIPV4 := ip.Addr().Is4() + + if err != nil || !ip.IsValid() || !isIPV4 { + msg := fmt.Sprintf("invalid address (%v) of ip_allowlist", v) + diagnostics = append(diagnostics, diag.Diagnostic{ + Severity: diag.Error, + Summary: msg, + Detail: msg + " (must be a valid IPV4 CIDR).", + AttributePath: path, + }) + } + + return diagnostics +} + +func validateConsulClusterCIDRDescription(v interface{}, path cty.Path) diag.Diagnostics { + var diagnostics diag.Diagnostics + description := v.(string) + if len(description) > 255 { + msg := fmt.Sprintf("invalid description (%v) of ip_allowlist", v) + diagnostics = append(diagnostics, diag.Diagnostic{ + Severity: diag.Error, + Summary: msg, + Detail: msg + " (must be within 255 char).", + AttributePath: path, + }) + } + + return diagnostics +} + func validateVaultClusterTier(v interface{}, path cty.Path) diag.Diagnostics { var diagnostics diag.Diagnostics diff --git a/internal/provider/validators_test.go b/internal/provider/validators_test.go index 3ef208c0b..dcf403046 100644 --- a/internal/provider/validators_test.go +++ b/internal/provider/validators_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package provider import ( @@ -296,8 +299,8 @@ func Test_validateConsulClusterTier(t *testing.T) { expected: diag.Diagnostics{ diag.Diagnostic{ Severity: diag.Error, - Summary: "expected dev to be one of [DEVELOPMENT STANDARD PLUS]", - Detail: "expected dev to be one of [DEVELOPMENT STANDARD PLUS] (value is case-insensitive).", + Summary: "expected dev to be one of [DEVELOPMENT STANDARD PLUS PREMIUM]", + Detail: "expected dev to be one of [DEVELOPMENT STANDARD PLUS PREMIUM] (value is case-insensitive).", AttributePath: nil, }, }, @@ -354,6 +357,78 @@ func Test_validateConsulClusterSize(t *testing.T) { } } +func Test_validateConsulClusterCIDR(t *testing.T) { + tcs := map[string]struct { + input string + expected diag.Diagnostics + }{ + "valid IP address": { + input: "172.25.16.0/24", + expected: nil, + }, + "invalid ip address": { + input: "invalid", + expected: diag.Diagnostics{ + diag.Diagnostic{ + Severity: diag.Error, + Summary: "invalid address (invalid) of ip_allowlist", + Detail: "invalid address (invalid) of ip_allowlist (must be a valid IPV4 CIDR).", + AttributePath: nil, + }, + }, + }, + "IPV6 unsupported": { + input: "2002::1234:abcd:ffff:c0a8:101/64", + expected: diag.Diagnostics{ + diag.Diagnostic{ + Severity: diag.Error, + Summary: "invalid address (2002::1234:abcd:ffff:c0a8:101/64) of ip_allowlist", + Detail: "invalid address (2002::1234:abcd:ffff:c0a8:101/64) of ip_allowlist (must be a valid IPV4 CIDR).", + AttributePath: nil, + }, + }, + }, + } + for n, tc := range tcs { + t.Run(n, func(t *testing.T) { + r := require.New(t) + result := validateConsulClusterCIDR(tc.input, nil) + r.Equal(tc.expected, result) + }) + } +} + +func Test_validateConsulClusterCIDRDescription(t *testing.T) { + invalidInput := "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur." + tcs := map[string]struct { + input string + expected diag.Diagnostics + }{ + "valid description": { + input: "IPV4 address", + expected: nil, + }, + "invalid ip address": { + input: invalidInput, + expected: diag.Diagnostics{ + diag.Diagnostic{ + Severity: diag.Error, + Summary: fmt.Sprintf("invalid description (%s) of ip_allowlist", invalidInput), + Detail: fmt.Sprintf("invalid description (%s) of ip_allowlist (must be within 255 char).", invalidInput), + AttributePath: nil, + }, + }, + }, + } + for n, tc := range tcs { + t.Run(n, func(t *testing.T) { + r := require.New(t) + result := validateConsulClusterCIDRDescription(tc.input, nil) + r.Equal(tc.expected, result) + }) + } +} + func Test_validateVaultClusterTier(t *testing.T) { tcs := map[string]struct { input string diff --git a/main.go b/main.go index 11ed4b76a..451e79af1 100644 --- a/main.go +++ b/main.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package main import ( diff --git a/scripts/changelog-links.sh b/scripts/changelog-links.sh index 3c9b02556..f77288f1c 100755 --- a/scripts/changelog-links.sh +++ b/scripts/changelog-links.sh @@ -1,4 +1,7 @@ #!/bin/bash +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + # This script rewrites [GH-nnnn]-style references in the CHANGELOG.md file to # be Markdown links to the given github issues. diff --git a/scripts/gofmtcheck.sh b/scripts/gofmtcheck.sh index 75140f7d6..c126fa727 100755 --- a/scripts/gofmtcheck.sh +++ b/scripts/gofmtcheck.sh @@ -1,4 +1,7 @@ #!/usr/bin/env bash +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + # Check gofmt echo "==> Checking that code complies with gofmt requirements..." diff --git a/templates/resources/packer_channel.md.tmpl b/templates/resources/packer_channel.md.tmpl new file mode 100644 index 000000000..0567f8f21 --- /dev/null +++ b/templates/resources/packer_channel.md.tmpl @@ -0,0 +1,32 @@ +--- +page_title: "{{.Type}} {{.Name}} - {{.ProviderName}}" +subcategory: "" +description: |- +{{ .Description | plainmarkdown | trimspace | prefixlines " " }} +--- + +# {{.Name}} ({{.Type}}) + +-> **Note:** This resource is currently in public beta. + +{{ .Description | trimspace }} + +## Example Usage + +To create a channel with no assigned iteration. +{{ tffile "examples/resources/hcp_packer_channel/resource.tf" }} + +To create, or update an existing, channel with an assigned iteration. +{{ tffile "examples/resources/hcp_packer_channel/resource_assignment.tf" }} + +Using the latest channel to create a new channel with an assigned iteration. +{{ tffile "examples/resources/hcp_packer_channel/resource_using_latest_channel.tf" }} + + +{{ .SchemaMarkdown | trimspace }} + +## Import + +Import is supported using the following syntax: + +{{ codefile "shell" "examples/resources/hcp_packer_channel/import.sh" }} diff --git a/tools/tools.go b/tools/tools.go index f03ce3ddd..a93a46b2d 100644 --- a/tools/tools.go +++ b/tools/tools.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + // +build tools package tools diff --git a/version/version.go b/version/version.go index 081f1948f..19de2550b 100644 --- a/version/version.go +++ b/version/version.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package version // ProviderVersion is set during the release process to the release version of the binary