Last active
December 12, 2017 22:31
-
-
Save tom-butler/7a9aa11628bb060301a30546df5ee541 to your computer and use it in GitHub Desktop.
send docker logs to cloudwatch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Copy | |
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"logs:CreateLogStream", | |
"logs:PutLogEvents", | |
"logs:DescribeLogStreams" | |
], | |
"Resource": [ | |
"arn:aws:logs:*:*:*" | |
] | |
} | |
] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '2' | |
services: | |
grafana: | |
image: geoscienceaustralia/autobots-grafana:latest | |
ports: | |
- 3000 | |
logging: | |
driver: awslogs | |
options: | |
awslogs-region: "ap-southeast-2" | |
awslogs-group: "grafana" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
# Forward grafana logs to docker log collector | |
RUN ln -sf /dev/stdout /var/log/grafana.log | |
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_cloudwatch_log_group" "grafana" { | |
name = "grafana" | |
retention_in_days = "30" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Built for ECS, but should work on other environments.