From 520118b5f6e33255c36b521643e587150e9f9f74 Mon Sep 17 00:00:00 2001 From: Vladyslav Mihun Date: Tue, 17 Dec 2024 13:52:14 +0200 Subject: [PATCH] SCALRCORE-32726 Add the ability to disable the Scalr backend to API/Provider --- environment.go | 2 ++ environment_test.go | 2 ++ workspace.go | 8 ++++++++ 3 files changed, 12 insertions(+) diff --git a/environment.go b/environment.go index a5f87e9..49b043a 100644 --- a/environment.go +++ b/environment.go @@ -49,6 +49,7 @@ type Environment struct { CostEstimationEnabled bool `jsonapi:"attr,cost-estimation-enabled"` CreatedAt time.Time `jsonapi:"attr,created-at,iso8601"` Status EnvironmentStatus `jsonapi:"attr,status"` + RemoteBackend bool `jsonapi:"attr,remote-backend"` // Relations Account *Account `jsonapi:"relation,account"` @@ -77,6 +78,7 @@ type EnvironmentCreateOptions struct { ID string `jsonapi:"primary,environments"` Name *string `jsonapi:"attr,name"` CostEstimationEnabled *bool `jsonapi:"attr,cost-estimation-enabled,omitempty"` + RemoteBackend *bool `jsonapi:"attr,remote-backend,omitempty"` // Relations Account *Account `jsonapi:"relation,account"` diff --git a/environment_test.go b/environment_test.go index 0133551..f3f6903 100644 --- a/environment_test.go +++ b/environment_test.go @@ -114,6 +114,7 @@ func TestEnvironmentsCreate(t *testing.T) { Name: String("tst-" + randomString(t)), Account: &Account{ID: defaultAccountID}, DefaultProviderConfigurations: []*ProviderConfiguration{provider_configuration}, + RemoteBackend: Bool(false), } env, err := client.Environments.Create(ctx, options) @@ -128,6 +129,7 @@ func TestEnvironmentsCreate(t *testing.T) { assert.Equal(t, *options.Name, env.Name) assert.Equal(t, options.Account.ID, env.Account.ID) + assert.Equal(t, false, env.RemoteBackend) assert.Len(t, env.DefaultProviderConfigurations, 1) assert.Equal(t, provider_configuration.ID, env.DefaultProviderConfigurations[0].ID) }) diff --git a/workspace.go b/workspace.go index c936602..ce00859 100644 --- a/workspace.go +++ b/workspace.go @@ -119,6 +119,8 @@ type Workspace struct { RunOperationTimeout *int `jsonapi:"attr,run-operation-timeout"` VarFiles []string `jsonapi:"attr,var-files"` EnvironmentType WorkspaceEnvironmentType `jsonapi:"attr,environment-type"` + TerragruntVersion string `jsonapi:"attr,terragrunt-version"` + TerragruntUseRunAll bool `jsonapi:"attr,terragrunt-use-run-all"` // Relations CurrentRun *Run `jsonapi:"relation,current-run"` @@ -287,6 +289,9 @@ type WorkspaceCreateOptions struct { // Specifies tags assigned to the workspace Tags []*Tag `jsonapi:"relation,tags,omitempty"` + + TerragruntVersion *string `jsonapi:"attr,terragrunt-version,omitempty"` + TerragruntUseRunAll *bool `jsonapi:"attr,terragrunt-use-run-all,omitempty"` } // WorkspaceVCSRepoOptions represents the configuration options of a VCS integration. @@ -471,6 +476,9 @@ type WorkspaceUpdateOptions struct { // Specifies the number of minutes run operation can be executed before termination. RunOperationTimeout *int `jsonapi:"attr,run-operation-timeout"` + + TerragruntVersion *string `jsonapi:"attr,terragrunt-version,omitempty"` + TerragruntUseRunAll *bool `jsonapi:"attr,terragrunt-use-run-all,omitempty"` } // Update settings of an existing workspace.