diff --git a/.changelog/1122.txt b/.changelog/1122.txt new file mode 100644 index 000000000..c43507049 --- /dev/null +++ b/.changelog/1122.txt @@ -0,0 +1,3 @@ +```release-note:improvement +Upgrade the HCP SDK for Vault Secrets +``` diff --git a/go.mod b/go.mod index 32412af0e..9456172a8 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/hashicorp/go-cty v1.4.1-0.20200723130312-85980079f637 github.com/hashicorp/go-uuid v1.0.3 github.com/hashicorp/go-version v1.7.0 - github.com/hashicorp/hcp-sdk-go v0.116.0 + github.com/hashicorp/hcp-sdk-go v0.117.0 github.com/hashicorp/terraform-plugin-docs v0.19.4 github.com/hashicorp/terraform-plugin-framework v1.5.0 github.com/hashicorp/terraform-plugin-framework-validators v0.12.0 diff --git a/go.sum b/go.sum index a9e3f83ca..d555c1ec7 100644 --- a/go.sum +++ b/go.sum @@ -122,8 +122,8 @@ github.com/hashicorp/hc-install v0.7.0 h1:Uu9edVqjKQxxuD28mR5TikkKDd/p55S8vzPC16 github.com/hashicorp/hc-install v0.7.0/go.mod h1:ELmmzZlGnEcqoUMKUuykHaPCIR1sYLYX+KSggWSKZuA= github.com/hashicorp/hcl/v2 v2.19.1 h1://i05Jqznmb2EXqa39Nsvyan2o5XyMowW5fnCKW5RPI= github.com/hashicorp/hcl/v2 v2.19.1/go.mod h1:ThLC89FV4p9MPW804KVbe/cEXoQ8NZEh+JtMeeGErHE= -github.com/hashicorp/hcp-sdk-go v0.116.0 h1:WhmEzOxoswQsX0s8Hk84RE1avu+rwV2e51R8uOb9ZhY= -github.com/hashicorp/hcp-sdk-go v0.116.0/go.mod h1:vQ4fzdL1AmhIAbCw+4zmFe5Hbpajj3NvRWkJoVuxmAk= +github.com/hashicorp/hcp-sdk-go v0.117.0 h1:7lJpkinpWdsXtejC+X7MdaE/3zhFMweB9Ym3uJ7qFJw= +github.com/hashicorp/hcp-sdk-go v0.117.0/go.mod h1:vQ4fzdL1AmhIAbCw+4zmFe5Hbpajj3NvRWkJoVuxmAk= 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.21.0 h1:uNkLAe95ey5Uux6KJdua6+cv8asgILFVWkd/RG0D2XQ= diff --git a/internal/clients/vault_secrets_preview.go b/internal/clients/vault_secrets_preview.go index 51e297577..acb54df59 100644 --- a/internal/clients/vault_secrets_preview.go +++ b/internal/clients/vault_secrets_preview.go @@ -96,7 +96,7 @@ func GetRotatingSecretState(ctx context.Context, client *Client, loc *sharedmode WithOrganizationID(loc.OrganizationID). WithProjectID(loc.ProjectID). WithAppName(appName). - WithSecretName(secretName) + WithName(secretName) resp, err := client.VaultSecretsPreview.GetRotatingSecretState(params, nil) if err != nil { diff --git a/internal/provider/vaultsecrets/data_source_vault_secrets_rotating_secret_test.go b/internal/provider/vaultsecrets/data_source_vault_secrets_rotating_secret_test.go index 75e33ce88..21a3df3ad 100644 --- a/internal/provider/vaultsecrets/data_source_vault_secrets_rotating_secret_test.go +++ b/internal/provider/vaultsecrets/data_source_vault_secrets_rotating_secret_test.go @@ -66,7 +66,7 @@ func TestAcc_dataSourceVaultSecretsRotatingSecret(t *testing.T) { } reqBody := secretmodels.SecretServiceCreateMongoDBAtlasRotatingSecretBody{ - SecretName: testSecretName, + Name: testSecretName, IntegrationName: testIntegrationName, RotationPolicyName: "built-in:30-days-2-active", SecretDetails: &secretmodels.Secrets20231128MongoDBAtlasSecretDetails{ diff --git a/internal/provider/vaultsecrets/rotating_secret_mongodb_atlas.go b/internal/provider/vaultsecrets/rotating_secret_mongodb_atlas.go index d72b99e46..e231ac22a 100644 --- a/internal/provider/vaultsecrets/rotating_secret_mongodb_atlas.go +++ b/internal/provider/vaultsecrets/rotating_secret_mongodb_atlas.go @@ -22,7 +22,7 @@ func (s *mongoDBAtlasRotatingSecret) read(ctx context.Context, client secret_ser WithOrganizationID(secret.OrganizationID.ValueString()). WithProjectID(secret.ProjectID.ValueString()). WithAppName(secret.AppName.ValueString()). - WithSecretName(secret.Name.ValueString()), nil) + WithName(secret.Name.ValueString()), nil) if err != nil && !clients.IsResponseCodeNotFound(err) { return nil, err } @@ -49,7 +49,7 @@ func (s *mongoDBAtlasRotatingSecret) create(ctx context.Context, client secret_s MongodbGroupID: secret.MongoDBAtlasUser.ProjectID.ValueString(), MongodbRoles: secret.mongoDBRoles, }, - SecretName: secret.Name.ValueString(), + Name: secret.Name.ValueString(), }), nil) if err != nil { diff --git a/internal/provider/vaultsecrets/rotating_secret_twilio.go b/internal/provider/vaultsecrets/rotating_secret_twilio.go index 29eec8900..38c8c4c6b 100644 --- a/internal/provider/vaultsecrets/rotating_secret_twilio.go +++ b/internal/provider/vaultsecrets/rotating_secret_twilio.go @@ -21,7 +21,7 @@ func (s *twilioRotatingSecret) read(ctx context.Context, client secret_service.C WithOrganizationID(secret.OrganizationID.ValueString()). WithProjectID(secret.ProjectID.ValueString()). WithAppName(secret.AppName.ValueString()). - WithSecretName(secret.Name.ValueString()), nil) + WithName(secret.Name.ValueString()), nil) if err != nil && !clients.IsResponseCodeNotFound(err) { return nil, err } @@ -40,7 +40,7 @@ func (s *twilioRotatingSecret) create(ctx context.Context, client secret_service WithBody(&secretmodels.SecretServiceCreateTwilioRotatingSecretBody{ RotationPolicyName: secret.RotationPolicyName.ValueString(), IntegrationName: secret.IntegrationName.ValueString(), - SecretName: secret.Name.ValueString(), + Name: secret.Name.ValueString(), }), nil) if err != nil {