AWS Security ChangesHomeSearch

AWS code-library documentation change

Service: code-library · 2026-06-16 · Documentation low

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

Summary

Added SAP ABAP code example for DetachThingPrincipal operation and updated link text

Security assessment

Change adds SAP ABAP implementation for detaching principals from IoT things. While related to access control, this is routine documentation without evidence of addressing a specific security issue.

Diff

diff --git a/code-library/latest/ug/iot_example_iot_DetachThingPrincipal_section.md b/code-library/latest/ug/iot_example_iot_DetachThingPrincipal_section.md
index 237c40b9b..1b6853951 100644
--- a//code-library/latest/ug/iot_example_iot_DetachThingPrincipal_section.md
+++ b//code-library/latest/ug/iot_example_iot_DetachThingPrincipal_section.md
@@ -17 +17 @@ Action examples are code excerpts from larger programs and must be run in contex
-  * [Getting started with IoT Core](./iot_example_iot_GettingStarted_063_section.html)
+  * [Getting started with internet of things messaging](./iot_example_iot_GettingStarted_063_section.html)
@@ -290,0 +291,34 @@ There's more on GitHub. Find the complete example and learn how to set up and ru
+SAP ABAP
+    
+
+**SDK for SAP ABAP**
+    
+
+###### 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/sap-abap/services/iot#code-examples). 
+    
+    
+        CONSTANTS cv_pfl TYPE /aws1/rt_profile_id VALUE 'ZCODE_DEMO'.
+        DATA(lo_session) = /aws1/cl_rt_session_aws=>create( cv_pfl ).
+        DATA(lo_iot) = /aws1/cl_iot_factory=>create( lo_session ).
+        TRY.
+            lo_iot->detachthingprincipal(
+              iv_thingname = iv_thing_name
+              iv_principal = iv_principal ).
+            MESSAGE |Principal detached from IoT thing '{ iv_thing_name }'.| TYPE 'I'.
+          CATCH /aws1/cx_iotresourcenotfoundex INTO DATA(lo_ex).
+            MESSAGE |Resource not found when detaching principal from '{ iv_thing_name }'.| TYPE 'I'.
+            RAISE EXCEPTION lo_ex.
+          CATCH /aws1/cx_rt_service_generic INTO DATA(lo_svc_ex).
+            MESSAGE lo_svc_ex->get_text( ) TYPE 'I'.
+            RAISE EXCEPTION lo_svc_ex.
+        ENDTRY.
+    
+    
+
+  * For API details, see [DetachThingPrincipal](https://docs.aws.amazon.com/sdk-for-sap-abap/v1/api/latest/index.html) in _AWS SDK for SAP ABAP API reference_. 
+
+
+
+