

There are more AWS SDK examples available in the [AWS Doc SDK Examples](https://github.com/awsdocs/aws-doc-sdk-examples) GitHub repo.

# CloudFront Functions examples for CloudFront

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

**Topics**
+ [Add HTTP security headers](cloudfront_example_cloudfront_functions_add_security_headers_section.md)
+ [Add a CORS header](cloudfront_example_cloudfront_functions_add_cors_header_section.md)
+ [Add a cache control header](cloudfront_example_cloudfront_functions_add_cache_control_header_section.md)
+ [Add a true client IP header](cloudfront_example_cloudfront_functions_add_true_client_ip_header_section.md)
+ [Add an origin header](cloudfront_example_cloudfront_functions_add_origin_header_section.md)
+ [Add index.html to request URLs](cloudfront_example_cloudfront_functions_url_rewrite_single_page_apps_section.md)
+ [Authorize before the cache](cloudfront_example_cloudfront_functions_network_call_agent_authz_section.md)
+ [Authorize with a network call](cloudfront_example_cloudfront_functions_network_call_authorizer_headers_section.md)
+ [Bot check that fails open](cloudfront_example_cloudfront_functions_network_call_bot_check_fail_open_section.md)
+ [Health check and failover](cloudfront_example_cloudfront_functions_network_call_origin_health_failover_section.md)
+ [KeyValueStore read-through config](cloudfront_example_cloudfront_functions_network_call_kvs_config_read_through_section.md)
+ [Make a network call](cloudfront_example_cloudfront_functions_network_call_hello_fetch_section.md)
+ [Markdown for AI agents on demand](cloudfront_example_cloudfront_functions_network_call_markdown_on_demand_section.md)
+ [Normalize query string parameters](cloudfront_example_cloudfront_functions_normalize_query_string_parameters_section.md)
+ [Redirect to a new URL](cloudfront_example_cloudfront_functions_redirect_based_on_country_section.md)
+ [Rewrite a request URI](cloudfront_example_cloudfront_functions_kvs_conditional_read_section.md)
+ [Route through a VPC origin](cloudfront_example_cloudfront_functions_network_call_vpc_private_routing_section.md)
+ [Select origin closer to the viewer](cloudfront_example_cloudfront_functions_select_origin_based_on_country_section.md)
+ [Send events with cf.beacon](cloudfront_example_cloudfront_functions_network_call_beacon_signal_section.md)
+ [Sticky A/B variant](cloudfront_example_cloudfront_functions_network_call_ab_sticky_variant_section.md)
+ [Use key-value pairs](cloudfront_example_cloudfront_functions_kvs_key_value_pairs_section.md)
+ [Validate a Cognito token](cloudfront_example_cloudfront_functions_network_call_cognito_auth_section.md)
+ [Validate a simple token](cloudfront_example_cloudfront_functions_kvs_jwt_verify_section.md)
+ [Virtual waiting room](cloudfront_example_cloudfront_functions_network_call_waiting_room_section.md)