MCPcopy Index your code
hub / github.com/awsdocs/aws-doc-sdk-examples

github.com/awsdocs/aws-doc-sdk-examples @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
16,056 symbols 58,318 edges 4,410 files 4,468 documented · 28% updated 11d ago★ 10,430144 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

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 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:

  • Be aware of the resources that these examples create or delete.
  • Be aware of the costs that might be charged to your account as a result.
  • Back up your important data.

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: - Clarity - Relevance - Feasibility

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

Extension points exported contracts — how you extend this code

IPausable (Interface)
IPausable defines the interface for pausable objects. [17 implementers]
gov2/demotools/pause.go
IScenarioTest (Interface)
IScenarioTest defines callback functions that an individual scenario test must implement. SetupDataAndStubs sets up tes [20 …
gov2/testtools/scenarios.go
UserRepository (Interface)
(no doc) [4 implementers]
javascriptv3/example_code/cross-services/wkflw-pools-triggers/cdk/lib/user-repository.ts
IMovieSampler (Interface)
snippet-end:[gov2.dynamodb.Movie.struct] IMovieSampler defines an interface that can be used to download sample movie da [2 …
gov2/dynamodb/actions/movie.go
IHttpRequester (Interface)
snippet-end:[gov2.s3.Scenario_Presigning.imports] snippet-start:[gov2.s3.IHttpRequester.helper] IHttpRequester abstracts [2 …
gov2/s3/scenarios/scenario_presigning.go
CFDistributionAPI (Interface)
CFDistributionAPI defines the interface for the CreateDistribution function. We use this interface to test the function [2 …
gov2/cloudfront/CreateDistribution/CreateDistribution.go
StreamTranscriptionBehavior (Interface)
Defines how a stream response should be handled. You should build a class implementing this interface to define the beha [2 …
javav2/example_code/transcribe-streaming/src/main/java/com/amazonaws/transcribestreaming/StreamTranscriptionBehavior.java
RecommendationsInterface (Interface)
(no doc) [4 implementers]
javav2/usecases/create_amazon_personalize_app/src/main/java/com/amazonaws/personalize/client/demo/movielens/RecommendationsInterface.java

Core symbols most depended-on inside this repo

String
called by 1704
gov2/dynamodb/actions/movie.go
log
called by 1401
javascriptv3/example_code/libs/logger.js
join
called by 878
python/example_code/deeplens/deeplens_inference_lambda.py
_stub_bifurcator
called by 686
python/test_tools/example_stubber.py
close
called by 622
javav2/example_code/transcribe-streaming/src/main/java/com/amazonaws/transcribestreaming/TranscribeStreamingRetryClient.java
add
called by 617
python/test_tools/fixtures/common.py
get
called by 556
javav2/example_code/transcribe-streaming/src/main/java/com/amazonaws/transcribestreaming/Microphone.java
add
called by 500
javav2/usecases/creating_sns_async/src/main/java/com/spring/sns/SubController.java

Shape

Method 8,820
Function 4,384
Class 2,340
Struct 318
Route 108
Interface 77
Enum 5
TypeAlias 3
FuncType 1

Languages

Java47%
Python27%
Go14%
TypeScript12%

Modules by API surface

javascriptv3/example_code/medical-imaging/scenarios/health-image-sets/pixel-data-verification/openjphjs/openjphjs.js169 symbols
java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/datamodeling/DynamoDBMapperQueryScanExample.java76 symbols
python/test_tools/iam_stubber.py58 symbols
java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/datamodeling/DynamoDBMapperBatchWriteExample.java56 symbols
javav2/example_code/cloudwatch/src/test/java/CloudWatchTest.java41 symbols
python/test_tools/ec2_stubber.py39 symbols
python/example_code/sesv2/newsletter_scenario/test/newsletter_test.py38 symbols
javav2/example_code/cognito/src/test/java/AmazonCognitoTest.java37 symbols
python/test_tools/bedrock_agent_stubber.py36 symbols
javav2/example_code/rekognition/src/test/java/RekognitionTest.java36 symbols
java/example_code/dynamodb/src/main/java/com/amazonaws/codesamples/datamodeling/DynamoDBMapperTransactionExample.java36 symbols
javav2/example_code/pinpoint/src/test/java/AmazonPinpointTest.java34 symbols

Datastores touched

(mysql)Database · 1 repos
devDatabase · 1 repos
test-databaseDatabase · 1 repos

For agents

$ claude mcp add aws-doc-sdk-examples \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact