KinesisDataFirehoseを中継してS3バケットにログを配信する設定手順を記載します。
■S3 compression and encryption
https://docs.aws.amazon.com/ja_jp/firehose/latest/dev/create-configure.html#compression-encryption
・S3 compression:Zip
・S3 encryption:Disabled ※暗号化する場合はKMSキーを選択します。
■Error logging
https://docs.aws.amazon.com/ja_jp/firehose/latest/dev/monitoring-with-cloudwatch-logs.html
・Error logging:Enabled ※データ配信が失敗した場合の、CloudWatchLogsへの記録を無効にする場合は[Disabled]を選択します。
■Tags
必要に応じて設定します。
■Permissions
・IAM role:IAMロールを指定します。 ※カスタムロールを作成する場合は下記を参考にしてください。
{ "Version": "2012-10-17", "Statement": [ { "Sid": "", "Effect": "Allow", "Action": [ "glue:GetTable", "glue:GetTableVersion", "glue:GetTableVersions" ], "Resource": [ "arn:aws:glue:ap-northeast-1:[アカウントID]:catalog", "arn:aws:glue:ap-northeast-1:[アカウントID]:database/%FIREHOSE_POLICY_TEMPLATE_PLACEHOLDER%", "arn:aws:glue:ap-northeast-1:[アカウントID]:table/%FIREHOSE_POLICY_TEMPLATE_PLACEHOLDER%/%FIREHOSE_POLICY_TEMPLATE_PLACEHOLDER%" ] }, { "Sid": "", "Effect": "Allow", "Action": [ "s3:AbortMultipartUpload", "s3:GetBucketLocation", "s3:GetObject", "s3:ListBucket", "s3:ListBucketMultipartUploads", "s3:PutObject" ], "Resource": [ "arn:aws:s3:::[配信するS3バケット]", "arn:aws:s3:::[配信するS3バケット]/*" ] }, { "Sid": "", "Effect": "Allow", "Action": [ "lambda:InvokeFunction", "lambda:GetFunctionConfiguration" ], "Resource": "arn:aws:lambda:ap-northeast-1:[アカウントID]:function:%FIREHOSE_POLICY_TEMPLATE_PLACEHOLDER%" }, { "Effect": "Allow", "Action": [ "kms:GenerateDataKey", "kms:Decrypt" ], "Resource": [ "arn:aws:kms:ap-northeast-1:[アカウントID]:key/%FIREHOSE_POLICY_TEMPLATE_PLACEHOLDER%" ], "Condition": { "StringEquals": { "kms:ViaService": "s3.ap-northeast-1.amazonaws.com" }, "StringLike": { "kms:EncryptionContext:aws:s3:arn": [ "arn:aws:s3:::%FIREHOSE_POLICY_TEMPLATE_PLACEHOLDER%/*" ] } } }, { "Sid": "", "Effect": "Allow", "Action": [ "logs:PutLogEvents" ], "Resource": [ "arn:aws:logs:ap-northeast-1:[アカウントID]:log-group:/aws/kinesisfirehose/aws-fsx-stream:log-stream:*" ] }, { "Sid": "", "Effect": "Allow", "Action": [ "kinesis:DescribeStream", "kinesis:GetShardIterator", "kinesis:GetRecords", "kinesis:ListShards" ], "Resource": "arn:aws:kinesis:ap-northeast-1:[アカウントID]:stream/%FIREHOSE_POLICY_TEMPLATE_PLACEHOLDER%" }, { "Effect": "Allow", "Action": [ "kms:Decrypt" ], "Resource": [ "arn:aws:kms:ap-northeast-1:[アカウントID]:key/%FIREHOSE_POLICY_TEMPLATE_PLACEHOLDER%" ], "Condition": { "StringEquals": { "kms:ViaService": "kinesis.ap-northeast-1.amazonaws.com" }, "StringLike": { "kms:EncryptionContext:aws:kinesis:arn": "arn:aws:kinesis:ap-northeast-1:[アカウントID]:stream/%FIREHOSE_POLICY_TEMPLATE_PLACEHOLDER%" } } } ] }