Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CAF Foundation landing zone - deployment error #56

Closed
manavibanerjee opened this issue Jul 16, 2020 · 1 comment
Closed

CAF Foundation landing zone - deployment error #56

manavibanerjee opened this issue Jul 16, 2020 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@manavibanerjee
Copy link

Describe the bug
While deploying caf-terraform-landingzones , I get an error that the resources already exit.
Error: A resource with the ID "/subscriptions/18ab9f36-e50d-482f-919a-bbfb490d4f4c/providers/Microsoft.Authorization/policyAssignments/vm_auto_monitor" already exists - to be managed via Terraform this resource needs to be imported into the State. Please see the resource documentation for "azurerm_policy_assignment" for more information.

on blueprint_foundations_governance/policies/builtin/enable_az_monitor.tf line 4, in resource "azurerm_policy_assignment" "vm_auto_monitor":
4: resource "azurerm_policy_assignment" "vm_auto_monitor" {

Error: A resource with the ID "/subscriptions/18ab9f36-e50d-482f-919a-bbfb490d4f4c/providers/Microsoft.Authorization/policyAssignments/vm_no_managed_disks" already exists - to be managed via Terraform this resource needs to be imported into the State. Please see the resource documentation for "azurerm_policy_assignment" for more information.

on blueprint_foundations_governance/policies/builtin/managed_disks.tf line 4, in resource "azurerm_policy_assignment" "pol_managed_disks_assignment":
4: resource "azurerm_policy_assignment" "pol_managed_disks_assignment" {

Error: A resource with the ID "/subscriptions/18ab9f36-e50d-482f-919a-bbfb490d4f4c/providers/microsoft.insights/logprofiles/default" already exists - to be managed via Terraform this resource needs to be imported into the State. Please see the resource documentation for "azurerm_monitor_log_profile" for more information.

on /home/vscode/.terraform.cache/modules/blueprint_foundations_accounting.activity_logs/terraform-azurerm-caf-activity-logs-2.0/module.tf line 47, in resource "azurerm_monitor_log_profile" "subscription":
47: resource "azurerm_monitor_log_profile" "subscription" {

Error on or near line 483: Error running terraform apply; exiting with status 2001

I have checked my subscription and nothing was deployed in the southeastasia region and I had only resources deployed by preparation steps which are from:
rover /tf/caf/landingzones/launchpad apply -launchpad
Subscription resources Status prior to CAF foundation landing zone deployment
image

Why does the error report that vm_auto_monitor, vm_no_managed_disks and logprofiles already exists?
I have destroyed the whole deployment and started fresh as well but it says the same.

please help.

thanks,
Manavi

@manavibanerjee manavibanerjee added the bug Something isn't working label Jul 16, 2020
@arnaudlh
Copy link
Member

there as been a previous run of the caf_foundations landing zone where the logprofile (subscription/audit policy) and policy assignment were not successfully destroyed, you need to manually remove the objects.

@arnaudlh arnaudlh self-assigned this Jul 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants