templates/packer: vector expects a yaml configuration now

When switching to the new vector repos, the version was also bumped. The
newer versions expect a yaml config.
This commit is contained in:
Sanne Raymaekers 2024-03-06 22:34:13 +01:00 committed by Tomáš Hozza
parent aa156028b5
commit ef44f22d89

View file

@ -7,19 +7,23 @@ echo "Writing vector config."
REGION=$(curl -Ls http://169.254.169.254/latest/dynamic/instance-identity/document | jq -r .region)
sudo mkdir -p /etc/vector
sudo tee /etc/vector/vector.toml > /dev/null << EOF
[sources.journald]
type = "journald"
exclude_units = ["vector.service"]
[sinks.out]
type = "aws_cloudwatch_logs"
inputs = [ "journald" ]
region = "${REGION}"
endpoint = "${CLOUDWATCH_LOGS_ENDPOINT_URL}"
group_name = "${CLOUDWATCH_LOG_GROUP}"
stream_name = "worker_syslog_{{ host }}"
encoding.codec = "json"
sudo tee /etc/vector/vector.yaml > /dev/null << EOF
sources:
journald:
type: journald
exclude_units:
- vector.service
sinks:
out:
type: aws_cloudwatch_logs
inputs:
- journald
region: ${REGION}
endpoint: ${CLOUDWATCH_LOGS_ENDPOINT_URL}
group_name: ${CLOUDWATCH_LOG_GROUP}
stream_name: worker_syslog_{{ host }}
encoding:
codec: json
EOF
sudo systemctl enable --now vector