

文件 AWS 開發套件範例 GitHub 儲存庫中有更多可用的 [AWS SDK 範例](https://github.com/awsdocs/aws-doc-sdk-examples)。

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# CloudFront AWS SDKs的程式碼範例
<a name="cloudfront_code_examples"></a>

下列程式碼範例示範如何使用 Amazon CloudFront 搭配 AWS 軟體開發套件 (SDK)。

*Actions* 是大型程式的程式碼摘錄，必須在內容中執行。雖然動作會告訴您如何呼叫個別服務函數，但您可以在其相關情境中查看內容中的動作。

*案例*是向您展示如何呼叫服務中的多個函數或與其他 AWS 服務組合來完成特定任務的程式碼範例。

**其他資源**
+  **[ CloudFront 開發人員指南](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Introduction.html)** – CloudFront 的相關詳細資訊。
+ **[CloudFront API 參考](https://docs.aws.amazon.com/cloudfront/latest/APIReference/Welcome.html)** – 所有可用 CloudFront 動作的詳細資訊。
+ **[AWS 開發人員中心](https://aws.amazon.com/developer/code-examples/?awsf.sdk-code-examples-product=product%23cloudfront)** – 您可以依類別或全文搜尋篩選的程式碼範例。
+ **[AWS SDK 範例](https://github.com/awsdocs/aws-doc-sdk-examples)** – GitHub 儲存庫使用慣用語言的完整程式碼。包含設定和執行程式碼的指示。

**Contents**
+ [基本概念](cloudfront_code_examples_basics.md)
  + [動作](cloudfront_code_examples_actions.md)
    + [`CreateDistribution`](cloudfront_example_cloudfront_CreateDistribution_section.md)
    + [`CreateFunction`](cloudfront_example_cloudfront_CreateFunction_section.md)
    + [`CreateInvalidation`](cloudfront_example_cloudfront_CreateInvalidation_section.md)
    + [`CreateKeyGroup`](cloudfront_example_cloudfront_CreateKeyGroup_section.md)
    + [`CreatePublicKey`](cloudfront_example_cloudfront_CreatePublicKey_section.md)
    + [`DeleteDistribution`](cloudfront_example_cloudfront_DeleteDistribution_section.md)
    + [`GetCloudFrontOriginAccessIdentity`](cloudfront_example_cloudfront_GetCloudFrontOriginAccessIdentity_section.md)
    + [`GetCloudFrontOriginAccessIdentityConfig`](cloudfront_example_cloudfront_GetCloudFrontOriginAccessIdentityConfig_section.md)
    + [`GetDistribution`](cloudfront_example_cloudfront_GetDistribution_section.md)
    + [`GetDistributionConfig`](cloudfront_example_cloudfront_GetDistributionConfig_section.md)
    + [`ListCloudFrontOriginAccessIdentities`](cloudfront_example_cloudfront_ListCloudFrontOriginAccessIdentities_section.md)
    + [`ListDistributions`](cloudfront_example_cloudfront_ListDistributions_section.md)
    + [`UpdateDistribution`](cloudfront_example_cloudfront_UpdateDistribution_section.md)
+ [案例](cloudfront_code_examples_scenarios.md)
  + [建立多租用戶分佈和分佈租用戶](cloudfront_example_cloudfront_CreateSaasResources_section.md)
  + [刪除簽署資源](cloudfront_example_cloudfront_DeleteSigningResources_section.md)
  + [開始使用基本 CloudFront 分佈](cloudfront_example_cloudfront_GettingStarted_section.md)
  + [WAF 入門](cloudfront_example_wafv2_GettingStarted_052_section.md)
  + [簽署 URL 和 Cookie](cloudfront_example_cloudfront_CloudFrontUtilities_section.md)
+ [CloudFront Functions 範例](cloudfront_code_examples_cloudfront_functions_examples.md)
  + [新增 HTTP 安全標頭](cloudfront_example_cloudfront_functions_add_security_headers_section.md)
  + [新增 CORS 標頭](cloudfront_example_cloudfront_functions_add_cors_header_section.md)
  + [新增快取控制標頭](cloudfront_example_cloudfront_functions_add_cache_control_header_section.md)
  + [新增真正的用戶端 IP 標頭](cloudfront_example_cloudfront_functions_add_true_client_ip_header_section.md)
  + [新增原始伺服器標頭](cloudfront_example_cloudfront_functions_add_origin_header_section.md)
  + [將 index.html 新增至請求 URL](cloudfront_example_cloudfront_functions_url_rewrite_single_page_apps_section.md)
  + [標準化查詢字串參數](cloudfront_example_cloudfront_functions_normalize_query_string_parameters_section.md)
  + [重新導向到新 URL](cloudfront_example_cloudfront_functions_redirect_based_on_country_section.md)
  + [重寫請求 URI](cloudfront_example_cloudfront_functions_kvs_conditional_read_section.md)
  + [選取更接近瀏覽者的原始伺服器](cloudfront_example_cloudfront_functions_select_origin_based_on_country_section.md)
  + [使用鍵值對](cloudfront_example_cloudfront_functions_kvs_key_value_pairs_section.md)
  + [驗證簡易字符](cloudfront_example_cloudfront_functions_kvs_jwt_verify_section.md)