templates/packer: Set region in vector config
Vector 0.21 needs region set otherwise the healthcheck will fail.
This commit is contained in:
parent
d38d4ab2c9
commit
1ded72b4dc
1 changed files with 3 additions and 0 deletions
|
|
@ -4,6 +4,8 @@ source /tmp/cloud_init_vars
|
||||||
|
|
||||||
echo "Writing vector config."
|
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 mkdir -p /etc/vector
|
||||||
sudo tee /etc/vector/vector.toml > /dev/null << EOF
|
sudo tee /etc/vector/vector.toml > /dev/null << EOF
|
||||||
[sources.journald]
|
[sources.journald]
|
||||||
|
|
@ -13,6 +15,7 @@ exclude_units = ["vector.service"]
|
||||||
[sinks.out]
|
[sinks.out]
|
||||||
type = "aws_cloudwatch_logs"
|
type = "aws_cloudwatch_logs"
|
||||||
inputs = [ "journald" ]
|
inputs = [ "journald" ]
|
||||||
|
region = "${REGION}"
|
||||||
endpoint = "${CLOUDWATCH_LOGS_ENDPOINT_URL}"
|
endpoint = "${CLOUDWATCH_LOGS_ENDPOINT_URL}"
|
||||||
group_name = "${CLOUDWATCH_LOG_GROUP}"
|
group_name = "${CLOUDWATCH_LOG_GROUP}"
|
||||||
stream_name = "worker_syslog_{{ host }}"
|
stream_name = "worker_syslog_{{ host }}"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue