jmo808 / arm-aro43

9 stars 9 forks source link

Terraform destroy cannot remove items provisioned by this Template Deployment #5

Open ptsk5 opened 3 years ago

ptsk5 commented 3 years ago

Hi,

I used a part of this ARM template in my approach to provision the ARO cluster with terraform and it works. The issue is when I try to terraform destroy that I receive an error related to these two role assignments.

{
            "type": "Microsoft.Network/virtualNetworks/providers/roleAssignments",
            "apiVersion": "2018-09-01-preview",
            "name": "[concat(parameters('clusterVnetName'), '/Microsoft.Authorization/', guid(resourceGroup().id, deployment().name, parameters('aadObjectId')))]",
            "properties": {
                "roleDefinitionId": "[variables('contribRole')]",
                "principalId":"[parameters('aadObjectId')]"
            }
        },
        {
            "type": "Microsoft.Network/virtualNetworks/providers/roleAssignments",
            "apiVersion": "2018-09-01-preview",
            "name": "[concat(parameters('clusterVnetName'), '/Microsoft.Authorization/', guid(resourceGroup().id, deployment().name, parameters('rpObjectId')))]",
            "properties": {
                "roleDefinitionId": "[variables('contribRole')]",
                "principalId":"[parameters('rpObjectId')]"
            }
        },

The error is:

Error: removing items provisioned by this Template Deployment: deleting Nested Resource "/subscriptions/<my_subscription>/resourceGroups/<my_rg>/providers/Microsoft.Network/virtualNetworks/<my_vnet>/providers/Microsoft.Authorization/roleAssignments/4b7d3178-1fa2-5281-8e6a-7746cb4e36ef": resources.Client#DeleteByID: Failure sending request: StatusCode=0 -- Original Error: Code="NoRegisteredProviderFound" Message="No registered resource provider found for location 'westeurope' and API version '2021-05-01' for type 'roleAssignments'. The supported api-versions are '2014-04-01-preview, 2014-07-01-preview, 2014-10-01-preview, 2015-05-01-preview, 2015-06-01, 2015-07-01, 2016-07-01, 2017-05-01, 2017-09-01, 2017-10-01-preview, 2018-01-01-preview, 2018-07-01, 2018-09-01-preview, 2018-12-01-preview, 2019-04-01-preview, 2020-03-01-preview, 2020-04-01-preview, 2020-08-01-preview, 2021-04-01-preview'. The supported locations are ''."

Two things, I would like to point out:

Please, do you have any idea what is wrong?

Thanks a lot.

Jiri