Skip to content

Commit a57ab07

Browse files
authored
azurerm_key_vault_key : use pandora data plane sdk (hashicorp#31806)
[ENHANCEMENT] * `azurerm_key_vault_key` - updated to use `go-azure-sdk`
1 parent c16e19c commit a57ab07

338 files changed

Lines changed: 17392 additions & 201 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ require (
1717
github.com/google/go-cmp v0.7.0
1818
github.com/google/uuid v1.6.0
1919
github.com/hashicorp/go-azure-helpers v0.76.2
20+
github.com/hashicorp/go-azure-sdk/data-plane v0.20260415.1165701
2021
github.com/hashicorp/go-azure-sdk/resource-manager v0.20260415.1165701
2122
github.com/hashicorp/go-azure-sdk/sdk v0.20260415.1165701
2223
github.com/hashicorp/go-cty v1.5.0

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY
114114
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
115115
github.com/hashicorp/go-azure-helpers v0.76.2 h1:59isOIbH9GQky32/yReufDWEyb+k8y4wL33FKlMj6zA=
116116
github.com/hashicorp/go-azure-helpers v0.76.2/go.mod h1:K+woaDnRuEg2qyg8pWMLeYhIcH7QAcUGLFlBHoF/WhA=
117+
github.com/hashicorp/go-azure-sdk/data-plane v0.20260415.1165701 h1:rTRiqryZ+hOA4wVxGuldSzKqmFcKttDLg/K6NiI0AY0=
118+
github.com/hashicorp/go-azure-sdk/data-plane v0.20260415.1165701/go.mod h1:iW/u55RVSNz0OOVETh3aPEP9ru1IBUYRkeARdF1StJY=
117119
github.com/hashicorp/go-azure-sdk/resource-manager v0.20260415.1165701 h1:rjU5cMppeXZWPJW5OGudJTbz9P8YOcZnAv7XMjF2WrQ=
118120
github.com/hashicorp/go-azure-sdk/resource-manager v0.20260415.1165701/go.mod h1:vi9fQaFaRMIhoSw/7JHIaDbVACtDLlHwdkSbD3WOtgk=
119121
github.com/hashicorp/go-azure-sdk/sdk v0.20260415.1165701 h1:Oz0jgA1bHr371fwv/LfnFWSc1zsUrh9IWIKJuUhzcss=

internal/services/keyvault/client/client.go

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ package client
66
import (
77
"fmt"
88

9+
dataplane7_4 "github.com/hashicorp/go-azure-sdk/data-plane/keyvault/7-4"
910
"github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/vaults"
1011
vaults20230701 "github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/vaults"
1112
resources20151101 "github.com/hashicorp/go-azure-sdk/resource-manager/resources/2015-11-01/resources"
13+
dataplaneClient "github.com/hashicorp/go-azure-sdk/sdk/client/dataplane"
1214
"github.com/hashicorp/terraform-provider-azurerm/internal/common"
1315
dataplane "github.com/jackofallops/kermit/sdk/keyvault/7.4/keyvault"
1416
)
@@ -22,7 +24,8 @@ type Client struct {
2224
// As such this separation on our side is intentional to avoid code reuse given these differences.
2325
VaultsClient *vaults.VaultsClient
2426

25-
ManagementClient *dataplane.BaseClient // TODO: we should rename this DataPlaneClient in time
27+
ManagementClient *dataplane.BaseClient // TODO: we should rename this DataPlaneClient in time
28+
DataPlaneKeyVaultClient *dataplane7_4.Client
2629

2730
// NOTE: @tombuildsstuff: this client is intentionally internal-only so that it's not used directly
2831
resources20151101Client *resources20151101.ResourcesClient
@@ -57,10 +60,19 @@ func NewClient(o *common.ClientOptions) (*Client, error) {
5760
managementClient := dataplane.New()
5861
o.ConfigureClient(&managementClient.Client, o.KeyVaultAuthorizer)
5962

63+
dataplaneKeyvaultClient, err := dataplane7_4.NewClient(func(c *dataplaneClient.Client) {
64+
o.Configure(c.Client, o.Authorizers.KeyVault)
65+
})
66+
if err != nil {
67+
return nil, fmt.Errorf("building data-plane KeyVault client: %+v", err)
68+
}
69+
6070
return &Client{
6171
ManagementClient: &managementClient,
6272
VaultsClient: &vaultsClient,
6373

74+
DataPlaneKeyVaultClient: dataplaneKeyvaultClient,
75+
6476
// intentionally internal to this package for now, see above.
6577
resources20151101Client: resources20151101Client,
6678
vaults20230701Client: updatedVaultsClient,

0 commit comments

Comments
 (0)