service-intentions config based on document fails to load/validate
- Dominant language
- Go
- Stars
- 30.1k
- Forks
- 4.6k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 43
Description
#### Overview of the Issue
Trying to declare an service intention configuration. With a basic config, based on the [documentation](https://developer.hashicorp.com/consul/docs/connect/config-entries/service-intentions)
```
Kind = "service-intentions"
Name = "*"
Sources = [
{
Name = "*"
Action = "deny"
}
]
```
Consul returns an error
```
$ consul validate intentions.hcl
Config validation failed: failed to parse intentions.hcl: 4 errors occurred:
* invalid config key Sources
* invalid config key Kind
* invalid config key Name
```
---
#### Reproduction Steps
1. create a configuration file (e.g. intentions.hcl) with the above.
2. in cli, `consul validate intentions.hcl`
### Consul info for both Client and Server
Client info
```
Output from client 'consul info' command here
```
```
Client agent HCL config
```
Server info
```
agent:
check_monitors = 0
check_ttls = 0
checks = 0
services = 1
build:
prerelease =
revision = 78b0ec2+
version = 1.18.1
version_metadata =
consul:
acl = disabled
bootstrap = false
known_datacenters = 1
leader = false
leader_addr =
server = true
raft:
applied_index = 0
commit_index = 0
fsm_pending = 0
last_contact = never
last_log_index = 0
last_log_term = 0
last_snapshot_index = 0
last_snapshot_term = 0
latest_configuration = []
latest_configuration_index = 0
num_peers = 0
protocol_version = 3
protocol_version_max = 3
protocol_version_min = 0
snapshot_version_max = 1
snapshot_version_min = 0
state = Follower
term = 0
runtime:
arch = amd64
cpu_count = 8
goroutines = 166
max_procs = 8
os = linux
version = go1.22.1
serf_lan:
coordinate_resets = 0
encrypted = true
event_queue = 0
event_time = 1
failed = 0
health_score = 0
intent_queue = 0
left = 0
member_time = 3
members = 6
query_queue = 0
query_time = 1
serf_wan:
coordinate_resets = 0
encrypted = true
event_queue = 0
event_time = 1
failed = 0
health_score = 0
intent_queue = 0
left = 0
member_time = 1
members = 1
query_queue = 0
query_time = 1
```
```
Server agent HCL config
```
### Operating system and Environment details
PRETTY_NAME="Ubuntu 22.04.5 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.5 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy
### Log Fragments
```
Nov 29 14:39:26 cs2 systemd[1]: consul.service: Scheduled restart job, restart counter is at 3.
Nov 29 14:39:26 cs2 systemd[1]: Stopped Consul Agent.
Nov 29 14:39:26 cs2 systemd[1]: Started Consul Agent.
Nov 29 14:39:26 cs2 consul[4077]: ==> failed to parse /etc/consul.d/intentions.hcl: 3 errors occurred:
Nov 29 14:39:26 cs2 consul[4077]: * invalid config key Sources
Nov 29 14:39:26 cs2 consul[4077]: * invalid config key Kind
Nov 29 14:39:26 cs2 consul[4077]: * invalid config key Name
Nov 29 14:39:26 cs2 systemd[1]: consul.service: Main process exited, code=exited, status=1/FAILURE
```
Contributor guide
Assessment
This issue has not been assessed yet.