aws-doc-sdk-examples README

The project's README from github.com/awsdocs/aws-doc-sdk-examples. As one markdown file: README.md.

Build Status GitHub Super-Linter []

AWS SDK Code Examples

This repository contains code examples that demonstrate how to use the AWS SDKs to interact with AWS services.

Many examples are injected into the AWS Documentation.

How this repository is organized

Code examples for each language's SDK can be found within the following subdirectories. The examples here demonstrate the most common uses of the SDK for each language.

SDK folder SDK version
.NET dotnetv3/ 3.5+
.NET dotnet/ <3.5
C++ cpp/ 1
Go gov2/ 2
Go go/ 1
Java javav2/ 2
Java java/ 1
JavaScript javascriptv3/ 3
JavaScript javascript/ 2
Kotlin kotlin/ 1
PHP php/ 3
Python pythonv1/ 1
Python python/ 3
Ruby ruby/ 3
Rust rustv1/ 1
Swift swift/ preview

Within each directory, you will find SDK-specific instructions for understanding and invoking example code.

NOTE

In alignment with our SDKs and Tools Maintenance Policy, the AWS SDK for Java v1.x will enter maintenance mode on July 31, 2024, and reach end-of-support on December 31, 2025.

For more information, see Announcing end-of-support for AWS SDK for Java v1.x.

Additional directories

directory purpose usage
/applications Contains the non-language-specific components of example applications, which show how the SDKs can be used in the context of a production-like application. To view the language-specific components for each example application, see the cross-service folder in the sub-directory for your desired language (such as python/cross-service).
/test Contains all components supporting the custom test automation framework used to routinely test the code in this repository. Deploys to AWS as a polyglot container-based integration testing solution. WARNING: Still under active construction as of 2023.
/resources Contains shared components used by many code examples across this repository. Deploys as frontend (/clients) or backend (/cdk or /cfn) components.

Invoke example code

To invoke this example code, you must have an AWS account. For more information about creating an account, see AWS Free Tier.

You must also have AWS credentials configured. For steps on using the AWS Command Line Interface (AWS CLI) to configure credentials, see CLI Configuration basics

⚠️ Usage disclaimer

These code examples interact with services that may incur charges to your AWS account. For more information, see AWS Pricing.

Additionally, example code might theoretically modify or delete existing AWS resources. As a matter of due diligence, do the following:

Contributing

This repository thrives on your contributions! ❤️ To get involved, see the CONTRIBUTING.md. 🙏

Requests

Requests for examples can be made via Issue tracker.

How we prioritize contributions and requests

Our team reviews all requests, evaluating them for the following:

All examples requests should be made as early as possible. For larger examples, this should be at least two months in advance of the required date.

Based on the evaluation, we determine the priority of each request and allocate resources accordingly. We prioritize requests that are clear, relevant, and can be completed in a reasonable amount of time. An accompanying high quality PR increases the chance we can address the request.

Please note that some requests, such as bug fixes and security issues, take priority over new code examples. Additionally, we have finite resources and our own priorities that guide the development of code examples. If you have any questions or would like to contribute, please refer to our contribution guide.

Tributaries

The AWS Documentation includes source code examples from several additional sources. These sources are called tributaries, flowing into the "river" of AWS Documentation.

Copyright and license

All content in this repository, unless otherwise stated, is Copyright © Amazon Web Services, Inc. or its affiliates. All rights reserved.

Except where otherwise noted, all examples in this collection are licensed under the Apache license, version 2.0 (the "License"). The full license text is provided in the LICENSE file accompanying this repository.

Please include the following licensing text as a comment at top of all possible files:

Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0

aws-doc-sdk-examples (awsdocs/aws-doc-sdk-examples)

Searching Database…

这是什么?这是 AWS 官方的代码示例仓库,演示如何使用 AWS SDK 操作 AWS 服务。其中很多示例被直接注入到 AWS 官方文档和 SDK 开发指南中。
这是一大堆代码片段堆在一起,还是有条理地组织好的?它按语言的 SDK 分成不同的子目录,并用一个 README 表格把每个文件夹和对应的 SDK 版本一一对应:python/ 放的是 SDK 3 的示例,javav2/ 是 Java SDK 2,还有 javascriptv3/、dotnetv3/、gov2/、ruby/ 等等。
我具体该怎么运行其中的一个示例?打开对应语言的文件夹,比如 python/ 或 javascriptv3/,按照里面针对该 SDK 的说明来运行示例代码。
运行这些示例需要 AWS 账号吗?需要——要有 AWS 账号(刚开始用免费套餐就够了),还要配置好访问凭证,README 建议用 AWS CLI 来完成配置。
运行这些示例会花钱吗?会不会动到我已有的资源?两者都有可能:这些代码调用的是真实的 AWS 服务,可能产生费用;示例理论上也可能修改或删除你已有的资源。README 建议先弄清每个示例会创建或删除什么,并备份重要数据。
这是给谁用的——正在学 AWS 的人,还是需要快速查参考的开发者?两者都适合:每个示例都演示了对应语言 SDK 最常见的用法,所以这个仓库既能当学习路径,也能当可以直接复制的参考资料。
我可以把这些代码复制到自己的项目里吗?可以,遵循 Apache License 2.0,前提是在你复用的任何文件顶部保留带有 SPDX-License-Identifier 的版权注释。
这个仓库覆盖哪些编程语言?.NET、C++、Go、Java、JavaScript、Kotlin、PHP、Python、Ruby、Rust 和 Swift 各自有独立的文件夹,README 里的表格标明了每个文件夹对应的 SDK 版本。
里面有完整的示例应用吗,还是只有小的代码片段?两者都有:/applications 文件夹里是接近生产环境的示例应用,它们针对各语言的部分则放在每个语言的跨服务文件夹里,比如 python/cross-service。
这里面的内容都还是最新的吗?要留意那些旧版文件夹:老的 SDK 版本有各自的目录(dotnet/、go/、javascript/、pythonv1/),而且 Java v1 的示例已于 2025 年 12 月 31 日停止支持。优先使用 v2/v3 的文件夹。
这些示例代码真的经过测试吗?是的——/test 下有一套自研的自动化测试框架,会定期把示例部署到 AWS 上进行验证,这是一个支持多语言、基于容器的集成测试环境;不过 README 也提到,2023 年时这套框架仍在积极建设当中。
Creator
awsdocs
Size
266 MB
Stars
10.5K
Updated
CommitOct 15
Age
10y
Commits · 90 Days