AWS Security ChangesHomeSearch

AWS code-library documentation change

Service: code-library · 2025-05-03 · Documentation low

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

Summary

Added JavaScript SDK v3 example for listing geofence collections in AWS Location Service (duplicate of previous change)

Security assessment

This appears to be a duplicate addition of the geofence listing example from the previous file. Contains no security-related content or fixes.

Diff

diff --git a/code-library/latest/ug/location_example_location_Hello_section.md b/code-library/latest/ug/location_example_location_Hello_section.md
index 50ceac544..2d31bcad6 100644
--- a//code-library/latest/ug/location_example_location_Hello_section.md
+++ b//code-library/latest/ug/location_example_location_Hello_section.md
@@ -117,0 +118,53 @@ There's more on GitHub. Find the complete example and learn how to set up and ru
+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 [ListGeofencesPaginator](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/location/command/ListGeofencesPaginatorCommand) in _AWS SDK for JavaScript API Reference_. 
+
+
+
+