Skip to content

Commit

Permalink
Feat: add the resource configuration_set - WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
TomerHeber committed May 27, 2024
1 parent dbeba01 commit 243e098
Show file tree
Hide file tree
Showing 5 changed files with 475 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client/configuration_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ type CreateConfigurationSetPayload struct {
// if Scope is "organization", scopeId will be calculated in the functions.
Scope string `json:"scope"` // "project" or "organization".
ScopeId string `json:"scopeId"` // project id or organization id.
ConfigurationProperties []ConfigurationVariable `json:"configurationProperties"`
ConfigurationProperties []ConfigurationVariable `json:"configurationProperties" tfschema:"-"`
}

type UpdateConfigurationSetPayload struct {
Expand All @@ -25,7 +25,7 @@ func (client *ApiClient) ConfigurationSetCreate(payload *CreateConfigurationSetP
var result ConfigurationSet
var err error

if payload.Scope == "organization" {
if payload.Scope == "organization" && payload.ScopeId == "" {
payload.ScopeId, err = client.OrganizationId()
if err != nil {
return nil, err
Expand Down
2 changes: 2 additions & 0 deletions client/configuration_set_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,3 +152,5 @@ var _ = Describe("Configuration Set", func() {
})
})
})

// TODO add more tests...
1 change: 1 addition & 0 deletions env0/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ func Provider(version string) plugin.ProviderFunc {
"env0_aws_eks_credentials": resourceAwsEksCredentials(),
"env0_azure_aks_credentials": resourceAzureAksCredentials(),
"env0_gcp_gke_credentials": resourceGcpGkeCredentials(),
"env0_variable_set": resourceVariableSet(),
},
}

Expand Down
Loading

0 comments on commit 243e098

Please sign in to comment.