From c9832f85c29d079b0341d9aac1954b999c588896 Mon Sep 17 00:00:00 2001 From: Douglas Harcourt Parsons Date: Fri, 8 Mar 2024 09:58:13 +0000 Subject: [PATCH] Fix issue updating sensitive project environment variables Closes #154 --- client/environment_variable_update.go | 1 - vercel/resource_project_environment_variable_model.go | 1 - vercel/resource_project_environment_variable_test.go | 4 ++-- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/client/environment_variable_update.go b/client/environment_variable_update.go index d1d6adea..322a2a6a 100644 --- a/client/environment_variable_update.go +++ b/client/environment_variable_update.go @@ -10,7 +10,6 @@ import ( // UpdateEnvironmentVariableRequest defines the information that needs to be passed to Vercel in order to // update an environment variable. type UpdateEnvironmentVariableRequest struct { - Key string `json:"key"` Value string `json:"value"` Target []string `json:"target"` GitBranch *string `json:"gitBranch,omitempty"` diff --git a/vercel/resource_project_environment_variable_model.go b/vercel/resource_project_environment_variable_model.go index dfa1cb8e..ebe65bdd 100644 --- a/vercel/resource_project_environment_variable_model.go +++ b/vercel/resource_project_environment_variable_model.go @@ -58,7 +58,6 @@ func (e *ProjectEnvironmentVariable) toUpdateEnvironmentVariableRequest() client } return client.UpdateEnvironmentVariableRequest{ - Key: e.Key.ValueString(), Value: e.Value.ValueString(), Target: target, GitBranch: toStrPointer(e.GitBranch), diff --git a/vercel/resource_project_environment_variable_test.go b/vercel/resource_project_environment_variable_test.go index 2959a734..ec837813 100644 --- a/vercel/resource_project_environment_variable_test.go +++ b/vercel/resource_project_environment_variable_test.go @@ -96,7 +96,7 @@ func TestAcc_ProjectEnvironmentVariables(t *testing.T) { resource.TestCheckResourceAttr("vercel_project_environment_variable.example_git_branch", "git_branch", "test"), testAccProjectEnvironmentVariableExists("vercel_project_environment_variable.example_sensitive", testTeam()), - resource.TestCheckResourceAttr("vercel_project_environment_variable.example_sensitive", "key", "foo_sensitive_updated"), + resource.TestCheckResourceAttr("vercel_project_environment_variable.example_sensitive", "key", "foo_sensitive"), resource.TestCheckResourceAttr("vercel_project_environment_variable.example_sensitive", "value", "bar-sensitive-updated"), resource.TestCheckTypeSetElemAttr("vercel_project_environment_variable.example_sensitive", "target.*", "production"), resource.TestCheckResourceAttr("vercel_project_environment_variable.example_sensitive", "sensitive", "true"), @@ -214,7 +214,7 @@ resource "vercel_project_environment_variable" "example_git_branch" { resource "vercel_project_environment_variable" "example_sensitive" { project_id = vercel_project.example.id %[3]s - key = "foo_sensitive_updated" + key = "foo_sensitive" value = "bar-sensitive-updated" target = ["production"] sensitive = true