Step 2: Configure IAM permissions on your instance role
Fluent Bit runs on the Amazon EC2 instance and uses the instance role
to authenticate with Amazon S3. By default, this role does not include Amazon S3 permissions,
so you must create and attach a policy that grants Fluent Bit
permission to write logs to the ecs-logs/ prefix, read configuration
from the fluent-bit/ prefix, and list the bucket.
Note
You can also test your policies by using the IAM Policy Simulator
Create an IAM policy with the following JSON:
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "s3:PutObject", "s3:AbortMultipartUpload", "s3:ListMultipartUploadParts" ], "Resource": "arn:aws:s3:::host-level-logs-bucket/ecs-logs/*" }, { "Effect": "Allow", "Action": [ "s3:GetObject" ], "Resource": "arn:aws:s3:::host-level-logs-bucket/fluent-bit/*" }, { "Effect": "Allow", "Action": [ "s3:ListBucket", "s3:ListBucketMultipartUploads" ], "Resource": "arn:aws:s3:::host-level-logs-bucket" } ] }