AWS code-library documentation change
Summary
Added SAP ABAP code example for AttachUserPolicy operation with error handling
Security assessment
Change adds standard IAM operation example. No evidence of addressing a security vulnerability or documenting new security capabilities.
Diff
diff --git a/code-library/latest/ug/iam_example_iam_AttachUserPolicy_section.md b/code-library/latest/ug/iam_example_iam_AttachUserPolicy_section.md index f814fb8b3..2d552eebe 100644 --- a//code-library/latest/ug/iam_example_iam_AttachUserPolicy_section.md +++ b//code-library/latest/ug/iam_example_iam_AttachUserPolicy_section.md @@ -174,0 +175,29 @@ 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/iam#code-examples). + + + TRY. + lo_iam->attachuserpolicy( + iv_username = iv_user_name + iv_policyarn = iv_policy_arn ). + MESSAGE 'Policy attached to user successfully.' TYPE 'I'. + CATCH /aws1/cx_iamnosuchentityex. + MESSAGE 'User or policy does not exist.' TYPE 'E'. + CATCH /aws1/cx_iamlimitexceededex. + MESSAGE 'Policy attachment limit exceeded.' TYPE 'E'. + ENDTRY. + + + + * For API details, see [AttachUserPolicy](https://docs.aws.amazon.com/sdk-for-sap-abap/v1/api/latest/index.html) in _AWS SDK for SAP ABAP API reference_. + + + +