Amazon Config examples using SDK for SAP ABAP - Amazon SDK for SAP ABAP
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Amazon Config examples using SDK for SAP ABAP

The following code examples show you how to perform actions and implement common scenarios by using the Amazon SDK for SAP ABAP with Amazon Config.

Actions are code excerpts from larger programs and must be run in context. While actions show you how to call individual service functions, you can see actions in context in their related scenarios.

Each example includes a link to the complete source code, where you can find instructions on how to set up and run the code in context.

Topics

Actions

The following code example shows how to use DeleteConfigRule.

SDK for SAP ABAP
Note

There's more on GitHub. Find the complete example and learn how to set up and run in the Amazon Code Examples Repository.

lo_cfs->deleteconfigrule( iv_rule_name ). MESSAGE 'Deleted AWS Config rule.' TYPE 'I'.
  • For API details, see DeleteConfigRule in Amazon SDK for SAP ABAP API reference.

The following code example shows how to use DescribeConfigRules.

SDK for SAP ABAP
Note

There's more on GitHub. Find the complete example and learn how to set up and run in the Amazon Code Examples Repository.

DATA(lo_result) = lo_cfs->describeconfigrules( it_configrulenames = VALUE /aws1/cl_cfsconfigrulenames_w=>tt_configrulenames( ( NEW /aws1/cl_cfsconfigrulenames_w( iv_rule_name ) ) ) ). ot_cfg_rules = lo_result->get_configrules( ). MESSAGE 'Retrieved AWS Config rule data.' TYPE 'I'.

The following code example shows how to use PutConfigRule.

SDK for SAP ABAP
Note

There's more on GitHub. Find the complete example and learn how to set up and run in the Amazon Code Examples Repository.

" Create a config rule for S3 bucket public read prohibition lo_cfs->putconfigrule( io_configrule = NEW /aws1/cl_cfsconfigrule( iv_configrulename = iv_rule_name iv_description = |S3 Public Read Prohibited Bucket Rule| io_scope = NEW /aws1/cl_cfsscope( it_complianceresourcetypes = VALUE /aws1/cl_cfscplncresrctypes_w=>tt_complianceresourcetypes( ( NEW /aws1/cl_cfscplncresrctypes_w( |AWS::S3::Bucket| ) ) ) ) io_source = NEW /aws1/cl_cfssource( iv_owner = |AWS| iv_sourceidentifier = |S3_BUCKET_PUBLIC_READ_PROHIBITED| ) iv_inputparameters = '{}' iv_configrulestate = |ACTIVE| ) ). MESSAGE 'Created AWS Config rule.' TYPE 'I'.
  • For API details, see PutConfigRule in Amazon SDK for SAP ABAP API reference.