hashicorp / hashicorp/consul

Not able to read consul KV store after enabling ACL

Open
#9,876 2 comments 0 reactions 0 assignees View on GitHub
theme/acls theme/kv type/question
Dominant language
Go
Stars
30.1k
Forks
4.6k
Avg merge
2d 6h
Merged PRs (30d)
43

Description

**I have a spring boot application to read propeties from KV store in consul. Some how I'm not able to read consul KV config values after enabling ACL**

**Bootstrap.yaml:**
```
spring:
profiles:
active: "prod-zone1"
application:
name: myApp

spring:
profiles: prod-zone1
cloud:
consul:
host: http://consul-server.consul-poc.svc.cluster.local
port: 8500
config:
enabled: true
discovery:
acl-token: ///Added acl master token
instanceZone: zone1
instance-id: "${spring.application.name}:${random.value}"
prefer-ip-address: true
```

Java Config Class:

```
package pl.piomin.services.account.controller;

import javax.annotation.PostConstruct;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Configuration;
@Configuration
@RefreshScope
public class ConsulConfiguration {
@Value("${cassandra.host}")
private String cassandraHost;
@PostConstruct
public void postConstruct() {
// to validate if properties are loaded
System.out.println("** cassandra.host: " + cassandraHost);

}
}
```

In Consul I've added kv store-> config/myApp/data/cassandra/host: 12.3.2.10

FYI, This code is working fine before **ACL** setup. Please help me understand what am I missing.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.