aws-doc-sdk-examples/

directory
v0.0.0-...-2d06ee9 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2021 License: CC-BY-4.0, 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.
Welcome
=======
This is the repository for code examples used in the public 
`AWS documentation <https://docs.aws.amazon.com>`_. The examples use the AWS SDKs for the supported programming languages. 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 programming language. For example, all of the code examples for the V1 version of the
`AWS SDK for Java Developer Guide <https://www.github.com/awsdocs/aws-java-developer-guide>`_ are
kept in the `java <java>`_ directory (the V2 versions are in the `java2 <java2>`_ directory).

You can also try using the preview of our `use case index of examples <code-index.md>`_ (and let us
know what you think about it).

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 abbreviation (**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>`_.

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

From time to time, the AWS documentation team will select some of these proposals to begin working on.
To view their decisions, see the `code examples roadmap <https://github.com/awsdocs/aws-doc-sdk-examples/projects/2>`_. 
If you feel strongly about wanting to accelerate the timeline of a particular proposal or expand or focus the scope of a 
particular proposal, be sure to +1 the related issue, add comments to it, or both,
and the team will consider it. 

The AWS documentation team typically moves accepted proposals in the roadmp from the **Wish List** 
stage to the **Backlog** stage, then to **In Progress**, and finally to **Recently 
Completed**. The **Wish List** represents proposals that the team *might* begin working
on sometime in the future, but with no expected timeline. The **Backlog** stage represents 
proposals that the team will *likely* begin working on soon. To view the team's progress, see the 
`code examples roadmap <https://github.com/awsdocs/aws-doc-sdk-examples/projects/2>`_.

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>`_. 

* **Make sure that the code you want to contribute builds and runs**. There's nothing more frustrating in developer
  documentation than code examples that don't work. Build the code and test it before submitting it!

* **Don't include personal account data, keys, or IDs in your examples**. Code should obtain access
  keys from the standard SDK credentials and config files, use environment variables or external
  data files, or query the user for this information.

* **Format code lines to 80 characters**. Long lines can be enclosed in a scrollable box for HTML,
  but in a PDF build, long lines often spill off the side of the page, making the code
  unreadable. If your code includes long text strings, consider breaking these into smaller chunks
  and concatenating them.

* **Use short(er) variable names**. To aid in readability and to help keep line length to 80 characters, use
  *short yet descriptive* names for variables. Do *not* mimic class names when creating
  variables that represent an object of that class. It nearly always results in excessively long
  variable names, making it difficult to keep code lines to 80 characters.

* **Use spaces, not tabs, for indentation**. Tabs are variable length in most editors, but will
  usually render as 8 characters wide in printed documentation. *Always use spaces* to ensure
  consistent formatting in printed code.

  You can ignore this rule for makefiles, which might *require* the use of tabs. But these are
  typically used only for building examples, and aren't  included in documentation.

* **Minimize the use of comments**. Code is ignored for translation, so comments in code aren't
  translated for the printed documentation's target language. Comments aren't needed in most
  code used for documentation, because the goal is clarity and ease of understanding. By making code
  self-explanatory, you make better code for documentation and reduce the need to add comments.

* **Place comments on separate lines from code**. If you *must* add a comment for explanation or any
  other reason, make sure that it's placed on a separate line from code (*not* inline). This
  allows readers of the source file to read the comment, yet it can be stripped out when including
  snippets from the file within documentation.

* **All code must be submitted under the Apache 2.0 license**, as noted in the following **Copyright
  and License** section.

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/CreateCustomMetric command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
cloudwatch/CreateRole command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
cloudwatch/CreateRule command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
cloudwatch/CreateTarget command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
cloudwatch/DeleteAlarm command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
cloudwatch/DescribeAlarms command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
cloudwatch/DisableAlarm command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
cloudwatch/EnableAlarm command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
cloudwatch/GetLogEvents command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
cloudwatch/Lambda command
snippet-start:[cloudwatch.go.lambda_main]
snippet-start:[cloudwatch.go.lambda_main]
cloudwatch/ListMetrics command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
cloudwatch/SendEvent command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
cloudwatch/UploadLambdaFunction command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
ec2/CreateImage command
example_code/cloudformation command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
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/s3/delete-buckets-by-prefix command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
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/CreateCMK 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
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
s3/CreateBucket command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
s3/CreateBucketAndObject command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
s3/CustomClient command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
s3/DeleteBucket command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
s3/DeleteBucketPolicy command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
s3/DeleteBucketWebsite command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
s3/DeleteObject command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
s3/DeleteObjects command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
s3/DownloadObject command
snippet-start:[s3.go.download_object]
snippet-start:[s3.go.download_object]
s3/EncryptOnServerWithKms command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
s3/EnforceMD5 command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
s3/GeneratePresignedURL command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
s3/GeneratePresignedURLSpecificPayload command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
s3/GetBucketAcl command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
s3/GetBucketPolicy command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
s3/GetBucketWebsite command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
s3/GetObjectAcl command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
s3/ListBuckets command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
s3/ListObjects command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
s3/MakeBucketPublic command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
s3/PutBucketAcl command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
s3/PutObjectAcl command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
s3/PutObjectWithSetters command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
s3/RequireServerEncryption command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
s3/RestoreObject command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
s3/SetBucketPolicy command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
s3/SetBucketWebsite command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
s3/SetCors command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
s3/SetDefaultEncryption command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
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
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
ses/SendMessage command
sns/MakeTopic command
sns/ShowTopics command
sqs/ChangeMsgVisibility command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
sqs/ConfigureLPQueue command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
sqs/CreateLPQueue command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
sqs/CreateQueue command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
sqs/DeadLetterQueue command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
sqs/DeleteMessage command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
sqs/DeleteQueue command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
sqs/GetQueueURL command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
sqs/ListQueues command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
sqs/ReceiveLPMessage command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
sqs/ReceiveMessage command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
sqs/SendMessage command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
sqs/SendReceiveLongPolling command
Copyright Amazon.com, Inc.
Copyright Amazon.com, Inc.
sts/TakeRole command

Jump to

Keyboard shortcuts

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