AWS Security ChangesHomeSearch

AWS code-library documentation change

Service: code-library · 2026-01-10 · Documentation low

File: code-library/latest/ug/location_code_examples.md

Summary

Removed Java, JavaScript, and Kotlin code examples demonstrating how to list geofences and geofence collections in Amazon Location Service.

Security assessment

The change removes general code examples without any security context. There's no evidence of vulnerability fixes, security weaknesses, or incident response. The examples focused on basic API usage (listing geofences) without security-specific features like authentication, encryption, or access control.

Diff

diff --git a/code-library/latest/ug/location_code_examples.md b/code-library/latest/ug/location_code_examples.md
index 6faed813c..f8872d508 100644
--- a//code-library/latest/ug/location_code_examples.md
+++ b//code-library/latest/ug/location_code_examples.md
@@ -28,248 +27,0 @@ _Actions_ are code excerpts from larger programs and must be run in context. Whi
-**Get started**
-
-The following code examples show how to get started using Amazon Location Service.
-
-Java
-    
-
-**SDK for Java 2.x**
-    
-
-###### 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/javav2/example_code/location#code-examples). 
-    
-    
-    /**
-     * Before running this Java V2 code example, set up your development
-     * environment, including your credentials.
-     *
-     * For more information, see the following documentation topic:
-     *
-     * https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/get-started.html
-     *
-     * In addition, you need to create a collection using the AWS Management
-     * console. For information, see the following documentation.
-     *
-     * https://docs.aws.amazon.com/location/latest/developerguide/geofence-gs.html
-    
-     */
-    public class HelloLocation {
-    
-        private static LocationAsyncClient locationAsyncClient;
-        private static final Logger logger = LoggerFactory.getLogger(HelloLocation.class);
-    
-        // This Singleton pattern ensures that only one `LocationClient`
-        // instance.
-        private static LocationAsyncClient getClient() {
-            if (locationAsyncClient == null) {
-                SdkAsyncHttpClient httpClient = NettyNioAsyncHttpClient.builder()
-                    .maxConcurrency(100)
-                    .connectionTimeout(Duration.ofSeconds(60))
-                    .readTimeout(Duration.ofSeconds(60))
-                    .writeTimeout(Duration.ofSeconds(60))
-                    .build();
-    
-                ClientOverrideConfiguration overrideConfig = ClientOverrideConfiguration.builder()
-                    .apiCallTimeout(Duration.ofMinutes(2))
-                    .apiCallAttemptTimeout(Duration.ofSeconds(90))
-                    .retryStrategy(RetryMode.STANDARD)
-                    .build();
-    
-                locationAsyncClient = LocationAsyncClient.builder()
-                    .httpClient(httpClient)
-                    .overrideConfiguration(overrideConfig)
-                    .build();
-            }
-            return locationAsyncClient;
-        }
-    
-        public static void main(String[] args) {
-            final String usage = """
-    
-                Usage:
-                    <collectionName>
-    
-                Where:
-                    collectionName - The Amazon location collection name.
-                """;
-    
-            if (args.length != 1) {
-                System.out.println(usage);
-                System.exit(1);
-            }
-    
-            String collectionName = args[0];
-            listGeofences(collectionName);
-        }
-    
-        /**
-         * Lists geofences from a specified geofence collection asynchronously.
-         *
-         * @param collectionName The name of the geofence collection to list geofences from.
-         * @return A {@link CompletableFuture} representing the result of the asynchronous operation.
-         *         The future completes when all geofences have been processed and logged.
-         */
-        public static CompletableFuture<Void> listGeofences(String collectionName) {
-            ListGeofencesRequest geofencesRequest = ListGeofencesRequest.builder()
-                    .collectionName(collectionName)
-                    .build();
-    
-            ListGeofencesPublisher paginator = getClient().listGeofencesPaginator(geofencesRequest);
-            CompletableFuture<Void> future = paginator.subscribe(response -> {
-                if (response.entries().isEmpty()) {
-                    logger.info("No Geofences were found in the collection.");
-                } else {
-                    response.entries().forEach(geofence ->
-                            logger.info("Geofence ID: " + geofence.geofenceId())
-                    );
-                }
-            });
-            return future;
-        }
-    }
-    
-    
-
-  * For API details, see the following topics in _AWS SDK for Java 2.x API Reference_.
-
-    * [ListGeofenceCollections](https://docs.aws.amazon.com/goto/SdkForJavaV2/location-2020-11-19/ListGeofenceCollections)
-
-    * [ListGeofences](https://docs.aws.amazon.com/goto/SdkForJavaV2/location-2020-11-19/ListGeofences)
-
-
-
-
-JavaScript
-    
-
-**SDK for JavaScript (v3)**
-    
-
-###### 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/javascriptv3/example_code/location/#code-examples). 
-    
-    
-    import { fileURLToPath } from "node:url";
-    import {
-      LocationClient,
-      ListGeofenceCollectionsCommand,
-    } from "@aws-sdk/client-location";
-    
-    /**
-     * Lists geofences from a specified geofence collection asynchronously.
-     */
-    export const main = async () => {
-      const region = "eu-west-1";
-      const locationClient = new LocationClient({ region: region });
-      const listGeofenceCollParams = {
-        MaxResults: 100,
-      };
-      try {
-        const command = new ListGeofenceCollectionsCommand(listGeofenceCollParams);
-        const response = await locationClient.send(command);
-        const geofenceEntries = response.Entries;
-        if (geofenceEntries.length === 0) {
-          console.log("No Geofences were found in the collection.");
-        } else {
-          for (const geofenceEntry of geofenceEntries) {
-            console.log(`Geofence ID: ${geofenceEntry.CollectionName}`);
-          }
-        }
-      } catch (error) {
-        console.error(
-          `A validation error occurred while creating geofence: ${error} \n Exiting program.`,
-        );
-        return;
-      }
-    };
-    
-    
-    
-
-  * For API details, see the following topics in _AWS SDK for JavaScript API Reference_.
-
-    * [ListGeofenceCollections](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/location/command/ListGeofenceCollectionsCommand)
-
-    * [ListGeofences](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/location/command/ListGeofencesCommand)
-
-
-
-
-Kotlin
-    
-
-**SDK for Kotlin**
-    
-
-###### 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/kotlin/services/location#code-examples). 
-    
-    
-    /**
-    Before running this Kotlin code example, set up your development environment,
-    including your credentials.
-    
-    For more information, see the following documentation topic:
-    https://docs.aws.amazon.com/sdk-for-kotlin/latest/developer-guide/setup.html
-    
-    In addition, you need to create a collection using the AWS Management
-    console. For information, see the following documentation.
-    
-    https://docs.aws.amazon.com/location/latest/developerguide/geofence-gs.html
-