AWS Security ChangesHomeSearch

AWS ec2 documentation change

Service: ec2 · 2026-01-10 · Documentation low

File: ec2/latest/devguide/service_code_examples.md

Summary

Removed the entire 'Get started' section and all code examples demonstrating how to describe security groups/instances across multiple programming languages (.NET, C++, Java, JavaScript, Kotlin, Python, Ruby, Rust, Swift).

Security assessment

The change removes general code examples for listing security groups/instances without any mention of security vulnerabilities, CVEs, or incident response. This appears to be routine documentation cleanup or restructuring rather than addressing a specific security issue.

Diff

diff --git a/ec2/latest/devguide/service_code_examples.md b/ec2/latest/devguide/service_code_examples.md
index a3c5cbdd3..b321bd6a1 100644
--- a//ec2/latest/devguide/service_code_examples.md
+++ b//ec2/latest/devguide/service_code_examples.md
@@ -17,717 +16,0 @@ For a complete list of AWS SDK developer guides and code examples, see [Create A
-**Get started**
-
-The following code examples show how to get started using Amazon EC2.
-
-.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/EC2#code-examples). 
-    
-    
-    namespace EC2Actions;
-    
-    public class HelloEc2
-    {
-        /// <summary>
-        /// HelloEc2 lists the existing security groups for the default users.
-        /// </summary>
-        /// <param name="args">Command line arguments</param>
-        /// <returns>Async task.</returns>
-        static async Task Main(string[] args)
-        {
-            // Set up dependency injection for Amazon Elastic Compute Cloud (Amazon EC2).
-            using var host = Microsoft.Extensions.Hosting.Host.CreateDefaultBuilder(args)
-                .ConfigureServices((_, services) =>
-                    services.AddAWSService<IAmazonEC2>()
-                    .AddTransient<EC2Wrapper>()
-                )
-                .Build();
-    
-            // Now the client is available for injection.
-            var ec2Client = host.Services.GetRequiredService<IAmazonEC2>();
-    
-            try
-            {
-                // Retrieve information for up to 10 Amazon EC2 security groups.
-                var request = new DescribeSecurityGroupsRequest { MaxResults = 10 };
-                var securityGroups = new List<SecurityGroup>();
-    
-                var paginatorForSecurityGroups =
-                    ec2Client.Paginators.DescribeSecurityGroups(request);
-    
-                await foreach (var securityGroup in paginatorForSecurityGroups.SecurityGroups)
-                {
-                    securityGroups.Add(securityGroup);
-                }
-    
-                // Now print the security groups returned by the call to
-                // DescribeSecurityGroupsAsync.
-                Console.WriteLine("Welcome to the EC2 Hello Service example. " +
-                                  "\nLet's list your Security Groups:");
-                securityGroups.ForEach(group =>
-                {
-                    Console.WriteLine(
-                        $"Security group: {group.GroupName} ID: {group.GroupId}");
-                });
-            }
-            catch (AmazonEC2Exception ex)
-            {
-                Console.WriteLine($"An Amazon EC2 service error occurred while listing security groups. {ex.Message}");
-            }
-            catch (Exception ex)
-            {
-                Console.WriteLine($"An error occurred while listing security groups. {ex.Message}");
-            }
-        }
-    }
-    
-    
-
-  * For API details, see [DescribeSecurityGroups](https://docs.aws.amazon.com/goto/DotNetSDKV4/ec2-2016-11-15/DescribeSecurityGroups) 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/ec2/hello_ec2#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 ec2)
-    
-    # Set this project's name.
-    project("hello_ec2")
-    
-    # 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_ec2.cpp)
-    
-    target_link_libraries(${PROJECT_NAME}
-            ${AWSSDK_LINK_LIBRARIES})
-    
-    
-
-Code for the hello_ec2.cpp source file.
-    
-    
-    #include <aws/core/Aws.h>
-    #include <aws/ec2/EC2Client.h>
-    #include <aws/ec2/model/DescribeInstancesRequest.h>
-    #include <iomanip>
-    #include <iostream>
-    
-    /*
-     *  A "Hello EC2" starter application which initializes an Amazon Elastic Compute Cloud (Amazon EC2) client and describes
-     *  the Amazon EC2 instances.
-     *
-     *  main function
-     *
-     *  Usage: 'hello_ec2'
-     *
-     */
-    
-    int main(int argc, char **argv) {
-        (void)argc;
-        (void)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::EC2::EC2Client ec2Client(clientConfig);
-            Aws::EC2::Model::DescribeInstancesRequest request;
-            bool header = false;
-            bool done = false;
-            while (!done) {
-                Aws::EC2::Model::DescribeInstancesOutcome outcome = ec2Client.DescribeInstances(request);
-                if (outcome.IsSuccess()) {
-                    if (!header) {
-                        std::cout << std::left <<
-                                  std::setw(48) << "Name" <<
-                                  std::setw(20) << "ID" <<
-                                  std::setw(25) << "Ami" <<
-                                  std::setw(15) << "Type" <<
-                                  std::setw(15) << "State" <<
-                                  std::setw(15) << "Monitoring" << std::endl;
-                        header = true;
-                    }
-    
-                    const std::vector<Aws::EC2::Model::Reservation> &reservations =
-                            outcome.GetResult().GetReservations();
-    
-                    for (const auto &reservation: reservations) {
-                        const std::vector<Aws::EC2::Model::Instance> &instances =
-                                reservation.GetInstances();
-                        for (const auto &instance: instances) {
-                            Aws::String instanceStateString =
-                                    Aws::EC2::Model::InstanceStateNameMapper::GetNameForInstanceStateName(
-                                            instance.GetState().GetName());
-