AWS code-library documentation change
Summary
Removed the entire 'Get started' section containing code examples for listing DynamoDB tables in .NET, C++, Java, JavaScript, Python, and Ruby
Security assessment
The removed content consisted of introductory code examples demonstrating basic DynamoDB table listing operations. There's no evidence of security vulnerabilities being addressed, no security-related code patterns (like authentication or encryption), and no references to security incidents. The change appears to be routine documentation cleanup.
Diff
diff --git a/code-library/latest/ug/dynamodb_code_examples.md b/code-library/latest/ug/dynamodb_code_examples.md index 3d594f7cb..5f199cb48 100644 --- a//code-library/latest/ug/dynamodb_code_examples.md +++ b//code-library/latest/ug/dynamodb_code_examples.md @@ -32,419 +31,0 @@ _AWS community contributions_ are examples that were created and are maintained -**Get started** - -The following code examples show how to get started using DynamoDB. - -.NET - - -**SDK for .NET (v4)** - - -###### Note - -There's more on GitHub. Find the complete example and learn how to set up and run in the [AWS Code Examples Repository](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/dotnetv4/DynamoDB#code-examples). - - - using Amazon.DynamoDBv2; - using Amazon.DynamoDBv2.Model; - using Microsoft.Extensions.DependencyInjection; - - namespace DynamoDBActions; - - /// <summary> - /// A simple example that demonstrates basic DynamoDB operations. - /// </summary> - public class HelloDynamoDB - { - /// <summary> - /// HelloDynamoDB lists the existing DynamoDB tables for the default user. - /// </summary> - /// <param name="args">Command line arguments</param> - /// <returns>Async task.</returns> - static async Task Main(string[] args) - { - // Set up dependency injection for Amazon DynamoDB. - using var host = Microsoft.Extensions.Hosting.Host.CreateDefaultBuilder(args) - .ConfigureServices((_, services) => - services.AddAWSService<IAmazonDynamoDB>() - ) - .Build(); - - // Now the client is available for injection. - var dynamoDbClient = host.Services.GetRequiredService<IAmazonDynamoDB>(); - - try - { - var request = new ListTablesRequest(); - var tableNames = new List<string>(); - - var paginatorForTables = dynamoDbClient.Paginators.ListTables(request); - - await foreach (var tableName in paginatorForTables.TableNames) - { - tableNames.Add(tableName); - } - - Console.WriteLine("Welcome to the DynamoDB Hello Service example. " + - "\nLet's list your DynamoDB tables:"); - tableNames.ForEach(table => - { - Console.WriteLine($"Table: {table}"); - }); - } - catch (AmazonDynamoDBException ex) - { - Console.WriteLine($"An Amazon DynamoDB service error occurred while listing tables. {ex.Message}"); - } - catch (Exception ex) - { - Console.WriteLine($"An error occurred while listing tables. {ex.Message}"); - } - } - } - - - - - * For API details, see [ListTables](https://docs.aws.amazon.com/goto/DotNetSDKV4/dynamodb-2012-08-10/ListTables) in _AWS SDK for .NET API Reference_. - - - - -C++ - - -**SDK for C++** - - -###### Note - -There's more on GitHub. Find the complete example and learn how to set up and run in the [AWS Code Examples Repository](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/cpp/example_code/dynamodb/hello_dynamodb#code-examples). - -Code for the CMakeLists.txt CMake file. - - - # Set the minimum required version of CMake for this project. - cmake_minimum_required(VERSION 3.13) - - # Set the AWS service components used by this project. - set(SERVICE_COMPONENTS dynamodb) - - # Set this project's name. - project("hello_dynamodb") - - # Set the C++ standard to use to build this target. - # At least C++ 11 is required for the AWS SDK for C++. - set(CMAKE_CXX_STANDARD 11) - - # Use the MSVC variable to determine if this is a Windows build. - set(WINDOWS_BUILD ${MSVC}) - - if (WINDOWS_BUILD) # Set the location where CMake can find the installed libraries for the AWS SDK. - string(REPLACE ";" "/aws-cpp-sdk-all;" SYSTEM_MODULE_PATH "${CMAKE_SYSTEM_PREFIX_PATH}/aws-cpp-sdk-all") - list(APPEND CMAKE_PREFIX_PATH ${SYSTEM_MODULE_PATH}) - endif () - - # Find the AWS SDK for C++ package. - find_package(AWSSDK REQUIRED COMPONENTS ${SERVICE_COMPONENTS}) - - if (WINDOWS_BUILD AND AWSSDK_INSTALL_AS_SHARED_LIBS) - # Copy relevant AWS SDK for C++ libraries into the current binary directory for running and debugging. - - # set(BIN_SUB_DIR "/Debug") # if you are building from the command line you may need to uncomment this - # and set the proper subdirectory to the executables' location. - - AWSSDK_CPY_DYN_LIBS(SERVICE_COMPONENTS "" ${CMAKE_CURRENT_BINARY_DIR}${BIN_SUB_DIR}) - endif () - - add_executable(${PROJECT_NAME} - hello_dynamodb.cpp) - - target_link_libraries(${PROJECT_NAME} - ${AWSSDK_LINK_LIBRARIES}) - - - -Code for the hello_dynamodb.cpp source file. - - - #include <aws/core/Aws.h> - #include <aws/dynamodb/DynamoDBClient.h> - #include <aws/dynamodb/model/ListTablesRequest.h> - #include <iostream> - - /* - * A "Hello DynamoDB" starter application which initializes an Amazon DynamoDB (DynamoDB) client and lists the - * DynamoDB tables. - * - * main function - * - * Usage: 'hello_dynamodb' - * - */ - - int main(int argc, char **argv) { - Aws::SDKOptions options; - // Optionally change the log level for debugging. - // options.loggingOptions.logLevel = Utils::Logging::LogLevel::Debug; - Aws::InitAPI(options); // Should only be called once. - - int result = 0; - { - Aws::Client::ClientConfiguration clientConfig; - // Optional: Set to the AWS Region (overrides config file). - // clientConfig.region = "us-east-1"; - - Aws::DynamoDB::DynamoDBClient dynamodbClient(clientConfig); - Aws::DynamoDB::Model::ListTablesRequest listTablesRequest; - listTablesRequest.SetLimit(50); - do { - const Aws::DynamoDB::Model::ListTablesOutcome &outcome = dynamodbClient.ListTables( - listTablesRequest); - if (!outcome.IsSuccess()) { - std::cout << "Error: " << outcome.GetError().GetMessage() << std::endl; - result = 1; - break; - } - - for (const auto &tableName: outcome.GetResult().GetTableNames()) { - std::cout << tableName << std::endl; - } - - listTablesRequest.SetExclusiveStartTableName( - outcome.GetResult().GetLastEvaluatedTableName()); - - } while (!listTablesRequest.GetExclusiveStartTableName().empty()); - } - - - Aws::ShutdownAPI(options); // Should only be called once. - return result; - } - - - - * For API details, see [ListTables](https://docs.aws.amazon.com/goto/SdkForCpp/dynamodb-2012-08-10/ListTables) in _AWS SDK for C++ API Reference_.