Skip to content

Commit

Permalink
Add migration step.
Browse files Browse the repository at this point in the history
  • Loading branch information
marrobi committed Feb 28, 2024
1 parent 91d3569 commit 38406ba
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions core/terraform/migrate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -217,4 +217,13 @@ if [ "${state_store_serverless}" == "false" ]; then
export TF_VAR_is_cosmos_defined_throughput
fi

# prep for migration of azurerm_servicebus_namespace_network_rule_set https://github.com/microsoft/AzureTRE/pull/3858
# as described https://github.com/hashicorp/terraform-provider-azurerm/issues/23954
state_store_servicebus_network_rule_set=$(echo "${terraform_show_json}" \
| jq 'select(.values.root_module.resources != null) | .values.root_module.resources[] | select(.address=="azurerm_servicebus_namespace_network_rule_set.servicebus_network_rule_set") | .values.id')
if [ -n "${state_store_servicebus_network_rule_set}" ]; then
echo "Removing state of azurerm_servicebus_namespace_network_rule_set"
terraform state rm azurerm_servicebus_namespace_network_rule_set.servicebus_network_rule_set
fi

echo "*** Migration is done. ***"

0 comments on commit 38406ba

Please sign in to comment.