Skip to content

Commit

Permalink
dependencies: bump hashicorp/terraform-plugin-sdk/v2 to v2.36.0 (#…
Browse files Browse the repository at this point in the history
…28788)

* bump terraform-plugin-sdk version to v2.36.0, add a write only test template and helper

* update explanatory comments for test template and write only helper and convert ephemeral resource tests to parallel running tests

* test template indentation

Co-authored-by: jackofallops <11830746+jackofallops@users.noreply.github.com>

---------

Co-authored-by: jackofallops <11830746+jackofallops@users.noreply.github.com>
  • Loading branch information
stephybun and jackofallops authored Feb 17, 2025
1 parent e51db7d commit fd43684
Show file tree
Hide file tree
Showing 228 changed files with 12,540 additions and 5,923 deletions.
38 changes: 19 additions & 19 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,24 @@ require (
github.com/hashicorp/go-azure-helpers v0.71.0
github.com/hashicorp/go-azure-sdk/resource-manager v0.20250213.1092825
github.com/hashicorp/go-azure-sdk/sdk v0.20250213.1092825
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320
github.com/hashicorp/go-hclog v1.6.3
github.com/hashicorp/go-multierror v1.1.1
github.com/hashicorp/go-uuid v1.0.3
github.com/hashicorp/go-version v1.7.0
github.com/hashicorp/terraform-plugin-framework v1.13.0
github.com/hashicorp/terraform-plugin-framework-validators v0.14.0
github.com/hashicorp/terraform-plugin-go v0.25.0
github.com/hashicorp/terraform-plugin-go v0.26.0
github.com/hashicorp/terraform-plugin-mux v0.17.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.35.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.36.0
github.com/hashicorp/terraform-plugin-testing v1.11.0
github.com/jackofallops/giovanni v0.28.0
github.com/jackofallops/kermit v0.20241010.1180132
github.com/magodo/terraform-provider-azurerm-example-gen v0.0.0-20220407025246-3a3ee0ab24a8
github.com/mitchellh/mapstructure v1.5.0
github.com/rickb777/date v1.12.5-0.20200422084442-6300e543c4d9
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3
golang.org/x/crypto v0.29.0
golang.org/x/crypto v0.32.0
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d
gopkg.in/yaml.v3 v3.0.1
)
Expand All @@ -44,7 +45,7 @@ require (
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
github.com/Azure/go-autorest/autorest/adal v0.9.23 // indirect
github.com/Azure/go-autorest/logger v0.2.1 // indirect
github.com/ProtonMail/go-crypto v1.1.0-alpha.2 // indirect
github.com/ProtonMail/go-crypto v1.1.3 // indirect
github.com/agext/levenshtein v1.2.3 // indirect
github.com/apparentlymart/go-textseg v1.0.0 // indirect
github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect
Expand All @@ -53,17 +54,16 @@ require (
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-cty v1.4.1-0.20200414143053-d3edf31b6320 // indirect
github.com/hashicorp/go-plugin v1.6.2 // indirect
github.com/hashicorp/go-retryablehttp v0.7.7 // indirect
github.com/hashicorp/hc-install v0.9.0 // indirect
github.com/hashicorp/hc-install v0.9.1 // indirect
github.com/hashicorp/hcl/v2 v2.23.0 // indirect
github.com/hashicorp/hcl2 v0.0.0-20191002203319-fb75b3253c80 // indirect
github.com/hashicorp/logutils v1.0.0 // indirect
github.com/hashicorp/terraform-exec v0.21.0 // indirect
github.com/hashicorp/terraform-json v0.23.0 // indirect
github.com/hashicorp/terraform-exec v0.22.0 // indirect
github.com/hashicorp/terraform-json v0.24.0 // indirect
github.com/hashicorp/terraform-plugin-log v0.9.0 // indirect
github.com/hashicorp/terraform-registry-address v0.2.3 // indirect
github.com/hashicorp/terraform-registry-address v0.2.4 // indirect
github.com/hashicorp/terraform-svchost v0.1.1 // indirect
github.com/hashicorp/yamux v0.1.1 // indirect
github.com/kr/pretty v0.3.0 // indirect
Expand All @@ -80,17 +80,17 @@ require (
github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/zclconf/go-cty v1.15.0 // indirect
golang.org/x/mod v0.21.0 // indirect
golang.org/x/net v0.28.0 // indirect
golang.org/x/oauth2 v0.22.0 // indirect
golang.org/x/sync v0.9.0 // indirect
golang.org/x/sys v0.27.0 // indirect
golang.org/x/text v0.20.0 // indirect
github.com/zclconf/go-cty v1.16.2 // indirect
golang.org/x/mod v0.22.0 // indirect
golang.org/x/net v0.34.0 // indirect
golang.org/x/oauth2 v0.23.0 // indirect
golang.org/x/sync v0.10.0 // indirect
golang.org/x/sys v0.29.0 // indirect
golang.org/x/text v0.21.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect
google.golang.org/grpc v1.67.1 // indirect
google.golang.org/protobuf v1.35.1 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53 // indirect
google.golang.org/grpc v1.69.4 // indirect
google.golang.org/protobuf v1.36.3 // indirect
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
software.sslmate.com/src/go-pkcs12 v0.4.0 // indirect
)
Expand Down
106 changes: 60 additions & 46 deletions go.sum

Large diffs are not rendered by default.

52 changes: 52 additions & 0 deletions internal/acceptance/templates.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
package acceptance

import (
"fmt"
)

// WriteOnlyKeyVaultSecretTemplate is a testing template specific for write-only attributes.
// It provisions a Key Vault, a Key Vault secret, and references the secret using the Key Vault Secret
// ephemeral resource.
func WriteOnlyKeyVaultSecretTemplate(data TestData, secret string) string {
return fmt.Sprintf(`
data "azurerm_client_config" "current" {}
resource "azurerm_key_vault" "test" {
name = "acctestkv-%[1]s"
location = azurerm_resource_group.test.location
resource_group_name = azurerm_resource_group.test.name
tenant_id = data.azurerm_client_config.current.tenant_id
sku_name = "standard"
soft_delete_retention_days = 7
access_policy {
tenant_id = data.azurerm_client_config.current.tenant_id
object_id = data.azurerm_client_config.current.object_id
key_permissions = [
"Get",
]
secret_permissions = [
"Get",
"Delete",
"List",
"Purge",
"Recover",
"Set",
]
}
}
resource "azurerm_key_vault_secret" "test" {
name = "secret-%[1]s"
value = "%[2]s"
key_vault_id = azurerm_key_vault.test.id
}
ephemeral "azurerm_key_vault_secret" "test" {
name = azurerm_key_vault_secret.test.name
key_vault_id = azurerm_key_vault.test.id
}
`, data.RandomString, secret)
}
4 changes: 2 additions & 2 deletions internal/services/keyvault/key_vault_secret_ephemeral_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func TestAccEphemeralKeyVaultSecret_basic(t *testing.T) {
data := acceptance.BuildTestData(t, "ephemeral.azurerm_key_vault_secret", "test")
r := KeyVaultSecretEphemeral{}

resource.Test(t, resource.TestCase{
resource.ParallelTest(t, resource.TestCase{
TerraformVersionChecks: []tfversion.TerraformVersionCheck{
tfversion.SkipBelow(version.Must(version.NewVersion("1.10.0-rc1"))),
},
Expand All @@ -45,7 +45,7 @@ func TestAccEphemeralKeyVaultSecret_complete(t *testing.T) {
data := acceptance.BuildTestData(t, "ephemeral.azurerm_key_vault_secret", "test")
r := KeyVaultSecretEphemeral{}

resource.Test(t, resource.TestCase{
resource.ParallelTest(t, resource.TestCase{
TerraformVersionChecks: []tfversion.TerraformVersionCheck{
tfversion.SkipBelow(version.Must(version.NewVersion("1.10.0-rc1"))),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,6 @@ resource "azurerm_key_vault" "test" {
"Recover",
"Set",
]
}
tags = {
Expand Down
21 changes: 21 additions & 0 deletions internal/tf/pluginsdk/write_only.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package pluginsdk

import (
"fmt"

"github.com/hashicorp/go-azure-helpers/lang/pointer"
"github.com/hashicorp/go-cty/cty"
)

// GetWriteOnly gets a write only attribute, checking that it is of an expected type and subsequently returns it
func GetWriteOnly(d *ResourceData, name string, attributeType cty.Type) (*cty.Value, error) {
value, diags := d.GetRawConfigAt(cty.GetAttrPath(name))
if diags.HasError() {
return nil, fmt.Errorf("retrieving write-only attribute `%s`: %+v", name, diags)
}

if !value.Type().Equals(attributeType) {
return nil, fmt.Errorf("retrieving write-only attribute `%s`: value is not of type %v", name, attributeType)
}
return pointer.To(value), nil
}
6 changes: 1 addition & 5 deletions vendor/github.com/ProtonMail/go-crypto/openpgp/ecdh/ecdh.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 41 additions & 4 deletions vendor/github.com/ProtonMail/go-crypto/openpgp/errors/errors.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit fd43684

Please sign in to comment.