Skip to content

/AWS1/CL_RGR=>CREATEGROUP()

About CreateGroup

Creates a resource group with the specified name and description. You can optionally include either a resource query or a service configuration. For more information about constructing a resource query, see Build queries and groups in Resource Groups in the Resource Groups User Guide. For more information about service-linked groups and service configurations, see Service configurations for Resource Groups.

Minimum permissions

To run this command, you must have the following permissions:

  • resource-groups:CreateGroup

Method Signature

IMPORTING

Required arguments:

iv_name TYPE /AWS1/RGRCREATEGROUPNAME /AWS1/RGRCREATEGROUPNAME

The name of the group, which is the identifier of the group in other operations. You can't change the name of a resource group after you create it. A resource group name can consist of letters, numbers, hyphens, periods, and underscores. The name cannot start with AWS, aws, or any other possible capitalization; these are reserved. A resource group name must be unique within each Amazon Web Services Region in your Amazon Web Services account.

Optional arguments:

iv_description TYPE /AWS1/RGRDESCRIPTION /AWS1/RGRDESCRIPTION

The description of the resource group. Descriptions can consist of letters, numbers, hyphens, underscores, periods, and spaces.

io_resourcequery TYPE REF TO /AWS1/CL_RGRRESOURCEQUERY /AWS1/CL_RGRRESOURCEQUERY

The resource query that determines which Amazon Web Services resources are members of this group. For more information about resource queries, see Create a tag-based group in Resource Groups.

A resource group can contain either a ResourceQuery or a Configuration, but not both.

it_tags TYPE /AWS1/CL_RGRTAGS_W=>TT_TAGS TT_TAGS

The tags to add to the group. A tag is key-value pair string.

it_configuration TYPE /AWS1/CL_RGRGROUPCONFITEM=>TT_GROUPCONFIGURATIONLIST TT_GROUPCONFIGURATIONLIST

A configuration associates the resource group with an Amazon Web Services service and specifies how the service can interact with the resources in the group. A configuration is an array of GroupConfigurationItem elements. For details about the syntax of service configurations, see Service configurations for Resource Groups.

A resource group can contain either a Configuration or a ResourceQuery, but not both.

iv_criticality TYPE /AWS1/RGRCRITICALITY /AWS1/RGRCRITICALITY

The critical rank of the application group on a scale of 1 to 10, with a rank of 1 being the most critical, and a rank of 10 being least critical.

iv_owner TYPE /AWS1/RGROWNER /AWS1/RGROWNER

A name, email address or other identifier for the person or group who is considered as the owner of this application group within your organization.

iv_displayname TYPE /AWS1/RGRDISPLAYNAME /AWS1/RGRDISPLAYNAME

The name of the application group, which you can change at any time.

RETURNING

oo_output TYPE REF TO /aws1/cl_rgrcreategroupoutput /AWS1/CL_RGRCREATEGROUPOUTPUT

Domain /AWS1/RT_ACCOUNT_ID
Primitive Type NUMC

Examples

Syntax Example

This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.

DATA(lo_result) = lo_client->/aws1/if_rgr~creategroup(
  io_resourcequery = new /aws1/cl_rgrresourcequery(
    iv_query = |string|
    iv_type = |string|
  )
  it_configuration = VALUE /aws1/cl_rgrgroupconfitem=>tt_groupconfigurationlist(
    (
      new /aws1/cl_rgrgroupconfitem(
        it_parameters = VALUE /aws1/cl_rgrgroupconfparameter=>tt_groupparameterlist(
          (
            new /aws1/cl_rgrgroupconfparameter(
              it_values = VALUE /aws1/cl_rgrgrconfparmvallst_w=>tt_groupconfparametervaluelist(
                ( new /aws1/cl_rgrgrconfparmvallst_w( |string| ) )
              )
              iv_name = |string|
            )
          )
        )
        iv_type = |string|
      )
    )
  )
  it_tags = VALUE /aws1/cl_rgrtags_w=>tt_tags(
    (
      VALUE /aws1/cl_rgrtags_w=>ts_tags_maprow(
        key = |string|
        value = new /aws1/cl_rgrtags_w( |string| )
      )
    )
  )
  iv_criticality = 123
  iv_description = |string|
  iv_displayname = |string|
  iv_name = |string|
  iv_owner = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lo_group = lo_result->get_group( ).
  IF lo_group IS NOT INITIAL.
    lv_grouparnv2 = lo_group->get_grouparn( ).
    lv_groupname = lo_group->get_name( ).
    lv_description = lo_group->get_description( ).
    lv_criticality = lo_group->get_criticality( ).
    lv_owner = lo_group->get_owner( ).
    lv_displayname = lo_group->get_displayname( ).
    LOOP AT lo_group->get_applicationtag( ) into ls_row.
      lv_key = ls_row-key.
      lo_value = ls_row-value.
      IF lo_value IS NOT INITIAL.
        lv_applicationarn = lo_value->get_value( ).
      ENDIF.
    ENDLOOP.
  ENDIF.
  lo_resourcequery = lo_result->get_resourcequery( ).
  IF lo_resourcequery IS NOT INITIAL.
    lv_querytype = lo_resourcequery->get_type( ).
    lv_query = lo_resourcequery->get_query( ).
  ENDIF.
  LOOP AT lo_result->get_tags( ) into ls_row_1.
    lv_key_1 = ls_row_1-key.
    lo_value_1 = ls_row_1-value.
    IF lo_value_1 IS NOT INITIAL.
      lv_tagvalue = lo_value_1->get_value( ).
    ENDIF.
  ENDLOOP.
  lo_groupconfiguration = lo_result->get_groupconfiguration( ).
  IF lo_groupconfiguration IS NOT INITIAL.
    LOOP AT lo_groupconfiguration->get_configuration( ) into lo_row_2.
      lo_row_3 = lo_row_2.
      IF lo_row_3 IS NOT INITIAL.
        lv_groupconfigurationtype = lo_row_3->get_type( ).
        LOOP AT lo_row_3->get_parameters( ) into lo_row_4.
          lo_row_5 = lo_row_4.
          IF lo_row_5 IS NOT INITIAL.
            lv_groupconfigurationparam = lo_row_5->get_name( ).
            LOOP AT lo_row_5->get_values( ) into lo_row_6.
              lo_row_7 = lo_row_6.
              IF lo_row_7 IS NOT INITIAL.
                lv_groupconfigurationparam_1 = lo_row_7->get_value( ).
              ENDIF.
            ENDLOOP.
          ENDIF.
        ENDLOOP.
      ENDIF.
    ENDLOOP.
    LOOP AT lo_groupconfiguration->get_proposedconfiguration( ) into lo_row_2.
      lo_row_3 = lo_row_2.
      IF lo_row_3 IS NOT INITIAL.
        lv_groupconfigurationtype = lo_row_3->get_type( ).
        LOOP AT lo_row_3->get_parameters( ) into lo_row_4.
          lo_row_5 = lo_row_4.
          IF lo_row_5 IS NOT INITIAL.
            lv_groupconfigurationparam = lo_row_5->get_name( ).
            LOOP AT lo_row_5->get_values( ) into lo_row_6.
              lo_row_7 = lo_row_6.
              IF lo_row_7 IS NOT INITIAL.
                lv_groupconfigurationparam_1 = lo_row_7->get_value( ).
              ENDIF.
            ENDLOOP.
          ENDIF.
        ENDLOOP.
      ENDIF.
    ENDLOOP.
    lv_groupconfigurationstatu = lo_groupconfiguration->get_status( ).
    lv_groupconfigurationfailu = lo_groupconfiguration->get_failurereason( ).
  ENDIF.
ENDIF.