- Newest
- Most votes
- Most comments
Unfortunately, it's not possible to directly store CloudFront standard logs in a CloudWatch Logs group in your home region (eu-west-2) using native AWS services. CloudFront logs are always delivered from the us-east-1 region, which is why you're encountering issues when trying to configure a destination in eu-west-2.
To achieve your goal of having CloudFront logs in your home region, you'll need to set up a two-step process:
-
First, configure CloudFront to deliver logs to a CloudWatch Logs group in us-east-1, as you've already done.
-
Then, set up a log data transfer from the us-east-1 log group to a log group in your eu-west-2 region.
Here's a high-level approach to accomplish this:
-
Create a CloudWatch Logs group in us-east-1 to receive the CloudFront logs.
-
Configure CloudFront to send logs to this us-east-1 log group using the method you've already demonstrated.
-
Create a Lambda function in us-east-1 that will be triggered by new log events in the us-east-1 log group.
-
This Lambda function should process the incoming logs and forward them to a CloudWatch Logs group in eu-west-2.
-
Set up the necessary IAM permissions for the Lambda function to read from the us-east-1 log group and write to the eu-west-2 log group.
-
Create a CloudWatch Events rule to trigger the Lambda function periodically or in response to log events.
This approach, while not as straightforward as directly logging to your home region, will allow you to have the CloudFront logs available in your eu-west-2 region. Keep in mind that this solution will incur additional costs for the Lambda function executions and data transfer between regions.
If you prefer a managed solution, you might consider using AWS services like Kinesis Data Firehose or AWS DataSync to transfer the logs between regions, though these would also involve additional setup and costs.
Sources
Send CloudFront logs to CloudWatch | AWS re:Post
Standard logging (access logs) - Amazon CloudFront
Relevant content
- asked 5 months ago
- AWS OFFICIALUpdated 9 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 months ago