microsoft / bedrock

Automation for Production Kubernetes Clusters with a GitOps Workflow
MIT License
130 stars 12 forks source link

Avoid recreating resources when not needed #1443

Closed mickeahlinder closed 3 years ago

mickeahlinder commented 3 years ago

Sub-sequent calls to terraform plan or terraform apply against an already provisioned cluster recreates the ACR pull role assignment for the Managed Identity.

As per the discussion over at https://github.com/hashicorp/terraform/issues/22005 this fix will mitigate that behaviour.

The added query section is merely there to create an implicit dependency between the cluster resource and the msi_object_id resource which will move the read from the apply-phase to the plan phase where it will evaluate to a non-changed value.

andrebriggs commented 3 years ago

/AzurePipelines run

azure-pipelines[bot] commented 3 years ago
Azure Pipelines successfully started running 1 pipeline(s).
andrebriggs commented 3 years ago

We removed the msi_object_id in this file in main branch. Closing.