Forum Discussion
hamma91
Mar 22, 2022Brass Contributor
problem update tfstate with resources
hello,
i have created a resource groupe with vnet via terraform using this pipeline
the RG and vnet are created correctly.
BUT, when i update the code in the repos that i want to add the creation of a new resource like a subnet for examle. the job of pipeline work automatically and i have this error :
RG is existing , i don't undrestant how to make the update automatically for resources.
and how can i stop the automatic lunch of the pipeline after modifing the code in the repos ?
Thanks
- You need to disable the CI trigger by adding
trigger: none
https://docs.microsoft.com/en-us/azure/devops/pipelines/repos/azure-repos-git?view=azure-devops&WT.mc_id=AZ-MVP-5004274
Regarding the error in the screenshot it simply means that a resource with the same name has been created manually or by terraform but not kept in the state file .
If the resource group empty the easiest way is to delete it and redeploy it . If it's not possible you need to do a terraform import an option documented here : https://www.terraform.io/cli/import/usage
1 Reply
- ibnmbodjiIron ContributorYou need to disable the CI trigger by adding
trigger: none
https://docs.microsoft.com/en-us/azure/devops/pipelines/repos/azure-repos-git?view=azure-devops&WT.mc_id=AZ-MVP-5004274
Regarding the error in the screenshot it simply means that a resource with the same name has been created manually or by terraform but not kept in the state file .
If the resource group empty the easiest way is to delete it and redeploy it . If it's not possible you need to do a terraform import an option documented here : https://www.terraform.io/cli/import/usage