Skip to content

Commit

Permalink
update hcp-sdk-go (#1113)
Browse files Browse the repository at this point in the history
* update hcp-sdk-go

* remove comment

* go mod tidy

* add changelog

* spelling error

* update test
  • Loading branch information
dhuckins authored Oct 11, 2024
1 parent 9afb301 commit cd7cff2
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .changelog/1113.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:improvement
Upgrade the HCP SDK and fix breaking change w/ Vault Secrets
```
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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.115.0
github.com/hashicorp/hcp-sdk-go v0.116.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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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.115.0 h1:q6viFNFPd4H4cHm/B9KGYvkpkT5ZSBQASh9KR/zYHEI=
github.com/hashicorp/hcp-sdk-go v0.115.0/go.mod h1:vQ4fzdL1AmhIAbCw+4zmFe5Hbpajj3NvRWkJoVuxmAk=
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/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=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,16 @@ func TestAcc_dataSourceVaultSecretsRotatingSecret(t *testing.T) {
SecretName: testSecretName,
IntegrationName: testIntegrationName,
RotationPolicyName: "built-in:30-days-2-active",
MongodbGroupID: mongodbAtlasGroupID,
MongodbRoles: []*secretmodels.Secrets20231128MongoDBRole{
{
DatabaseName: mongodbAtlasDBName,
RoleName: "read",
CollectionName: "",
SecretDetails: &secretmodels.Secrets20231128MongoDBAtlasSecretDetails{
MongodbGroupID: mongodbAtlasGroupID,
MongodbRoles: []*secretmodels.Secrets20231128MongoDBRole{
{
DatabaseName: mongodbAtlasDBName,
RoleName: "read",
CollectionName: "",
},
},
MongodbScopes: nil,
},
}
_, err = clients.CreateMongoDBAtlasRotatingSecret(ctx, client, loc, testAppName, &reqBody)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ func (s *mongoDBAtlasRotatingSecret) create(ctx context.Context, client secret_s
WithAppName(secret.AppName.ValueString()).
WithBody(&secretmodels.SecretServiceCreateMongoDBAtlasRotatingSecretBody{
IntegrationName: secret.IntegrationName.ValueString(),
MongodbGroupID: secret.MongoDBAtlasUser.ProjectID.ValueString(), // Group ID must be at this level, not in the secret details
RotationPolicyName: secret.RotationPolicyName.ValueString(),
SecretDetails: &secretmodels.Secrets20231128MongoDBAtlasSecretDetails{
MongodbRoles: secret.mongoDBRoles,
MongodbGroupID: secret.MongoDBAtlasUser.ProjectID.ValueString(),
MongodbRoles: secret.mongoDBRoles,
},
SecretName: secret.Name.ValueString(),
}),
Expand Down

0 comments on commit cd7cff2

Please sign in to comment.