Open tonythomasm opened 3 years ago
@tonythomasm - I took a quick look, and what you're experiencing is definitely explainable.
I see that you included subnet_id
as part of the configuration you shared above. By including subnet_id
, Terraform locks both the specified subnet and the virtual network associated with the subnet prior to creation.
That's a pattern that is pretty common throughout Terraform given that Azure doesn't allow concurrent changes to the networking stack. See #13564 as an example.
In looking at the Azure API, it doesn't look like there's a dedicated function to connect a cache to a subnet. So I don't see a way to safely convert this to a parallel provisioning process.
Community Note
Description
We are using
azurerm_redis_cache
to create azure redis instances. We need 4 instances to be created in paralllel by passing list of resource names tofor_each
meta-argument (Terraform template is given below). But the instances are being created sequentially. Its taking 13 mins on an avg to create one instance, thus in total ~40 mins to create 4.The instances are being created in parallel while trying manually from portal and by using
azurerm_resource_group_template_deployment
terraform resource. That means deployments will take care of creating the instances in parallel and all instances are ready to use in 12 mins.So is there any way to get the instances created in parallel using
azurerm_redis_cache
?Terraform (and AzureRM Provider) Version
Affected Resource(s)
azurerm_redis_cache
Terraform Configuration Files
Debug Output
Expected Behaviour
Redis instances need to be created in parallel
Actual Behaviour
Terrafrom logs shows instances are being created in parallel. But its getting created in sequence.