こちらのポリシーを作成し、EC2へアタッチする
1 2 3 4 5 6 7 8 9 10 11 12 13 |
{ "Version": "2012-10-17", "Statement": [ { "Action": [ "logs:CreateLogStream", "logs:PutLogEvents" ], "Effect": "Allow", "Resource": "*" } ] } |
1 2 3 4 5 6 7 |
logging: driver: "awslogs" options: awslogs-region: "ap-northeast-1" awslogs-group: "docker" tag: '{{ with split .ImageName ":" }}{{join . "_"}}{{end}}-{{.ID}}' # stream nameの名前 "image名_tag-ID" awslogs-create-group: "true" # groupがなければ作成される |
参考
https://note.com/ama2/n/nfaf258200a41