Fix for Unnecessary Recreations of Cognitive Deployments #56
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
This merge request introduces a change to the
azurerm_cognitive_deployment
resource configuration, which resolves the issue of unnecessary resource destruction and recreation reported in issue #52. The core problem was identified as frequent and unnecessary changes to thecognitive_account_id
triggering resource replacement during Terraform apply phases.Changes Made:
lifecycle
block within theazurerm_cognitive_deployment
resource definition to ignore changes to thecognitive_account_id
. This modification ensures that the resource is not marked for replacement when the only change is thecognitive_account_id
, which should not typically trigger a redeployment.Testing:
The changes have been tested locally and verified to prevent unnecessary recreations of the
azurerm_cognitive_deployment
resource. The issue where Terraform would mark these resources for replacement, despite no meaningful changes, no longer occurs.