

文档 AWS SDK 示例 GitHub 存储库中还有更多 [S AWS DK 示例](https://github.com/awsdocs/aws-doc-sdk-examples)。

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 使用 Amazon ECS 的代码示例 AWS SDKs
<a name="ecs_code_examples"></a>

以下代码示例向您展示了如何使用带有 AWS 软件开发套件 (SDK) 的 Amazon 弹性容器服务。

*操作*是大型程序的代码摘录，必须在上下文中运行。您可以通过操作了解如何调用单个服务函数，还可以通过函数相关场景的上下文查看操作。

*场景*是向您展示如何通过在一个服务中调用多个函数或与其他 AWS 服务服务结合来完成特定任务的代码示例。

**更多资源**
+  **[Amazon ECS 开发人员指南](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/Welcome.html)**——有关 Amazon ECS 的更多信息。
+ **[Amazon ECS API 参考](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/Welcome.html)**——有关所有可用的 Amazon ECS 操作的详细信息。
+ **[AWS 开发者中心](https://aws.amazon.com/developer/code-examples/?awsf.sdk-code-examples-product=product%23elastic-container-service)** — 您可以按类别或全文搜索筛选的代码示例。
+ **[AWS SDK 示例](https://github.com/awsdocs/aws-doc-sdk-examples)** — 包含首选语言完整代码的 GitHub 存储库。包括有关设置和运行代码的说明。

**Contents**
+ [基本功能](ecs_code_examples_basics.md)
  + [Hello Amazon ECS](ecs_example_ecs_Hello_section.md)
  + [操作](ecs_code_examples_actions.md)
    + [`CreateCluster`](ecs_example_ecs_CreateCluster_section.md)
    + [`CreateService`](ecs_example_ecs_CreateService_section.md)
    + [`DeleteCluster`](ecs_example_ecs_DeleteCluster_section.md)
    + [`DeleteService`](ecs_example_ecs_DeleteService_section.md)
    + [`DescribeClusters`](ecs_example_ecs_DescribeClusters_section.md)
    + [`DescribeServices`](ecs_example_ecs_DescribeServices_section.md)
    + [`DescribeTasks`](ecs_example_ecs_DescribeTasks_section.md)
    + [`ListClusters`](ecs_example_ecs_ListClusters_section.md)
    + [`ListServices`](ecs_example_ecs_ListServices_section.md)
    + [`ListTasks`](ecs_example_ecs_ListTasks_section.md)
    + [`UpdateClusterSettings`](ecs_example_ecs_UpdateClusterSettings_section.md)
    + [`UpdateService`](ecs_example_ecs_UpdateService_section.md)
+ [场景](ecs_code_examples_scenarios.md)
  + [配置 Amazon ECS Service Connect](ecs_example_ecs_ServiceConnect_085_section.md)
  + [创建 Fargate 启动类型的 Amazon ECS Linux 任务](ecs_example_ecs_GettingStarted_086_section.md)
  + [创建 EC2 启动类型的 Amazon ECS 服务](ecs_example_ecs_GettingStarted_018_section.md)
  + [获取集群、服务和任务的 ARN 信息](ecs_example_ecs_Scenario_GetClustersServicesAndTasks_section.md)