A SysOps administrator is attempting to export historical log data from an Amazon CloudWatch Logs log group in the us-east-1 Region to an Amazon S3 bucket for long-term archiving. The administrator has verified that their IAM identity has the `logs:CreateExportTask` permission. However, when initiating the export task, it immediately fails with the following error:
`An error occurred (InvalidParameterException) when calling the CreateExportTask operation: The S3 bucket owner does not have write permission on the bucket.`
Which of the following actions will resolve this issue?
- Add a bucket policy to the destination Amazon S3 bucket that allows the logs.us-east-1.amazonaws.com service principal to perform the s3:PutObject and s3:GetBucketAcl actions.Cevap
- BCreate an IAM role with S3 write permissions, and assign the iam:PassRole permission to the SysOps administrator to pass this role to the CloudWatch Logs service during the export task.
- CUpdate the bucket policy of the destination Amazon S3 bucket to allow the cloudtrail.amazonaws.com service principal to write to the bucket.
- DModify the log retention settings of the CloudWatch log group to allow unlimited retention, as log groups with active expiration periods cannot be exported.
Cevap
Add a bucket policy to the destination Amazon S3 bucket that allows the logs.us-east-1.amazonaws.com service principal to perform the s3:PutObject and s3:GetBucketAcl actions.
The correct action is to add a bucket policy to the destination Amazon S3 bucket that allows the logs.us-east-1.amazonaws.com service principal to perform the s3:PutObject and s3:GetBucketAcl actions. CloudWatch Logs requires these resource-based permissions on the target S3 bucket to verify ownership and write the exported log data.
Adım Adım Çözüm
Anahtar Kavram
CloudWatch Logs to Amazon S3 Export Permissions
Tahmini Süre:1m 30s