

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

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

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

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

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

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

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

**Contents**
+ [基本概念](sts_code_examples_basics.md)
  + [動作](sts_code_examples_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)
+ [案例](sts_code_examples_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)