AWS Security ChangesHomeSearch

AWS powertools documentation change

Service: powertools · 2025-10-10 · Documentation low

File: powertools/python/latest/build_recipes/performance-optimization.md

Summary

Updated optimization guidance to warn against removing documentation directories and modified build script examples

Security assessment

Changes emphasize validating optimizations don't break functionality by removing critical directories. While this prevents potential runtime errors, there's no indication this addresses security vulnerabilities or documents security features. The removal of 'docs' directories appears related to size optimization rather than security hardening.

Diff

diff --git a/powertools/python/latest/build_recipes/performance-optimization.md b/powertools/python/latest/build_recipes/performance-optimization.md
index 36c80d621..963456da0 100644
--- a//powertools/python/latest/build_recipes/performance-optimization.md
+++ b//powertools/python/latest/build_recipes/performance-optimization.md
@@ -156,0 +157,2 @@ Optimize your Lambda functions for better performance, reduced cold start times,
+Always validate your function's behavior after applying optimizations to ensure an optimization hasn't introduced any issues with your packages. For example, removal of directories that appear to be unnecessary, such as `docs`, can break some libraries.
+
@@ -183 +184,0 @@ Exclude unnecessary filesLayer optimizationAdvanced optimization with debug symb
-    14
@@ -197,2 +198 @@ Exclude unnecessary filesLayer optimizationAdvanced optimization with debug symb
-    # Remove documentation and examples
-    find build/ -name "docs" -type d -exec rm -rf {} +
+    # Remove examples
@@ -277 +276,0 @@ Exclude unnecessary filesLayer optimizationAdvanced optimization with debug symb
-    26
@@ -299 +297,0 @@ Exclude unnecessary filesLayer optimizationAdvanced optimization with debug symb
-    rm -rf build/*/site-packages/*/docs/
@@ -312 +310 @@ Exclude unnecessary filesLayer optimizationAdvanced optimization with debug symb
-2025-08-18 
+2025-09-11