Azure-Samples / jmeter-aci-terraform

Scalable cloud load/stress testing pipeline solution with Apache JMeter and Terraform to dynamically provision and destroy the required infrastructure on Azure.
MIT License
119 stars 99 forks source link

Job failed to create Aci due to vnet dependency #72

Closed EdiFirst closed 2 years ago

EdiFirst commented 2 years ago

First of all I'm missing the correct TF flow: Tf Plan, Apply to finally destroy. About the issue I don't get why to use TF Apply with -target azurerm_storage_share.jmeter_share I believe because of this I'm receiving the following error:

Error: A resource with the ID "/subscriptions/subsidxxxxx/resourceGroups/RG/providers/Microsoft.Network/virtualNetworks/jmetervnet" already exists - to be managed via Terraform this resource needs to be imported into the State. Please see the resource documentation for "azurerm_virtual_network" for more information.

I'll try apply all first before continue to move files and tests, but please give a feedback.

Thanks!

EdiFirst commented 2 years ago

Well about this issue like I said I was able "fix" just running an apply-all, its happened because the vnet depency on storage account. Basically If I run apply wth target storage account when try perform apply again it will "complain" that the resource vnet with that ID already existe. As I said we should have a correct terraform flow: Plan,Apply,Destroy.