You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Note: these are approximate steps to repro, as I have not yet reproduced this in a lab due to the important nature of this particular Express Route.]
I had manually provisioned an Express Route, Express Route Peerings, and 3 Express Route Authorizations via the Azure portal. As part of bringing legacy resources into Terraform, I was going through a multi-step process to run terraform imports and incrementally import portions of the above setup into terraform state. Note the authorizations had all been consumed by a third-party.
The process for each resource was:
Write the terraform configuration block
Execute terraform plan to validate the deployment and discard the plan
Execute a terraform import for the target resource to bring it into state control
Execute terraform plan again to ensure configuration values matched imported state values
Execute terraform apply to write any outputs to state
The import went successfully and upon executing the post-import terraform apply, the only difference that terraform noted was adding tags (an in place update). Upon applying, the peering, the ARM API failed stating that I was using a "stale" configuration -- sorry, I don't have the exact text of the error, will try to repro. The Azure portal stated my circuit was now in a failed state. After running the Express Route circuit refresh via the portal, I noticed that my Express Route Authorizations were no longer listed in the Azure portal nor via az cli.
At this point, I opened a Microsoft support ticket and engaged Azure Rapid Response and the Product Team.
Actual Behavior
Terraform reported a diff on the MicrosoftPeering even though there was not a MicrosoftPeering configuration set:
Terraform will perform the following actions:
~ azurerm_express_route_circuit_peering.primary
microsoft_peering_config.#: "1" => "0"
Terraform applied updates to express route (tags)
Express route authorizations no longer visible in ARM/az cli in providing subscription
Underlying network still up - consuming subscription of authorizations still has express route authorizations attached
Hypothesis
ARM endpoint to update ExpressRoute might require peerings/authorizations as part of request or Azure considers it a delete for those blocks.
Azure product team to add more detail below.
Expected Behavior
Many possibilities:
TF should have applied the change and not destroyed the child authorizations
TF should have notified that it would have destroyed the authorizations as part of a plan or apply
ARM should have rejected the update since the authorizations were already reedemed and not truly deletable
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!
ghost
locked and limited conversation to collaborators
Jun 22, 2019
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Community Note
Terraform (and AzureRM Provider) Version
Affected Resource(s)
azurerm_express_route_circuit
azurerm_express_route_circuit_authorization
azurerm_express_route_circuit_peering
Terraform Configuration Files
Steps to Reproduce
[Note: these are approximate steps to repro, as I have not yet reproduced this in a lab due to the important nature of this particular Express Route.]
I had manually provisioned an Express Route, Express Route Peerings, and 3 Express Route Authorizations via the Azure portal. As part of bringing legacy resources into Terraform, I was going through a multi-step process to run
terraform imports
and incrementally import portions of the above setup into terraform state. Note the authorizations had all been consumed by a third-party.The process for each resource was:
terraform plan
to validate the deployment and discard the planterraform import
for the target resource to bring it into state controlterraform plan
again to ensure configuration values matched imported state valuesterraform apply
to write any outputs to stateThe order I did this was:
azurerm_resource_group
azurerm_express_route_circuit
azurerm_express_route_peering
(only added private peering)The import went successfully and upon executing the post-import
terraform apply
, the only difference that terraform noted was adding tags (an in place update). Upon applying, thepeering
, the ARM API failed stating that I was using a "stale" configuration -- sorry, I don't have the exact text of the error, will try to repro. The Azure portal stated my circuit was now in a failed state. After running the Express Route circuit refresh via the portal, I noticed that my Express Route Authorizations were no longer listed in the Azure portal nor viaaz cli
.At this point, I opened a Microsoft support ticket and engaged Azure Rapid Response and the Product Team.
Actual Behavior
Hypothesis
Expected Behavior
Many possibilities:
plan
orapply
Debug Output
None available, yet
Panic Output
None
References
The text was updated successfully, but these errors were encountered: