AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides domain expertise for managing Amazon CloudFront distributions. It covers the full lifecycle of content delivery, from initial architectural decisions and distribution creation to securing origins and content, managing TLS certificates, and configuring traffic observability. The skill acts as a router, directing users to specific reference procedures for tasks such as setting up multi-tenant distributions, implementing origin access control, or choosing between standard and real-time logging. It emphasizes that CloudFront and its associated ACM certificates must be managed in the us-east-1 region.
What it does
- Guides decisions on when to use CloudFront and how it integrates with other AWS services.
- Manages custom domain TLS certificates via ACM in us-east-1.
- Configures origin protection using OAC, VPC origins, and mTLS.
- Secures content delivery with signed URLs, cookies, and geographic restrictions.
- Sets up standard and real-time logging for traffic observability.
- Supports multi-tenant distribution configurations for shared settings.
When to use it
- When you need to create or configure a CloudFront distribution.
- When you need to secure your origin so it is only reachable via CloudFront.
- When you need to manage custom domain certificates for your distribution.
- When you need to restrict content access based on identity, location, or tokens.
- When you need to analyze traffic patterns using standard or real-time logs.
Advantages
- Provides structured procedures for complex configurations like multi-tenant setups.
- Clarifies the distinction between origin protection and content security.
- Centralizes guidance on AWS service integrations like WAF and Lambda@Edge.
- Ensures correct regional configuration for ACM certificates.
- Offers clear decision frameworks for choosing logging strategies.
Usage examples
- “How do I restrict my S3 origin so it can only be accessed through CloudFront?”
- The agent will guide you through the protecting-your-origins reference to implement Origin Access Control (OAC) or VPC origins.
- “Should I use standard or real-time logs for my CloudFront distribution?”
- The agent will help you choose based on your need for complete audit records versus fast, sampled anomaly detection.
- “I am getting an error when attaching my ACM certificate to CloudFront.”
- The agent will verify if your certificate was requested in us-east-1 and provide steps to correct the region if necessary.
Install
Download the skill as a ZIP:
https://autogineer.com/agent-skills/aws/cloudfront/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip cloudfront.zip -d .agents/skills
Documentation by AWS
Amazon CloudFront
Overview
Domain expertise for configuring Amazon CloudFront content delivery: deciding when to use CloudFront and how it fits the wider architecture, managing custom-domain certificates and multi-tenant distributions, protecting origins, securing content, and observing traffic.
This skill is a router. Each customer task maps to a procedure file under references/. Read the
matching reference in full before acting, then follow its constraints and steps. The reference
files are self-contained: each carries its own decision tables, constraints, procedure, and
troubleshooting.
Execute commands using the AWS MCP server when connected (sandboxed execution, audit logging,
observability). Fall back to the AWS CLI otherwise. CloudFront is a global service; its API calls
and the AWS Certificate Manager (ACM) certificates it uses are made in us-east-1 regardless of
where the customer's application runs.
Which CloudFront task do you need?
| Goal | Reference |
|---|---|
| Decide whether CloudFront is the right layer, see how it integrates, create a distribution, tune caching, or choose pricing | when to use CloudFront |
| Serve a custom domain over HTTPS, manage ACM certificates, or run many domains with a certificate per tenant | managing certificates with CloudFront |
| Make CloudFront the only way to reach the origin (S3 OAC, VPC origins, origin mutual TLS, security groups) | protecting your origins |
| Limit who can view content by identity, location, client certificate, or auth token | securing your content |
| Get visibility into traffic with standard and real-time logs, and analyze them | CloudFront observability |
| Serve multiple domains through shared configuration with per-tenant customization (SaaS, platform) | multi-tenant distributions |
Routing notes
Choosing the layer and creating a distribution vs the rest. Whether CloudFront is the right entry layer, what it integrates with, creating a distribution, caching, and pricing live in the when-to-use reference. The other references assume a distribution exists and configure one aspect of it.
Protecting origins vs securing content. Locking the origin so it is reachable only through CloudFront (OAC, VPC origins, origin mTLS) is the protecting-your-origins reference. Restricting which viewers can see content (signed URLs and cookies, geographic restrictions, viewer mTLS, edge token validation) is the securing-your-content reference. They are paired: a content control only holds when the origin is also locked.
Viewer mTLS vs origin mTLS. Authenticating the client to CloudFront (viewer mTLS) is content security. Authenticating CloudFront to the origin (origin mTLS) is origin protection. Different controls, different references.
Custom domain certificate vs Route 53 DNS cutover. Requesting and validating the ACM certificate and adding the alternate domain name is the managing-certificates reference here. Pointing the domain's DNS at the distribution, including the zone apex alias and any failover, is Route 53 DNS work (see the
route53skill).
Cross-service work
Pointing a custom domain's DNS at a CloudFront distribution, or failing over between distributions with Route 53 records, is cross-service work spanning CloudFront and Route 53. Use this skill for the CloudFront-side configuration only.
Additional Resources
Files
- ATTRIBUTION.mdAdded by AutoGineer931 B
- LICENSELicence file added by AutoGineer9.9 KiB
- NOTICELicence file added by AutoGineer67 B
- SKILL.md5.1 KiB
- references/cloudfront-observability.md10.5 KiB
- references/managing-certificates-with-cloudfront.md13.8 KiB
- references/multi-tenant-distributions.md13.3 KiB
- references/protecting-your-origins.md12.6 KiB
- references/securing-your-content.md14.9 KiB
- references/when-to-use-cloudfront.md15.4 KiB
references/cloudfront-observability.md
Observing CloudFront Traffic with Logs
Overview
Domain expertise for getting visibility into CloudFront requests: choosing between standard logging and real-time logs, understanding their latency, completeness, and cost differences, reading the rich fields already present in the logs, and querying logs at rest with Amazon Athena.
Standard logging (v2) delivers comprehensive access logs to Amazon CloudWatch Logs, Amazon Data Firehose, or Amazon S3 on a delay of minutes, with selectable fields and output formats. Real-time logs deliver sampled records to an Amazon Kinesis data stream within seconds, on a best-effort basis. The two coexist and serve different needs: completeness versus freshness.
Does not cover creating the distribution (see when-to-use-cloudfront), origin or content security, or CloudWatch alarm authoring beyond pointing logs at a destination.
Execute commands using the AWS MCP server when connected (sandboxed execution, audit logging, observability). Fall back to the AWS CLI otherwise.
Table of Contents
Overview
Decision: standard logging vs real-time logs
Latency, completeness, and cost
Rich fields already in the logs
Querying at rest with Athena and Parquet
Procedure
Troubleshooting
Security Considerations
Additional Resources
Decision: standard logging vs real-time logs
| Need | Choose |
|---|---|
| Complete record for billing reconciliation, audit, detailed after-the-fact analysis | Standard logging to S3, CloudWatch Logs, or Firehose |
| Live dashboards, fast anomaly detection within seconds | Real-time logs to a Kinesis data stream |
Constraints:
You MUST pick by whether the customer needs completeness (standard) or freshness (real-time)
You SHOULD note the two coexist, and standard logging also coexists with legacy standard logging
Latency, completeness, and cost
Constraints:
You MUST explain standard logs are comprehensive and arrive minutes later with no CloudFront charge for log delivery (customer pays only for the destination — S3 storage, CloudWatch Logs ingestion/storage, or Firehose delivery; CloudWatch Logs bills a per-event included byte allowance with overage charged per byte — direct the customer to the current Amazon CloudWatch Logs pricing page for the exact allowance and rates rather than quoting a fixed number, which can change); real-time logs arrive within seconds, are sampled at a rate you set, and are best-effort with a CloudFront per-line charge plus the Kinesis data stream throughput cost (real-time logs go only to a Kinesis data stream)
You MUST set the expectation that real-time log counts will not match the AWS billing and usage reports, because delivery is best-effort and sampled. Route exact accounting to standard logs
You MUST warn that 100% sampling on real-time logs generates significant charges; recommend starting at a lower percentage for cost-sensitive workloads
You MUST surface the cost levers: real-time logs bill for CloudFront plus the destination, and choosing Parquet output on standard logs incurs a CloudWatch vended-logs conversion charge
You SHOULD mention Amazon CloudWatch Internet Monitor provides internet weather data and connectivity insights, helping customers correlate CloudFront performance with broader internet conditions
Rich fields already in the logs
Customers often ask for data CloudFront already logs, then build extra tooling to derive it.
Constraints:
You MUST surface the rich fields already present rather than send the customer to build tooling: the edge result type and cache hit or miss, the origin response and origin errors, the time taken, the viewer TLS protocol and cipher, and, for multi-tenant distributions, the distribution tenant identifier the request belonged to (enabling per-tenant dashboards and alerting)
You MUST highlight field selection as configurable in both standard and real-time logs — customers choose exactly which fields to include, reducing storage costs and simplifying analysis
Querying at rest with Athena and Parquet
Constraints:
You SHOULD point the customer at Amazon Athena to query logs in S3 with SQL
You SHOULD enable Hive-compatible partitioning and the Parquet output format to cut the data scanned per query, lowering cost and latency
You SHOULD reference the published integration patterns rather than have the customer build from scratch
Procedure
Overview
This procedure selects the logging mechanism, enables it with the chosen fields and destination, and points the customer at analysis.
Parameters
distribution_id (required): The distribution to log.
mechanism (required):
standardorreal-time.destination (required): For standard,
s3/cloudwatch/firehose; for real-time, the Kinesis data stream.fields (optional): The log fields to include.
Constraints for parameter acquisition:
You MUST ask whether the customer needs completeness or freshness before choosing the mechanism
You MUST confirm the destination and any required permissions
Steps
1. Verify dependencies
Constraints:
You MUST confirm credentials with
aws sts get-caller-identityYou MUST confirm the destination exists and has the required delivery permissions
You MUST enable encryption at rest on the log destination: SSE-S3 or SSE-KMS on an S3 bucket, SSE-KMS on an Amazon Data Firehose delivery stream, KMS encryption on a Kinesis data stream used for real-time logs, and a KMS key on every CloudWatch Logs log group receiving CloudFront logs (CloudFront request logs routinely carry sensitive data such as signed URL query strings and cookie values)
You SHOULD warn that signed URL query strings and cookie values can appear in the logs, and use field selection to exclude sensitive fields when they are not needed for analysis
You MUST enable AWS CloudTrail to record CloudFront management API calls (such as
cloudfront:CreateDistributionandcloudfront:UpdateDistribution) for a compliance and forensic audit trail, separate from the request access logs above
2a. Enable standard logging
Constraints:
You MUST enable standard logging to the chosen destination, selecting fields and, for S3, partitioning and (if wanted) the Parquet output format, noting the conversion charge
2b. Create a real-time log configuration
Constraints:
You MUST create the real-time configuration with a sampling rate, the chosen fields, and the Kinesis data stream, then attach it to the cache behaviors to cover:
aws cloudfront create-realtime-log-config --name {name} \ --sampling-rate {rate} --fields {fields} \ --end-points '[{"StreamType":"Kinesis","KinesisStreamConfig":{...}}]'
3. Point at analysis and surface the console link
Constraints:
You SHOULD set up an Athena table over the S3 logs (Hive partitioning, Parquet) for ad hoc queries, or a Kinesis consumer for real-time
You MUST present the distribution detail console link, filling
{distributionId}from the inputdistribution_idparameter:https://us-east-1.console.aws.amazon.com/cloudfront/v4/home?region=us-east-1#/distributions/{distributionId}
Example
Example input
{
"distribution_id": "E1ABCDEF2GHIJK",
"mechanism": "standard",
"destination": "s3",
"fields": ["timestamp", "x-edge-result-type", "sc-status", "time-taken"]
}Example output
Enabled standard logging on E1ABCDEF2GHIJK to S3.
Logs include edge result type, status, and time taken; query them with Athena.
Consider enabling Hive partitioning and Parquet output to reduce query cost (note: Parquet incurs a vended-logs conversion charge).
Verify in the console:
https://us-east-1.console.aws.amazon.com/cloudfront/v4/home?region=us-east-1#/distributions/E1ABCDEF2GHIJKTroubleshooting
Real-time log counts do not match the billing reports
Real-time delivery is best-effort and sampled, so counts will differ. Use standard logs for exact accounting.
Standard logs are not arriving in the destination
The destination is missing the required delivery permissions, or the S3 path conflicts with legacy logging. Set the vended-logs permissions and use a separate bucket or prefix from legacy logs.
Athena queries are slow or expensive
The logs are not partitioned or not in Parquet, so queries scan everything. Enable Hive-compatible partitioning and the Parquet output format.
A field the customer wants seems missing
It may already be a selectable field. Check the standard log fields reference for edge result type, origin errors, time taken, TLS protocol and cipher, and the tenant field.
Security Considerations
Logs can carry sensitive data. Signed URL query strings and cookie values appear in the logs. Use field selection to exclude these fields when they are not needed for analysis.
Encrypt the log destination. Enable SSE-S3 or SSE-KMS on the S3 bucket, SSE-KMS on an Amazon Data Firehose delivery stream, KMS encryption on a Kinesis data stream for real-time logs, and a KMS key on the CloudWatch Logs log group.
Lock down access to log destinations. Scope read access to the log bucket, stream, or log group to the operators and tools that need it, not a broad grant, since logs expose request detail.
High sampling exposes volume. 100% real-time sampling captures every request (and any sensitive fields) in addition to the cost; start at a lower rate unless full capture is required.
Audit the management plane with CloudTrail. Request access logs do not record who changed the distribution. Enable AWS CloudTrail to track CloudFront API calls (
cloudfront:CreateDistribution,cloudfront:UpdateDistribution) for a compliance and forensic audit trail.
Additional Resources
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs an MCP server
Security
No issues found by our static scan· No issues found
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- AWS
- Publisher
- AWS (Official)
- Source
- aws/agent-toolkit-for-aws · skills/specialized-skills/networking-and-content-delivery-skills/cloudfront · commit 0a218f8
- Licence
- Apache License 2.0 (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- NOTICE (added by AutoGineer from NOTICE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by AWS or AWS.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download cloudfront.zip