

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

# AWS STS 使用 AWS SDKs程式碼範例
<a name="service_code_examples_sts"></a>

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

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

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

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

**Contents**
+ [基本概念](service_code_examples_sts_basics.md)
  + [動作](service_code_examples_sts_actions.md)
    + [`AssumeRole`](sts_example_sts_AssumeRole_section.md)
    + [`AssumeRoleWithWebIdentity`](sts_example_sts_AssumeRoleWithWebIdentity_section.md)
    + [`DecodeAuthorizationMessage`](sts_example_sts_DecodeAuthorizationMessage_section.md)
    + [`GetFederationToken`](sts_example_sts_GetFederationToken_section.md)
    + [`GetSessionToken`](sts_example_sts_GetSessionToken_section.md)
+ [案例](service_code_examples_sts_scenarios.md)
  + [擔任需要 MFA 字符的 IAM 角色](sts_example_sts_Scenario_AssumeRoleMfa_section.md)
  + [設定 Amazon ECS Service Connect](sts_example_ecs_ServiceConnect_085_section.md)
  + [為聯合身分使用者建構 URL](sts_example_sts_Scenario_ConstructFederatedUrl_section.md)
  + [使用 Lambda 代理整合建立 REST API](sts_example_api_gateway_GettingStarted_087_section.md)
  + [為 Fargate 啟動類型建立 Amazon ECS Linux 任務](sts_example_ecs_GettingStarted_086_section.md)
  + [使用函數名稱做為變數建立 CloudWatch 儀表板](sts_example_cloudwatch_GettingStarted_031_section.md)
  + [為 EC2 啟動類型建立 Amazon ECS 服務](sts_example_ecs_GettingStarted_018_section.md)
  + [建立 Amazon Managed Grafana 工作區](sts_example_iam_GettingStarted_044_section.md)
  + [獲取需要 MFA 字符的工作階段字符](sts_example_sts_Scenario_SessionTokenMfa_section.md)
  + [Amazon ECR 入門](sts_example_ecr_GettingStarted_078_section.md)
  + [Amazon EKS 入門](sts_example_eks_GettingStarted_034_section.md)
  + [Amazon MSK 入門](sts_example_ec2_GettingStarted_057_section.md)
  + [Amazon OpenSearch Service 入門](sts_example_opensearch_GettingStarted_016_section.md)
  + [Amazon SageMaker Feature Store 入門](sts_example_iam_GettingStarted_028_section.md)
  + [Config 入門](sts_example_config_service_GettingStarted_053_section.md)
  + [終端使用者傳訊推送入門](sts_example_pinpoint_GettingStarted_049_section.md)
  + [IoT Core 入門](sts_example_iot_GettingStarted_063_section.md)
  + [WAF 入門](sts_example_wafv2_GettingStarted_052_section.md)
  + [將硬式編碼秘密移至 Secrets Manager](sts_example_secrets_manager_GettingStarted_073_section.md)
  + [使用 FIS 在 EC2 執行個體上執行 CPU 壓力測試](sts_example_iam_GettingStarted_069_section.md)
  + [設定 Systems Manager](sts_example_iam_GettingStarted_046_section.md)