Aws:Cloudwatch:ExportToS3
CloudwatchlogsからS3へファイルエクスポート
はじめに
CloudWatchLogsをS3に退避する際に利用。
エクスポートする対象のS3バケットの準備
エクスポート先のS3バケットを準備します。
対象S3バケットの[アクセス許可]-[バケットポリシー]に設定します。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
{ "Version" : "2012-10-17" , "Statement" : [ { "Effect" : "Allow" , "Principal" : { "Service" : "logs.[REGION-NAME].amazonaws.com" }, "Action" : "s3:GetBucketAcl" , "Resource" : "arn:aws:s3:::[BUCKET-NAME]" }, { "Effect" : "Allow" , "Principal" : { "Service" : "logs.[REGION-NAME].amazonaws.com" }, "Action" : "s3:PutObject" , "Resource" : "arn:aws:s3:::[BUCKET-NAME]/*" , "Condition" : { "StringEquals" : { "s3:x-amz-acl" : "bucket-owner-full-control" } } } ] } |
CloudWatchLogsからS3バケットへログをエクスポートする
CloudWatch > ロググループ から、ロググループを選択し
[アクションメニュー] - [データをAmazon S3にエクスポート] を選択する。
上記で作成したS3バケットを選択し、[データのエクスポート]をクリックする。
Aws/Cloudwatch/ExportToS3.txt · 最終更新: 2020/05/12 by 127.0.0.1