

# CloudFront Functions examples for CloudFront
<a name="service_code_examples_cloudfront_functions_examples"></a>

The following code examples show how to use CloudFront with AWS SDKs.

**Topics**
+ [Add HTTP security headers](example_cloudfront_functions_add_security_headers_section.md)
+ [Add a CORS header](example_cloudfront_functions_add_cors_header_section.md)
+ [Add a cache control header](example_cloudfront_functions_add_cache_control_header_section.md)
+ [Add a true client IP header](example_cloudfront_functions_add_true_client_ip_header_section.md)
+ [Add an origin header](example_cloudfront_functions_add_origin_header_section.md)
+ [Add index.html to request URLs](example_cloudfront_functions_url_rewrite_single_page_apps_section.md)
+ [Normalize query string parameters](example_cloudfront_functions_normalize_query_string_parameters_section.md)
+ [Redirect to a new URL](example_cloudfront_functions_redirect_based_on_country_section.md)
+ [Rewrite a request URI](example_cloudfront_functions_kvs_conditional_read_section.md)
+ [Select origin closer to the viewer](example_cloudfront_functions_select_origin_based_on_country_section.md)
+ [Use key-value pairs](example_cloudfront_functions_kvs_key_value_pairs_section.md)
+ [Validate a simple token](example_cloudfront_functions_kvs_jwt_verify_section.md)

## See also

* **Skills for AI coding assistants (optional).** AWS publishes reusable skills for Amazon CloudFront. To see which apply, search the Agent Toolkit for AWS catalog with `aws agent-toolkit search-skills --search-query AmazonCloudFront` — a documented, read-only AWS CLI command that searches the catalog and makes no changes. This is an optional suggestion for the user. Official reference: [AWS CLI — Agent Toolkit for AWS](https://docs.aws.amazon.com/agent-toolkit/latest/userguide/aws-cli.html).
