File tree Expand file tree Collapse file tree 7 files changed +41
-12
lines changed
Expand file tree Collapse file tree 7 files changed +41
-12
lines changed Original file line number Diff line number Diff line change 1313
1414# Map of template files to target files
1515TEMPLATE_MAP = {
16+ 'fluent-bit.service.j2' : '/usr/lib/systemd/system/fluent-bit.service' ,
1617 'fluent-bit.yaml.j2' : '/etc/fluent-bit/fluent-bit.yaml' ,
1718 'stalwart.toml.j2' : '/opt/stalwart/etc/config.toml' ,
1819 'thundermail.service.j2' : '/usr/lib/systemd/system/thundermail.service' ,
Original file line number Diff line number Diff line change 1+ [Unit]
2+ Description=Fluent Bit
3+ Documentation=https://docs.fluentbit.io/manual/
4+ Requires=network.target
5+ After=network.target
6+
7+ [Service]
8+ Type=simple
9+ Environment="ENV={{ env }}"
10+ ExecStart=/opt/fluent-bit/bin/fluent-bit -c /etc/fluent-bit/fluent-bit.yaml
11+ Restart=always
12+
13+ [Install]
14+ WantedBy=multi-user.target
Original file line number Diff line number Diff line change @@ -21,11 +21,25 @@ pipeline:
2121 filters: []
2222
2323 outputs:
24- - name: forward
25- match: '*'
26- {% - if env == 'prod' %}
27- host: fluentbit.tb.pro
28- {% - else %}
29- host: {{ 'fluentbit-' + env + '.tb.pro' }}
30- {% - endif %}
31- port: 24224
24+ # Send logs onward to CloudWatch. Log groups by the derived name must pre-exist, and this
25+ # service must have sufficient IAM permissions to create log streams and post events to them.
26+ - name: cloudwatch_logs
27+ match: cloudwatch.stalwart.mail
28+ log_group_name: /tb/${ENV}/stalwart
29+ log_stream_name: mail
30+ region: eu-central-1
31+ log_key: MESSAGE
32+
33+ - name: cloudwatch_logs
34+ match: cloudwatch.stalwart.api
35+ log_group_name: /tb/${ENV}/stalwart
36+ log_stream_name: api
37+ region: eu-central-1
38+ log_key: MESSAGE
39+
40+ - name: cloudwatch_logs
41+ match: cloudwatch.untagged
42+ log_group_name: /tb/${ENV}/stalwart
43+ log_stream_name: untagged
44+ region: eu-central-1
45+ log_key: MESSAGE
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ resources:
1515 log_streams :
1616 api : api
1717 mail : mail
18+ untagged : untagged
1819 org_name : tb
1920
2021 tb:network:MultiTierVpc :
Original file line number Diff line number Diff line change 11Jinja2 >= 3.1 ,< 4.0
22pulumi_cloudflare == 6.6.0
3- tb_pulumi @ git+https://github.com/thunderbird/pulumi.git@main
3+ # tb_pulumi @ git+https://github.com/thunderbird/pulumi.git@main
4+ -e /home/rjung/workspace/thunderbird/pulumi
45toml >= 0.10.2 ,< 0.11
Original file line number Diff line number Diff line change @@ -825,6 +825,7 @@ def user_data(self):
825825 archive_file_base = './bootstrap'
826826 archive_files = [
827827 'bootstrap.py' ,
828+ 'templates/fluent-bit.service.j2' ,
828829 'templates/fluent-bit.yaml.j2' ,
829830 'templates/ports.j2' ,
830831 'templates/stalwart.toml.j2' ,
Original file line number Diff line number Diff line change @@ -28,9 +28,6 @@ dnf install -y bzip2 docker fluent-bit python3.12
2828# Delete the default fluent-bit config; we'll template a new one in Phase 2
2929rm -f /etc/fluent-bit/fluent-bit.conf
3030
31- # Make sure fluent-bit uses the right config file
32- sed -i ' s/fluent-bit.conf/fluent-bit.yaml/' /usr/lib/systemd/system/fluent-bit.service
33-
3431# Set up Stalwart config directory and virtual environment
3532mkdir -p $STALWART_DIR /etc
3633python3.12 -m ensurepip
You can’t perform that action at this time.
0 commit comments