aws-cloudformation / aws-cloudformation/cloudformation-coverage-roadmap
[AWS::CloudFront::Distribution] - [Logging] - Feature request to allow the adding of Amazon CloudWatch logs as a Standard log destination
- Dominant language
- No language data
- Stars
- 1.1k
- Forks
- 62
- PR merge metrics
- No merged PRs in 30d
Description
### Name of the resource
AWS::CloudFront::Distribution
### Resource name
_No response_
### Description
Hello,
In the CloudFront Console, it is possible to add AWS CloudWatch logs as a standard log destination by navigating to Distributions >> Clicking on the ID >> Selecting the 'Logging' tab >> Under the 'Standard log destinations' pane, clicking the Add button and choosing Amazon CloudWatch logs.
From the CFN documentation, there doesn't seem to be a way to natively achieve this as the AWS::CloudFront::Distribution Logging property allows you specify the S3 bucket to store the access logs in and the AWS::CloudFront::RealtimeLogConfig EndPoints property is for the Amazon Kinesis data stream where you are sending real-time log data for this real-time log configuration. I do not see a property that allows you to add CloudWatch logs as a standard log destination.
As a workaround, there is the blog below where the CFN template creates a Lambda function to write CloudFront logs in S3 to a CloudWatch log group:
https://aws.amazon.com/blogs/mt/sending-cloudfront-standard-logs-to-cloudwatch-logs-for-analysis/
Hoping to add CW as a destination via CFN or understand if there is a better workaround than the one mentioned above for the meantime.
### Other Details
_No response_
Contributor guide
Research direction
Start by reviewing the AWS::CloudFront::Distribution Logging property and the CloudFront console path described in the issue, then compare them with the CloudWatch logs standard destination. Done means CloudFormation can natively configure that destination, or the supported limitation and workaround are documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws
- Domain
- cloud
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100