AWS code-library documentation change
Summary
Added SAP ABAP code example for ControlTower EnableBaseline operation
Security assessment
The change adds documentation for enabling security baselines (a security feature), but doesn't address any specific security vulnerability. Control Tower baselines help enforce security policies.
Diff
diff --git a/code-library/latest/ug/controltower_example_controltower_EnableBaseline_section.md b/code-library/latest/ug/controltower_example_controltower_EnableBaseline_section.md index acdaef367..65042defd 100644 --- a//code-library/latest/ug/controltower_example_controltower_EnableBaseline_section.md +++ b//code-library/latest/ug/controltower_example_controltower_EnableBaseline_section.md @@ -320,0 +321,64 @@ 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/ctt#code-examples). + + + " Prepare parameters for enabling baseline + DATA lt_parameters TYPE /aws1/cl_cttenbdbaselineparam=>tt_enabledbaselineparameters. + + " Add Identity Center baseline parameter if provided + IF iv_identity_center_baseline IS NOT INITIAL. + " Create a JSON document with the baseline ARN value + DATA(lv_json) = |\{ "IdentityCenterEnabledBaselineArn": "{ iv_identity_center_baseline }" \}|. + DATA(lo_param) = NEW /aws1/cl_cttenbdbaselineparam( + iv_key = 'IdentityCenterEnabledBaselineArn' + io_value = /aws1/cl_rt_document=>from_json_str( lv_json ) + ). + APPEND lo_param TO lt_parameters. + ENDIF. + + " Enable the baseline + DATA(lo_output) = io_ctt->enablebaseline( + iv_baselineidentifier = iv_baseline_identifier + iv_baselineversion = iv_baseline_version + iv_targetidentifier = iv_target_identifier + it_parameters = lt_parameters + ). + + DATA(lv_operation_id) = lo_output->get_operationidentifier( ). + + " Wait for operation to complete + DATA lv_status TYPE /aws1/cttbaselineopstatus. + DO 100 TIMES. + lv_status = get_baseline_operation( + io_ctt = io_ctt + iv_operation_id = lv_operation_id + ). + + DATA(lv_msg) = |Baseline operation status: { lv_status }|. + MESSAGE lv_msg TYPE 'I'. + + IF lv_status = 'SUCCEEDED' OR lv_status = 'FAILED'. + EXIT. + ENDIF. + + " Wait 30 seconds + WAIT UP TO 30 SECONDS. + ENDDO. + + ov_enabled_baseline_arn = lo_output->get_arn( ). + MESSAGE 'Baseline enabled successfully.' TYPE 'I'. + + + + * For API details, see [EnableBaseline](https://docs.aws.amazon.com/sdk-for-sap-abap/v1/api/latest/index.html) in _AWS SDK for SAP ABAP API reference_. + + + +