I have a bizarre issue with registering a new service using terraform.
I'm using the consul provider and trying to use the resource "consul_service" in order to create a new service.
However, any service registered with this resource, gets automatically de-registered after 30-60 seconds.
However if I use the deprecated resource consul_agent_resource it does work and stay alive.
This issue reproduces on both my production cluster and dev consul agent.
2019/01/30 14:37:20 [DEBUG] http: Request GET /v1/catalog/node/test-node?dc=dc1 (200.426µs) from=
127.0.0.1:52233 2019/01/30 14:37:20 [INFO] agent: Synced service "test-name-working"
2019/01/30 14:37:20 [DEBUG] agent: Node info in sync
2019/01/30 14:37:20 [DEBUG] http: Request PUT /v1/agent/service/register?dc=dc1 (406.648µs) from=
127.0.0.1:52232 2019/01/30 14:37:20 [DEBUG] agent: Service "test-name-working" in sync
2019/01/30 14:37:20 [DEBUG] agent: Node info in sync
2019/01/30 14:37:20 [DEBUG] agent: Service "test-name-working" in sync
2019/01/30 14:37:20 [DEBUG] agent: Node info in sync
2019/01/30 14:37:20 [DEBUG] http: Request GET /v1/agent/services?dc=dc1 (129.522µs) from=
127.0.0.1:52232 2019/01/30 14:37:20 [DEBUG] http: Request PUT /v1/catalog/register?dc=dc1 (594.779µs) from=
127.0.0.1:52233 2019/01/30 14:37:20 [DEBUG] http: Request GET /v1/catalog/service/test-name-doesnt-work?dc=dc1 (308.384µs) from=
127.0.0.1:52232 2019/01/30 14:37:20 [DEBUG] http: Request GET /v1/catalog/service/test-name-doesnt-work?dc=dc1 (165.924µs) from=
127.0.0.1:52232 2019/01/30 14:37:27 [DEBUG] consul: Skipping self join check for "test-node" since the cluster is too small
2019/01/30 14:37:27 [INFO] consul: member 'test-node' joined, marking health alive
2019/01/30 14:38:27 [DEBUG] consul: Skipping self join check for "test-node" since the cluster is too small
2019/01/30 14:38:27 [INFO] consul: member 'test-node' joined, marking health alive
2019/01/30 14:38:50 [DEBUG] manager: Rebalanced 1 servers, next active server is test-node.dc1 (Addr: tcp/
127.0.0.1:8300) (DC: dc1)
2019/01/30 14:39:08 [DEBUG] agent: Skipping remote check "serfHealth" since it is managed automatically
2019/01/30 14:39:08 [DEBUG] agent: Service "test-name-working" in sync
2019/01/30 14:39:08 [INFO] agent: Deregistered service "test-name-doesnt-work"
2019/01/30 14:39:08 [INFO] agent: Synced node info
2019/01/30 14:39:09 [DEBUG] http: Request GET /v1/catalog/services (176.205µs) from=
127.0.0.1:52265 2019/01/30 14:39:27 [DEBUG] consul: Skipping self join check for "test-node" since the cluster is too small