

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

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

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

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

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

如需 AWS SDK 開發人員指南和程式碼範例的完整清單，請參閱 [搭配 AWS SDK 使用 CloudFront](sdk-general-information-section.md)。此主題也包含有關入門的資訊和舊版 SDK 的詳細資訊。

**Contents**
+ [基本概念](service_code_examples_basics.md)
  + [動作](service_code_examples_actions.md)
    + [`CreateDistribution`](example_cloudfront_CreateDistribution_section.md)
    + [`CreateFunction`](example_cloudfront_CreateFunction_section.md)
    + [`CreateInvalidation`](example_cloudfront_CreateInvalidation_section.md)
    + [`CreateKeyGroup`](example_cloudfront_CreateKeyGroup_section.md)
    + [`CreatePublicKey`](example_cloudfront_CreatePublicKey_section.md)
    + [`DeleteDistribution`](example_cloudfront_DeleteDistribution_section.md)
    + [`GetCloudFrontOriginAccessIdentity`](example_cloudfront_GetCloudFrontOriginAccessIdentity_section.md)
    + [`GetCloudFrontOriginAccessIdentityConfig`](example_cloudfront_GetCloudFrontOriginAccessIdentityConfig_section.md)
    + [`GetDistribution`](example_cloudfront_GetDistribution_section.md)
    + [`GetDistributionConfig`](example_cloudfront_GetDistributionConfig_section.md)
    + [`ListCloudFrontOriginAccessIdentities`](example_cloudfront_ListCloudFrontOriginAccessIdentities_section.md)
    + [`ListDistributions`](example_cloudfront_ListDistributions_section.md)
    + [`UpdateDistribution`](example_cloudfront_UpdateDistribution_section.md)
+ [案例](service_code_examples_scenarios.md)
  + [建立多租用戶分佈和分佈租用戶](example_cloudfront_CreateSaasResources_section.md)
  + [刪除簽署資源](example_cloudfront_DeleteSigningResources_section.md)
  + [開始使用基本 CloudFront 分佈](example_cloudfront_GettingStarted_section.md)
  + [WAF 入門](example_wafv2_GettingStarted_052_section.md)
  + [簽署 URL 和 Cookie](example_cloudfront_CloudFrontUtilities_section.md)
+ [CloudFront Functions 範例](service_code_examples_cloudfront_functions_examples.md)
  + [新增 HTTP 安全標頭](example_cloudfront_functions_add_security_headers_section.md)
  + [新增 CORS 標頭](example_cloudfront_functions_add_cors_header_section.md)
  + [新增快取控制標頭](example_cloudfront_functions_add_cache_control_header_section.md)
  + [新增真正的用戶端 IP 標頭](example_cloudfront_functions_add_true_client_ip_header_section.md)
  + [新增原始伺服器標頭](example_cloudfront_functions_add_origin_header_section.md)
  + [將 index.html 新增至請求 URL](example_cloudfront_functions_url_rewrite_single_page_apps_section.md)
  + [標準化查詢字串參數](example_cloudfront_functions_normalize_query_string_parameters_section.md)
  + [重新導向到新 URL](example_cloudfront_functions_redirect_based_on_country_section.md)
  + [重寫請求 URI](example_cloudfront_functions_kvs_conditional_read_section.md)
  + [選取更接近瀏覽者的原始伺服器](example_cloudfront_functions_select_origin_based_on_country_section.md)
  + [使用鍵值對](example_cloudfront_functions_kvs_key_value_pairs_section.md)
  + [驗證簡易字符](example_cloudfront_functions_kvs_jwt_verify_section.md)