Skip to content

Commit

Permalink
SCALRCORE-25591 update logic for updating env in provider-configurati…
Browse files Browse the repository at this point in the history
…on-default resource
  • Loading branch information
RomanMytsko committed Mar 1, 2023
1 parent a40bace commit bc40ae1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scalr/resource_scalr_provider_configuration_default.go
Expand Up @@ -91,6 +91,8 @@ func resourceScalrProviderConfigurationDefaultCreate(ctx context.Context, d *sch
environment.DefaultProviderConfigurations = append(environment.DefaultProviderConfigurations, &scalr.ProviderConfiguration{ID: providerConfiguration.ID})
updateOpts := scalr.EnvironmentUpdateOptions{
DefaultProviderConfigurations: environment.DefaultProviderConfigurations,
PolicyGroups: environment.PolicyGroups,
CloudCredentials: environment.CloudCredentials,
}
_, err = scalrClient.Environments.Update(ctx, environment.ID, updateOpts)
if err != nil {
Expand Down Expand Up @@ -160,6 +162,8 @@ func resourceScalrProviderConfigurationDefaultDelete(ctx context.Context, d *sch

updateOpts := scalr.EnvironmentUpdateOptions{
DefaultProviderConfigurations: environment.DefaultProviderConfigurations,
PolicyGroups: environment.PolicyGroups,
CloudCredentials: environment.CloudCredentials,
}

_, err = scalrClient.Environments.Update(ctx, environment.ID, updateOpts)
Expand Down

0 comments on commit bc40ae1

Please sign in to comment.