Skip to content

Commit

Permalink
#24408: workload_profile should be updatable (#24409)
Browse files Browse the repository at this point in the history
  • Loading branch information
harshavmb authored Jan 10, 2024
1 parent 9718129 commit 27991a1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,10 @@ func (r ContainerAppEnvironmentResource) Update() sdk.ResourceFunc {
existing.Model.Tags = tags.Expand(state.Tags)
}

if metadata.ResourceData.HasChange("workload_profile") {
existing.Model.Properties.WorkloadProfiles = helpers.ExpandWorkloadProfiles(state.WorkloadProfiles)
}

// (@jackofallops) This is not updatable and needs to be removed since the read does not return the sensitive Key field.
// Whilst not ideal, this means we don't need to try and retrieve it again just to send a no-op.
existing.Model.Properties.AppLogsConfiguration = nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ func TestAccContainerAppEnvironment_updateWorkloadProfile(t *testing.T) {
Config: r.completeUpdate(data),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
check.That(data.ResourceName).Key("workload_profile.0.maximum_count").HasValue("3"),
),
},
data.ImportStep("log_analytics_workspace_id"),
Expand Down Expand Up @@ -304,6 +305,13 @@ resource "azurerm_container_app_environment" "test" {
internal_load_balancer_enabled = true
workload_profile {
maximum_count = 3
minimum_count = 0
name = "My-GP-01"
workload_profile_type = "D4"
}
tags = {
Foo = "test"
}
Expand Down

0 comments on commit 27991a1

Please sign in to comment.