AWS Security ChangesHomeSearch

AWS code-library documentation change

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

File: code-library/latest/ug/sap-abap_1_s3_code_examples.md

Summary

Added region-specific bucket creation constraints and improved code formatting by consolidating parameters

Security assessment

The changes primarily address proper region handling for S3 bucket creation constraints (required configuration outside us-east-1). While this ensures correct API usage, there's no evidence of addressing a security vulnerability or documenting security features. The modifications focus on operational correctness rather than security controls.

Diff

diff --git a/code-library/latest/ug/sap-abap_1_s3_code_examples.md b/code-library/latest/ug/sap-abap_1_s3_code_examples.md
index 30138f69d..0c0038cf4 100644
--- a/code-library/latest/ug/sap-abap_1_s3_code_examples.md
+++ b/code-library/latest/ug/sap-abap_1_s3_code_examples.md
@@ -55,0 +56,11 @@ There's more on GitHub. Find the complete example and learn how to set up and ru
+            " determine our region from our session
+            DATA(lv_region) = CONV /aws1/s3_bucketlocationcnstrnt( lo_session->get_region( ) ).
+            DATA lo_constraint TYPE REF TO /aws1/cl_s3_createbucketconf.
+            " When in the us-east-1 region, you must not specify a constraint
+            " In all other regions, specify the region as the constraint
+            IF lv_region = 'us-east-1'.
+              CLEAR lo_constraint.
+            ELSE.
+              lo_constraint = NEW /aws1/cl_s3_createbucketconf( lv_region ).
+            ENDIF.
+    
@@ -58 +69 @@ There's more on GitHub. Find the complete example and learn how to set up and ru
-            ).
+                io_createbucketconfiguration  = lo_constraint ).
@@ -78,2 +89 @@ There's more on GitHub. Find the complete example and learn how to set up and ru
-                iv_body = lv_file_content
-            ).
+                iv_body = lv_file_content ).
@@ -89,2 +99 @@ There's more on GitHub. Find the complete example and learn how to set up and ru
-                       iv_key = iv_key
-                    ).
+                       iv_key = iv_key ).
@@ -104,2 +113 @@ There's more on GitHub. Find the complete example and learn how to set up and ru
-              iv_copysource = |{ iv_bucket_name }/{ iv_key }|
-            ).
+              iv_copysource = |{ iv_bucket_name }/{ iv_key }| ).
@@ -116,2 +124 @@ There's more on GitHub. Find the complete example and learn how to set up and ru
-               iv_bucket = iv_bucket_name
-             ).
+               iv_bucket = iv_bucket_name ).
@@ -134,2 +141 @@ There's more on GitHub. Find the complete example and learn how to set up and ru
-                iv_key = iv_key
-            ).
+                iv_key = iv_key ).
@@ -138,2 +144 @@ There's more on GitHub. Find the complete example and learn how to set up and ru
-                iv_key = |{ iv_copy_to_folder }/{ iv_key }|
-            ).
+                iv_key = |{ iv_copy_to_folder }/{ iv_key }| ).
@@ -149,2 +154 @@ There's more on GitHub. Find the complete example and learn how to set up and ru
-                iv_bucket = iv_bucket_name
-            ).
+                iv_bucket = iv_bucket_name ).
@@ -193,2 +197 @@ There's more on GitHub. Find the complete example and learn how to set up and ru
-              iv_copysource = |{ iv_src_bucket }/{ iv_src_object }|
-            ).
+              iv_copysource = |{ iv_src_bucket }/{ iv_src_object }| ).
@@ -219,0 +223,11 @@ There's more on GitHub. Find the complete example and learn how to set up and ru
+            " determine our region from our session
+            DATA(lv_region) = CONV /aws1/s3_bucketlocationcnstrnt( lo_session->get_region( ) ).
+            DATA lo_constraint TYPE REF TO /aws1/cl_s3_createbucketconf.
+            " When in the us-east-1 region, you must not specify a constraint
+            " In all other regions, specify the region as the constraint
+            IF lv_region = 'us-east-1'.
+              CLEAR lo_constraint.
+            ELSE.
+              lo_constraint = NEW /aws1/cl_s3_createbucketconf( lv_region ).
+            ENDIF.
+    
@@ -222 +236 @@ There's more on GitHub. Find the complete example and learn how to set up and ru
-            ).
+                io_createbucketconfiguration  = lo_constraint ).
@@ -250,2 +264 @@ There's more on GitHub. Find the complete example and learn how to set up and ru
-                iv_bucket = iv_bucket_name
-            ).
+                iv_bucket = iv_bucket_name ).
@@ -277,2 +290 @@ There's more on GitHub. Find the complete example and learn how to set up and ru
-                iv_key = iv_object_key
-            ).
+                iv_key = iv_object_key ).
@@ -304,2 +316 @@ There's more on GitHub. Find the complete example and learn how to set up and ru
-                      iv_key = iv_object_key
-                   ).
+                      iv_key = iv_object_key ).
@@ -333,2 +344 @@ There's more on GitHub. Find the complete example and learn how to set up and ru
-              iv_bucket = iv_bucket_name
-            ).
+              iv_bucket = iv_bucket_name ).
@@ -368,2 +378 @@ There's more on GitHub. Find the complete example and learn how to set up and ru
-                iv_body = lv_body
-            ).
+                iv_body = lv_body ).