07/09/2021, 2:09 PM
Hello guys, can i create multiple azure blobContainers inside loop for (const container of containers){ new'blobContainer', { accountName:, containerName: name, resourceGroupName: } } Erro: Duplicate recource URN I tryed with await but still same error


07/09/2021, 2:22 PM
yea you can but the name of the resource needs to be unique. That is how pulumi tracks the state of the resource. So you could do a for loop and you could append the index to each name so that they are numbered and thus unique - but you need to be careful and make sure you are doing it in such a way that if the cloud resource already exists it gets the same name the next time you call
pulumi up
otherwise pulumi will see it as a new resource and destroy/create
👍 1