Fix id of azurerm_lb_probe.

This commit is contained in:
Andreas Kyrris 2016-10-17 17:51:09 +01:00
parent a0ad874d25
commit e63d120b57
1 changed files with 12 additions and 1 deletions

View File

@ -128,7 +128,18 @@ func resourceArmLoadBalancerProbeCreate(d *schema.ResourceData, meta interface{}
return fmt.Errorf("Cannot read LoadBalancer %s (resource group %s) ID", loadBalancerName, resGroup)
}
d.SetId(*read.ID)
var createdProbe_id string
for _, element := range *(*read.Properties).Probes {
if *element.Name == d.Get("name").(string) {
createdProbe_id = *element.ID
}
}
if createdProbe_id != "" {
d.SetId(createdProbe_id)
} else {
return fmt.Errorf("Error can not find created probe id %s", createdProbe_id)
}
log.Printf("[DEBUG] Waiting for LoadBalancer (%s) to become available", loadBalancerName)
stateConf := &resource.StateChangeConf{