From 8406144b0653f12e19b81ef08f7d9341285fd911 Mon Sep 17 00:00:00 2001 From: Daniel Huckins Date: Wed, 9 Oct 2024 13:25:51 -0400 Subject: [PATCH 1/6] update hcp-sdk-go --- go.mod | 2 +- go.sum | 2 ++ .../provider/vaultsecrets/rotating_secret_mongodb_atlas.go | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 95fb77de3..32412af0e 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.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 diff --git a/go.sum b/go.sum index 68280d437..2d9143208 100644 --- a/go.sum +++ b/go.sum @@ -124,6 +124,8 @@ github.com/hashicorp/hcl/v2 v2.19.1 h1://i05Jqznmb2EXqa39Nsvyan2o5XyMowW5fnCKW5R 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= diff --git a/internal/provider/vaultsecrets/rotating_secret_mongodb_atlas.go b/internal/provider/vaultsecrets/rotating_secret_mongodb_atlas.go index fa6f48ccf..98f22b1f0 100644 --- a/internal/provider/vaultsecrets/rotating_secret_mongodb_atlas.go +++ b/internal/provider/vaultsecrets/rotating_secret_mongodb_atlas.go @@ -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(), // Group ID must be at this level, not in the secret details + MongodbRoles: secret.mongoDBRoles, }, SecretName: secret.Name.ValueString(), }), From 4e83b2b53a094ae9f4c96101e917873e3c675be9 Mon Sep 17 00:00:00 2001 From: Daniel Huckins Date: Wed, 9 Oct 2024 13:27:03 -0400 Subject: [PATCH 2/6] remove comment --- internal/provider/vaultsecrets/rotating_secret_mongodb_atlas.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/provider/vaultsecrets/rotating_secret_mongodb_atlas.go b/internal/provider/vaultsecrets/rotating_secret_mongodb_atlas.go index 98f22b1f0..d72b99e46 100644 --- a/internal/provider/vaultsecrets/rotating_secret_mongodb_atlas.go +++ b/internal/provider/vaultsecrets/rotating_secret_mongodb_atlas.go @@ -46,7 +46,7 @@ func (s *mongoDBAtlasRotatingSecret) create(ctx context.Context, client secret_s IntegrationName: secret.IntegrationName.ValueString(), RotationPolicyName: secret.RotationPolicyName.ValueString(), SecretDetails: &secretmodels.Secrets20231128MongoDBAtlasSecretDetails{ - MongodbGroupID: secret.MongoDBAtlasUser.ProjectID.ValueString(), // Group ID must be at this level, not in the secret details + MongodbGroupID: secret.MongoDBAtlasUser.ProjectID.ValueString(), MongodbRoles: secret.mongoDBRoles, }, SecretName: secret.Name.ValueString(), From 16232da008a4bfe518879497f936476951b31366 Mon Sep 17 00:00:00 2001 From: Daniel Huckins Date: Wed, 9 Oct 2024 13:28:52 -0400 Subject: [PATCH 3/6] go mod tidy --- go.sum | 2 -- 1 file changed, 2 deletions(-) diff --git a/go.sum b/go.sum index 2d9143208..a9e3f83ca 100644 --- a/go.sum +++ b/go.sum @@ -122,8 +122,6 @@ 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= From 64ea8ce332dd84c587c6fabdb4b08e3db3d17498 Mon Sep 17 00:00:00 2001 From: Daniel Huckins Date: Wed, 9 Oct 2024 13:30:59 -0400 Subject: [PATCH 4/6] add changelog --- .changelog/1113.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/1113.txt diff --git a/.changelog/1113.txt b/.changelog/1113.txt new file mode 100644 index 000000000..ad9a63cf2 --- /dev/null +++ b/.changelog/1113.txt @@ -0,0 +1,3 @@ +```release-note:improvement +Upgrade the HCP SDK and fix breakign change w/ Vault Secrets +``` From d80fbb528fcb0a5ec334c96d684addb0d1931a32 Mon Sep 17 00:00:00 2001 From: Daniel Huckins Date: Wed, 9 Oct 2024 13:35:21 -0400 Subject: [PATCH 5/6] spelling error --- .changelog/1113.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changelog/1113.txt b/.changelog/1113.txt index ad9a63cf2..63a838948 100644 --- a/.changelog/1113.txt +++ b/.changelog/1113.txt @@ -1,3 +1,3 @@ ```release-note:improvement -Upgrade the HCP SDK and fix breakign change w/ Vault Secrets +Upgrade the HCP SDK and fix breaking change w/ Vault Secrets ``` From 7bd9d3a53ae0181a745a54bf840b80a72f2ba737 Mon Sep 17 00:00:00 2001 From: Daniel Huckins Date: Wed, 9 Oct 2024 14:08:19 -0400 Subject: [PATCH 6/6] update test --- ...a_source_vault_secrets_rotating_secret_test.go | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) 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 a2f9c1a5c..75e33ce88 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 @@ -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)