/AWS1/IF_APC=>CREATEENVIRONMENT()¶
About CreateEnvironment¶
Creates an environment. For each application, you define one or more environments. An
environment is a deployment group of AppConfig targets, such as applications in a
Beta or Production environment. You can also define
environments for application subcomponents such as the Web,
Mobile and Back-end components for your application. You can
configure Amazon CloudWatch alarms for each environment. The system monitors alarms during a
configuration deployment. If an alarm is triggered, the system rolls back the
configuration.
Method Signature¶
METHODS /AWS1/IF_APC~CREATEENVIRONMENT
  IMPORTING
    !IV_APPLICATIONID TYPE /AWS1/APCID OPTIONAL
    !IV_NAME TYPE /AWS1/APCNAME OPTIONAL
    !IV_DESCRIPTION TYPE /AWS1/APCDESCRIPTION OPTIONAL
    !IT_MONITORS TYPE /AWS1/CL_APCMONITOR=>TT_MONITORLIST OPTIONAL
    !IT_TAGS TYPE /AWS1/CL_APCTAGMAP_W=>TT_TAGMAP OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_apcenvironment
  RAISING
    /AWS1/CX_APCBADREQUESTEX
    /AWS1/CX_APCINTERNALSERVEREX
    /AWS1/CX_APCRESOURCENOTFOUNDEX
    /AWS1/CX_APCSERVICEQUOTAEXCDEX
    /AWS1/CX_APCCLIENTEXC
    /AWS1/CX_APCSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
iv_applicationid TYPE /AWS1/APCID /AWS1/APCID¶
The application ID.
iv_name TYPE /AWS1/APCNAME /AWS1/APCNAME¶
A name for the environment.
Optional arguments:¶
iv_description TYPE /AWS1/APCDESCRIPTION /AWS1/APCDESCRIPTION¶
A description of the environment.
it_monitors TYPE /AWS1/CL_APCMONITOR=>TT_MONITORLIST TT_MONITORLIST¶
Amazon CloudWatch alarms to monitor during the deployment process.
it_tags TYPE /AWS1/CL_APCTAGMAP_W=>TT_TAGMAP TT_TAGMAP¶
Metadata to assign to the environment. Tags help organize and categorize your AppConfig resources. Each tag consists of a key and an optional value, both of which you define.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_apcenvironment /AWS1/CL_APCENVIRONMENT¶
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->createenvironment(
  it_monitors = VALUE /aws1/cl_apcmonitor=>tt_monitorlist(
    (
      new /aws1/cl_apcmonitor(
        iv_alarmarn = |string|
        iv_alarmrolearn = |string|
      )
    )
  )
  it_tags = VALUE /aws1/cl_apctagmap_w=>tt_tagmap(
    (
      VALUE /aws1/cl_apctagmap_w=>ts_tagmap_maprow(
        key = |string|
        value = new /aws1/cl_apctagmap_w( |string| )
      )
    )
  )
  iv_applicationid = |string|
  iv_description = |string|
  iv_name = |string|
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_id = lo_result->get_applicationid( ).
  lv_id = lo_result->get_id( ).
  lv_name = lo_result->get_name( ).
  lv_description = lo_result->get_description( ).
  lv_environmentstate = lo_result->get_state( ).
  LOOP AT lo_result->get_monitors( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_stringwithlengthbetween = lo_row_1->get_alarmarn( ).
      lv_rolearn = lo_row_1->get_alarmrolearn( ).
    ENDIF.
  ENDLOOP.
ENDIF.
To create an environment¶
The following create-environment example creates an AWS AppConfig environment named Example-Environment using the application you created using create-application
DATA(lo_result) = lo_client->createenvironment(
  iv_applicationid = |339ohji|
  iv_name = |Example-Environment|
).