Skip to content

feat: Enable additional CloudFront real-time metrics - #372

Merged
Veronika Gnilitska (gberenice) merged 1 commit into
cloudposse:mainfrom
jwadolowski:feat/additional-cdn-metrics
May 20, 2026
Merged

Veronika Gnilitska (gberenice) merged 1 commit into
cloudposse:mainfrom
jwadolowski:feat/additional-cdn-metrics

Conversation

@jwadolowski

Copy link
Copy Markdown
Contributor

what

Add additional_metrics_enabled variable (default: false for backwards compatibility) that provisions an aws_cloudfront_monitoring_subscription resource when enabled.

why

Not all CloudFront metrics are enabled by default. Some (4xx/5xx error rates by HTTP status code, origin latency, and cache hit rate) are hidden behind a monitoring subscription. This adds a convenient switch to enable them when needed.

The realtime_metrics_subscription_status value could have been derived from var.additional_metrics_enabled, but that would introduce an unexpected resource change across all existing deployments.

references

A complementary PR to cloudposse/terraform-aws-cloudfront-cdn#162

@coderabbitai

coderabbitai Bot commented May 15, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 95878411-1797-40e4-94cf-20babd5e6f45

📥 Commits

Reviewing files that changed from the base of the PR and between 58698d2 and b47722b.

⛔ Files ignored due to path filters (1)
  • README.md is excluded by !README.md
📒 Files selected for processing (2)
  • main.tf
  • variables.tf

📝 Walkthrough

Walkthrough

This PR adds optional CloudFront real-time metrics monitoring to a Terraform module. A new boolean input variable additional_metrics_enabled (default: false) allows users to opt in to real-time metrics. When enabled alongside the module itself, a new aws_cloudfront_monitoring_subscription resource attaches the monitoring subscription to the CloudFront distribution.

Changes

CloudFront real-time metrics monitoring

Layer / File(s) Summary
CloudFront real-time metrics configuration and subscription
variables.tf, main.tf
New boolean variable additional_metrics_enabled controls creation of aws_cloudfront_monitoring_subscription resource, which conditionally enables real-time metrics on the CloudFront distribution when both the module and feature flag are active.

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding a feature to enable additional CloudFront real-time metrics through a new variable and monitoring subscription resource.
Description check ✅ Passed The description is clearly related to the changeset, explaining what was added (additional_metrics_enabled variable and aws_cloudfront_monitoring_subscription resource), why it was needed, and implementation rationale.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gberenice

Copy link
Copy Markdown

/terratest

@mergify mergify Bot removed the triage Needs triage label May 20, 2026
@gberenice
Veronika Gnilitska (gberenice) merged commit 989fa0e into cloudposse:main May 20, 2026
41 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

These changes were released in v2.1.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants