aws-doc-sdk-examples

module
v0.0.0-...-f18a567 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 1, 2021 License: Apache-2.0

README

.. Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

   This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0
   International License (the "License"). You may not use this file except in compliance with the
   License. A copy of the License is located at http://creativecommons.org/licenses/by-nc-sa/4.0/.

   This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
   either express or implied. See the License for the specific language governing permissions and
   limitations under the License.

NOTICE
======

We have changed the default branch for this repo from **master** to **main**.

If the parent branch of your fork or branch is **master**,
the following instructions tell you how to change the parent branch to **main**.

To show the parent branch,
where **BRANCH** is the name of your branch:

1. Navigate to the root of your branch or fork.
2. Make sure your branch is the current branch (**git checkout BRANCH**).
3. Run **git branch --contains**.

Changing a branch parent branch from master to main
---------------------------------------------------

To change the parent branch for your branch to **main**,
navigate to the root of your branch and enter the following commands,
where *BRANCH* is the name of your branch:

.. code-block:: sh
		
   git branch -m master main
   git fetch origin
   git branch -u origin/main main
   git remote set-head origin -a
   git remote update --prune

Changing a fork parent branch from master to main
-------------------------------------------------

To change the parent branch for your branch to **main**:

1. Navigate to main web page of your fork.
2. You should see a "The default branch on the parent repository has been renamed" message.
3. Select the **branch settings** link.
4. Select the **base: main** branch.

Questions or Issues?
--------------------

If you have any questions, or run across any issue retargeting your branch or fork,
open an issue and give us as much detail as possible.

Welcome
=======
This is the repository for various code examples used in the public 
`AWS documentation <https://docs.aws.amazon.com>`_. For more information, see
`Tools to Build on AWS <https://aws.amazon.com/getting-started/tools-sdks/>`_.

Finding code examples
=====================

The code examples are organized by AWS SDK or AWS programming tool. For example, among the top-level folders:

* **cpp** for the latest version of the AWS SDK for C++ (version 1)
* **dotnetv3** for the latest version of the AWS SDK for .NET (version 3.5 and later)
* **gov2** for the latest version of the AWS SDK for Go (version 2)
* **javav2** for the latest version of the AWS SDK for Java (version 2)
* **javascriptv3** for the latest version of the AWS SDK for JavaScript (version 3)
* **php** for the latest version of the AWS SDK for PHP (version 3)
* **python** for the latest version of the AWS SDK for Python (Boto3)
* **ruby** for the latest version of the AWS SDK for Ruby (version 3)

We also have code examples for two SDKs currently in alpha,
**DO NOT USE THIS EXAMPLE CODE IN PRODUCTION**:

* **.kotlin_alpha** for the alpha version of the AWS SDK for Kotlin.
* **.rust_alpha** for the alpha version of the AWS SDK for Rust.

Code examples for older AWS SDK versions are archived in this repository but no longer maintained. These include:

* **dotnet** for versions of the AWS SDK for .NET prior to version 3.5
* **go** for AWS SDK for Go version 1
* **java** for AWS SDK for Java version 1
* **javascript** for AWS SDK for JavaScript version 2

As AWS SDK major version numbers increment, this repository will begin to more consistently reflect their version numbers among these folders to make these distinctions clearer. For example, if and when the AWS SDK for Ruby moves to a version 4, a new **rubyv4** folder will be added. Then when AWS officially announces that AWS SDK for Ruby version 3 has been deprecated, the **ruby** folder will be deleted.

Other top-level folders include:

* **aws-cli** for script examples for use with the AWS Command Line Interface (AWS CLI).
* **cloudformation** for example templates for use with AWS CloudFormation.
* **iam_policies** for example policy documents for use with AWS Identity and Access Management (IAM).
* **lambda_functions** for example function code for use with AWS Lambda.
* **typescript** for TypeScript-based code examples for use with the AWS Cloud Development Kit (CDK), and other AWS services. (For TypeScript-based code examples for use with the AWS SDK for JavaScript, see the **javascriptv3** folder.)

Note that the **scripts** folder contains scripts that the AWS documentation team uses internally to build the code examples into various AWS documentation sets.

Building and running code examples
==================================

Inside each language-specific directory, we include a **README** file that explains how to
build and run the examples in the directory.

The example code in the language-specific directories is organized by
the AWS service command in the `AWS Command Line Interface (AWS CLI) Command Reference <https://awscli.amazonaws.com/v2/documentation/api/latest/index.html>`_ (**s3** for `Amazon S3 <https://aws.amazon.com/s3>`_ examples, and so
on).

Proposing new code examples
===========================

To propose a new code example for the AWS documentation team to consider working on, `create a 
request <https://github.com/awsdocs/aws-doc-sdk-examples/issues/new?assignees=&labels=code+sample+request&template=request-new-code-example.md&title=%5BNEW+EXAMPLE+REQUEST%5D+%3C%3CProvide+a+title+for+this+proposal%3E%3E>`_.

Note that the AWS documentation team prefers to produce code examples that cover broader scenarios and use 
cases, versus simple code snippets that cover only individual API calls.

Submitting code examples for use in AWS documentation
=====================================================

If you plan to contribute examples for use in the documentation (the purpose of this repository),
read this section carefully so that we can work together effectively. 
For process instructions and additional guidance, see the `Guidelines for contributing <CONTRIBUTING.md>`_. 

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 <https://www.apache.org/licenses/LICENSE-2.0>`_ (the "License"). The full
license text is provided in the ``LICENSE`` file accompanying this repository.

Directories

Path Synopsis
go
cloudtrail command
cloudwatch/Lambda command
snippet-start:[cloudwatch.go.lambda_main]
snippet-start:[cloudwatch.go.lambda_main]
ec2/CreateImage command
example_code/cloudtrail command
snippet-comment:[These are tags for the AWS doc team's sample catalog.
snippet-comment:[These are tags for the AWS doc team's sample catalog.
example_code/cloudwatch command
snippet-comment:[These are tags for the AWS doc team's sample catalog.
snippet-comment:[These are tags for the AWS doc team's sample catalog.
example_code/cognito command
snippet-comment:[These are tags for the AWS doc team's sample catalog.
snippet-comment:[These are tags for the AWS doc team's sample catalog.
example_code/dynamodb command
snippet-comment:[These are tags for the AWS doc team's sample catalog.
snippet-comment:[These are tags for the AWS doc team's sample catalog.
example_code/ec2 command
snippet-comment:[These are tags for the AWS doc team's sample catalog.
snippet-comment:[These are tags for the AWS doc team's sample catalog.
example_code/extending_sdk command
snippet-comment:[These are tags for the AWS doc team's sample catalog.
snippet-comment:[These are tags for the AWS doc team's sample catalog.
example_code/extending_sdk/ecs command
snippet-comment:[These are tags for the AWS doc team's sample catalog.
snippet-comment:[These are tags for the AWS doc team's sample catalog.
example_code/glacier command
snippet-comment:[These are tags for the AWS doc team's sample catalog.
snippet-comment:[These are tags for the AWS doc team's sample catalog.
example_code/lambda command
snippet-comment:[These are tags for the AWS doc team's sample catalog.
snippet-comment:[These are tags for the AWS doc team's sample catalog.
example_code/rds command
snippet-comment:[These are tags for the AWS doc team's sample catalog.
snippet-comment:[These are tags for the AWS doc team's sample catalog.
example_code/s3 command
snippet-comment:[These are tags for the AWS doc team's sample catalog.
snippet-comment:[These are tags for the AWS doc team's sample catalog.
example_code/sns command
snippet-comment:[These are tags for the AWS doc team's sample catalog.
snippet-comment:[These are tags for the AWS doc team's sample catalog.
example_code/sqs command
snippet-comment:[These are tags for the AWS doc team's sample catalog.
snippet-comment:[These are tags for the AWS doc team's sample catalog.
example_code/sts command
snippet-comment:[These are tags for the AWS doc team's sample catalog.
snippet-comment:[These are tags for the AWS doc team's sample catalog.
example_code/workdocs command
snippet-comment:[These are tags for the AWS doc team's sample catalog.
snippet-comment:[These are tags for the AWS doc team's sample catalog.
iam/CreateUser command
iam/DeleteUser command
iam/GetPolicy command
iam/ListAdmins command
iam/ListUsers command
iam/UpdateUser command
kms/CreateKey command
kms/DecryptData command
kms/EncryptData command
s3/CRUD command
snippet-start:[s3.go.crud_ops]
snippet-start:[s3.go.crud_ops]
s3/CopyObject command
s3/CreateBucket command
s3/CustomClient command
s3/DeleteBucket command
s3/DeleteObject command
s3/DownloadObject command
snippet-start:[s3.go.download_object]
snippet-start:[s3.go.download_object]
s3/EnforceMD5 command
s3/GetBucketAcl command
s3/GetObjectAcl command
s3/ListBuckets command
s3/ListObjects command
s3/PutBucketAcl command
s3/PutObjectAcl command
s3/SetCors command
s3/TLS command
snippet-comment:[The snippet tags are for the AWS SDK for Go Developer Guide.
snippet-comment:[The snippet tags are for the AWS SDK for Go Developer Guide.
s3/UploadDirectory command
snippet-start:[s3.go.upload_directory]
snippet-start:[s3.go.upload_directory]
s3/UploadObject command
snippet-start:[s3.go.upload_object]
snippet-start:[s3.go.upload_object]
s3/UploadStream command
ses/SendMessage command
sns/MakeTopic command
sns/ShowTopics command
sqs/CreateQueue command
sqs/DeleteQueue command
sqs/GetQueueURL command
sqs/ListQueues command
sqs/SendMessage command
sts/TakeRole command
gov2 module
ec2/CreateImage command
iam/CreateUser command
iam/DeleteUser command
iam/GetPolicy command
iam/ListAdmins command
iam/ListUsers command
iam/UpdateUser command
kms/CreateKey command
kms/DecryptData command
kms/EncryptData command
s3/CopyObject command
s3/CreateBucket command
s3/DeleteBucket command
s3/DeleteObject command
s3/GetBucketAcl command
s3/GetObjectAcl command
s3/ListBuckets command
s3/ListObjects command
s3/PutObject command
sns/CreateTopic command
sns/ListTopics command
sns/Publish command
sns/Subscribe command
sqs/CreateQueue command
sqs/DeleteQueue command
sqs/GetQueueURL command
sqs/ListQueues command
sqs/SendMessage command
sts/AssumeRole command
bedrock module
demotools module
dynamodb module
iam module
lambda module
rds module
redshift module
s3 module
testtools module
resources

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL