Skip to content

support config cloudfront standard log v2 via LoggingConfig #3062

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
2 tasks
ensean opened this issue Apr 16, 2025 · 3 comments
Closed
2 tasks

support config cloudfront standard log v2 via LoggingConfig #3062

ensean opened this issue Apr 16, 2025 · 3 comments
Labels
feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged.

Comments

@ensean
Copy link

ensean commented Apr 16, 2025

Describe the feature

Background

Cloudfront announced standard log v2 in 2024, supporting log partitioning with configuration options. But it seems that the standard log v2 can not be configured via DistributionConfig currently, since the LoggingConfig type does not support options needed for standard log v2.

Feature request

Add Cloudfront standard log v2 support to DistributionConfig

Use Case

Create Cloudfront distribution with standard log v2 enabled in a single function call.

Proposed Solution

No response

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

AWS Go SDK V2 Module Versions Used

github.com/aws/aws-sdk-go-v2/service/cloudfront
github.com/aws/aws-sdk-go-v2/service/cloudfront/types

Go version used

1.23.3

@ensean ensean added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Apr 16, 2025
@Madrigal
Copy link
Contributor

Looking at the docs, the process seems to be different from how it was on v1.

With v1 or legacy option, this was available directly on CloudFront, where you called Create or Update distribution to setup the log format. On v2, this is replaced by multiple steps that you take instead of CloudWatch to setup the log delivery. From the docs, it involves making the following calls (using the CLI from the example)

  1. aws logs put-delivery-source --name S3-delivery --resource-arn arn:aws:cloudfront::123456789012:distribution/d111111abcdef8 --log-type ACCESS_LOGS
  2. aws logs put-delivery-destination --name S3-destination --delivery-destination-configuration destinationResourceArn=arn:aws:s3:::amzn-s3-demo-bucket
  3. aws logs create-delivery --delivery-source-name cf-delivery --delivery-destination-arn arn:aws:logs:us-east-1:123456789012:delivery-destination:S3-destination

These operations are all available on the AWS SDK Go V2, so you should be able to follow that guide on the equivalent Go code

  1. PutDeliverySource
  2. PutDeliveryDestination
  3. CreateDelivery

Use Case
Create Cloudfront distribution with standard log v2 enabled in a single function call.

Unfortunately, this is not something that the SDK controls. A more effective way to leave feedback for this would be to open a support case and explain your use case and how this behavior would benefit you there.

Copy link

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

@ensean
Copy link
Author

ensean commented Apr 18, 2025

Thanks, I have create a go code to set log v2, do we need to concern about the consistency issue? Is it possible for cloudwatch logs API complains that the distribution id does not exists?

https://github.com/ensean/cloudfront-standard-log-go-sdk-v2/blob/main/create_cloudfront_with_logs.go#L51-L59

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

2 participants