Search code examples
azurepulumi

Pulumi Azure ARM template deployment error


Got error 'resourceGroupName' is not defined for Azure ARM template deployment

File "./__main__.py", line 23, in <module>
        resourceGroupName: resource_group.name,
    NameError: name 'resourceGroupName' is not defined
  

relevant part of code here, not sure where to look for TemplateDeployment docs , can't see them in API reference

armDeployment = azure.core.TemplateDeployment("test-dep", {
    resourceGroupName: resource_group.name,
    templateBody: JSON.stringify(content),
    parameters: {
        "storageAccountType": "Standard_GRS",
    },
    deploymentMode: "Incremental",
})

Solution

  • As shown in the docs the correct property name for the resource group is: resource_group_name and also template_body not templateBody. So it should work if you change it like this:

    armDeployment = azure.core.TemplateDeployment("test-dep", {
         resource_group_name: resource_group.name,
         template_body: JSON.stringify(content),
         parameters: {
            "storageAccountType": "Standard_GRS",
         },
         deployment_mode: "Incremental",
    })