AWS code-library documentation change
Summary
Removed the entire 'Get started' section and all associated code examples demonstrating how to list Lambda functions across multiple programming languages (.NET, C++, Go, Java, JavaScript, Python, Ruby).
Security assessment
The change removes general code examples for listing Lambda functions without any reference to security vulnerabilities, weaknesses, or incidents. The deleted content was introductory material showing basic API usage, with no security-specific context or handling of sensitive operations like access control or credential management.
Diff
diff --git a/code-library/latest/ug/lambda_code_examples.md b/code-library/latest/ug/lambda_code_examples.md index 6336b15aa..122bdf250 100644 --- a//code-library/latest/ug/lambda_code_examples.md +++ b//code-library/latest/ug/lambda_code_examples.md @@ -32,404 +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 Lambda. - -.NET - - -**SDK for .NET** - - -###### 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/dotnetv3/Lambda#code-examples). - - - namespace LambdaActions; - - using Amazon.Lambda; - - public class HelloLambda - { - static async Task Main(string[] args) - { - var lambdaClient = new AmazonLambdaClient(); - - Console.WriteLine("Hello AWS Lambda"); - Console.WriteLine("Let's get started with AWS Lambda by listing your existing Lambda functions:"); - - var response = await lambdaClient.ListFunctionsAsync(); - response.Functions.ForEach(function => - { - Console.WriteLine($"{function.FunctionName}\t{function.Description}"); - }); - } - } - - - - - * For API details, see [ListFunctions](https://docs.aws.amazon.com/goto/DotNetSDKV3/lambda-2015-03-31/ListFunctions) 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/lambda/hello_lambda#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 lambda) - - # Set this project's name. - project("hello_lambda") - - # 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_lambda.cpp) - - target_link_libraries(${PROJECT_NAME} - ${AWSSDK_LINK_LIBRARIES}) - - - -Code for the hello_lambda.cpp source file. - - - #include <aws/core/Aws.h> - #include <aws/lambda/LambdaClient.h> - #include <aws/lambda/model/ListFunctionsRequest.h> - #include <iostream> - - /* - * A "Hello Lambda" starter application which initializes an AWS Lambda (Lambda) client and lists the Lambda functions. - * - * main function - * - * Usage: 'hello_lambda' - * - */ - - 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::Lambda::LambdaClient lambdaClient(clientConfig); - std::vector<Aws::String> functions; - Aws::String marker; // Used for pagination. - - do { - Aws::Lambda::Model::ListFunctionsRequest request; - if (!marker.empty()) { - request.SetMarker(marker); - } - - Aws::Lambda::Model::ListFunctionsOutcome outcome = lambdaClient.ListFunctions( - request); - - if (outcome.IsSuccess()) { - const Aws::Lambda::Model::ListFunctionsResult &listFunctionsResult = outcome.GetResult(); - std::cout << listFunctionsResult.GetFunctions().size() - << " lambda functions were retrieved." << std::endl; - - for (const Aws::Lambda::Model::FunctionConfiguration &functionConfiguration: listFunctionsResult.GetFunctions()) { - functions.push_back(functionConfiguration.GetFunctionName()); - std::cout << functions.size() << " " - << functionConfiguration.GetDescription() << std::endl; - std::cout << " " - << Aws::Lambda::Model::RuntimeMapper::GetNameForRuntime( - functionConfiguration.GetRuntime()) << ": " - << functionConfiguration.GetHandler() - << std::endl; - } - marker = listFunctionsResult.GetNextMarker(); - } else { - std::cerr << "Error with Lambda::ListFunctions. " - << outcome.GetError().GetMessage() - << std::endl; - result = 1; - break; - } - } while (!marker.empty()); - } - - - Aws::ShutdownAPI(options); // Should only be called once. - return result; - } - - - - * For API details, see [ListFunctions](https://docs.aws.amazon.com/goto/SdkForCpp/lambda-2015-03-31/ListFunctions) in _AWS SDK for C++ API Reference_. - - - - -Go - - -**SDK for Go V2** - - -###### 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/gov2/lambda#code-examples). - - - package main - - import ( - "context" - "fmt" - - "github.com/aws/aws-sdk-go-v2/aws"