Search code examples
springspring-cloudconsul

Token support in spring cloud consul


We are using spring-cloud to read the configuration for our application. We have the similar structure like below in application.yaml

spring:
  cloud:
    consul:
      host: consul_host
      port: 8500

We want to enable ACL for consul. So we need to pass consul token to read the configuration by spring. How can I specify consul token in application.yaml


Solution

  • If you use at least Spring Cloud Brixton M2 (current version is RC1), there is the property spring.cloud.consul.config.acl-token where you can specify the token.