Skip to content

Commit

Permalink
fixup! [u] Send GitLab host logs to CloudWatch (#3894)
Browse files Browse the repository at this point in the history
  • Loading branch information
achave11-ucsc committed May 26, 2023
1 parent c1a9fb9 commit 29151a4
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions terraform/gitlab/gitlab.tf.json.template.py
Original file line number Diff line number Diff line change
Expand Up @@ -1560,6 +1560,9 @@ def qq(*words):
{
'file_path': path,
'log_group_name': '${aws_cloudwatch_log_group.gitlab_cwagent.name}',
# https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateLogStream.html
# Characters disallowed for use in a log stream name are `:` and
# `*`, so we replace any occurrence of `*` in `path` with `?`.
'log_stream_name': path.replace('*', '?')
}
for path in
Expand Down Expand Up @@ -1634,10 +1637,10 @@ def qq(*words):
],
[
'amazon-cloudwatch-agent-ctl',
'-a', 'fetch-config',
'-m', 'ec2',
'-s',
'-c', 'file:/opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.json'
'-m', 'ec2', # mode
'-a', 'fetch-config', # action (fetch file from location specified in -c)
'-c', 'file:/opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.json',
'-s' # restart agent afterwards
]
],
}, indent=2),
Expand Down

0 comments on commit 29151a4

Please sign in to comment.