Using Terraform to import existing resources on Azure

前端 未结 3 1229
死守一世寂寞
死守一世寂寞 2020-12-06 11:21

I have an existing resource group on Azure with a VM running on it and have been playing around with Terraform to try and import the resource to my state file.

I ha

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-06 11:36

    When I copy your CLI, I get the same result with you.

    Between azurerm_resource_group.MyResourceGroup and /subscriptions/MySubscriptionNumber/resourceGroups/MyResourceGroup, it needs a space.

    The correct format is below:

    terraform import azurerm_resource_group.MyResourceGroup /subscriptions/MySubscriptionNumber/resourceGroups/MyResourceGroup
    

    More information about this please refer to this link.

提交回复
热议问题