From 0942aed7a3b5b261c85e34534a63905759421b0a Mon Sep 17 00:00:00 2001 From: Manuwela Kanade Date: Wed, 8 Feb 2017 09:43:00 +0000 Subject: [PATCH] provider/consul: catalog entry service id should default to service name --- builtin/providers/consul/resource_consul_catalog_entry.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/builtin/providers/consul/resource_consul_catalog_entry.go b/builtin/providers/consul/resource_consul_catalog_entry.go index cf7d9acd9..cfdc830db 100644 --- a/builtin/providers/consul/resource_consul_catalog_entry.go +++ b/builtin/providers/consul/resource_consul_catalog_entry.go @@ -147,6 +147,9 @@ func resourceConsulCatalogEntryCreate(d *schema.ResourceData, meta interface{}) for i, rawService := range serviceList { serviceData := rawService.(map[string]interface{}) + if len(serviceData["id"].(string)) == 0 { + serviceData["id"] = serviceData["name"].(string) + } serviceID := serviceData["id"].(string) serviceIDs[i] = serviceID