Skip to content

/AWS1/IF_EC2=>CREATEAPPLICATIONSTATUSCHECK()

About CreateApplicationStatusCheck

Creates an application status check for monitoring the health of applications running on your instances. You can configure the protocol, port, path, and thresholds for the health check. The following rules apply:

  • You can create a maximum of 50 application status checks per account.

  • Health checks do not start until you associate the check with instances or tags using AssociateApplicationStatusCheck.

  • The Timeout value must be less than the Interval value.

  • The Path must start with a forward slash (/). Default: /.

  • If you do not specify Aggregation, it defaults to included, which means the check contributes to the instance-level application status.

  • Default values: Interval is 60 seconds, Timeout is 6 seconds, FailureThreshold is 2, SuccessThreshold is 2, StatusCodeMatcher is 200, InitializationGracePeriodSeconds is 300 seconds.

  • You can tag the application status check during creation. For more information, see Tag your Amazon EC2 resources.

Method Signature

METHODS /AWS1/IF_EC2~CREATEAPPLICATIONSTATUSCHECK
  IMPORTING
    !IT_HEALTHCHECKPATHS TYPE /AWS1/CL_EC2HLTHCHKPATHREQOBJ=>TT_HEALTHCHECKPATHREQUESTLIST OPTIONAL
    !IV_AGGREGATION TYPE /AWS1/EC2AGGREGATIONSTATUSENUM OPTIONAL
    !IV_PROTOCOL TYPE /AWS1/EC2NETWORKPROTOCOLENUM OPTIONAL
    !IV_PORT TYPE /AWS1/EC2PORTNUMBER OPTIONAL
    !IV_PATH TYPE /AWS1/EC2STRING OPTIONAL
    !IV_DEVICEINDEX TYPE /AWS1/EC2INTEGER OPTIONAL
    !IV_IPVERSION TYPE /AWS1/EC2IPVERSIONENUM OPTIONAL
    !IV_IPSCOPE TYPE /AWS1/EC2IPSCOPEENUM OPTIONAL
    !IV_INTERVAL TYPE /AWS1/EC2INTEGER OPTIONAL
    !IV_TIMEOUT TYPE /AWS1/EC2INTEGER OPTIONAL
    !IV_FAILURETHRESHOLD TYPE /AWS1/EC2INTEGER OPTIONAL
    !IV_SUCCESSTHRESHOLD TYPE /AWS1/EC2INTEGER OPTIONAL
    !IV_STATUSCODEMATCHER TYPE /AWS1/EC2STRING OPTIONAL
    !IV_INITGRACEPERIODSECONDS TYPE /AWS1/EC2INITGRACEPERIODSECS OPTIONAL
    !IT_TAGSPECIFICATIONS TYPE /AWS1/CL_EC2TAGSPECIFICATION=>TT_TAGSPECIFICATIONLIST OPTIONAL
    !IV_CLIENTTOKEN TYPE /AWS1/EC2STRING OPTIONAL
    !IV_DRYRUN TYPE /AWS1/EC2BOOLEAN OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_ec2creappstatchkrslt
  RAISING
    /AWS1/CX_EC2CLIENTEXC
    /AWS1/CX_EC2SERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_protocol TYPE /AWS1/EC2NETWORKPROTOCOLENUM /AWS1/EC2NETWORKPROTOCOLENUM

The protocol to use for the health check. Valid values: http | https.

iv_port TYPE /AWS1/EC2PORTNUMBER /AWS1/EC2PORTNUMBER

The port to use for the health check. Valid values: 1 to 65535.

Optional arguments:

it_healthcheckpaths TYPE /AWS1/CL_EC2HLTHCHKPATHREQOBJ=>TT_HEALTHCHECKPATHREQUESTLIST TT_HEALTHCHECKPATHREQUESTLIST

The health check paths to use for the application status check. Health check paths define the network path from a source subnet to one or more destination subnets for cross-Availability Zone or Availability Zone to Local Zone health checking. If omitted, health checks are performed in the same subnet as the instance.

iv_aggregation TYPE /AWS1/EC2AGGREGATIONSTATUSENUM /AWS1/EC2AGGREGATIONSTATUSENUM

The aggregation setting for the application status check. When set to included, the result of this check contributes to the instance-level application status reported by DescribeApplicationStatus. When set to excluded, the check runs independently and does not affect the instance-level status. Valid values: included | excluded.

iv_path TYPE /AWS1/EC2STRING /AWS1/EC2STRING

The URL path to use for the health check HTTP request (for example, /health or /status).

iv_deviceindex TYPE /AWS1/EC2INTEGER /AWS1/EC2INTEGER

The index of the network device to use for the health check. The value must be greater than or equal to 0.

iv_ipversion TYPE /AWS1/EC2IPVERSIONENUM /AWS1/EC2IPVERSIONENUM

The IP version to use for the health check. Valid values: ipv4 and ipv6.

iv_ipscope TYPE /AWS1/EC2IPSCOPEENUM /AWS1/EC2IPSCOPEENUM

The IP scope to use for the health check. Valid value: private.

iv_interval TYPE /AWS1/EC2INTEGER /AWS1/EC2INTEGER

The interval, in seconds, between health checks. Valid value: 60.

iv_timeout TYPE /AWS1/EC2INTEGER /AWS1/EC2INTEGER

The amount of time, in seconds, to wait for a health check response before considering it failed. Valid values: 1 to 30. The value must be less than Interval.

iv_failurethreshold TYPE /AWS1/EC2INTEGER /AWS1/EC2INTEGER

The number of consecutive failed health checks before the application status is considered impaired. The value must be greater than 0.

iv_successthreshold TYPE /AWS1/EC2INTEGER /AWS1/EC2INTEGER

The number of consecutive successful health checks before the application status is considered healthy. The value must be greater than 0.

iv_statuscodematcher TYPE /AWS1/EC2STRING /AWS1/EC2STRING

The HTTP status codes that indicate a successful health check response. Specify a comma-separated list of individual status codes or ranges, for example, 200,202,300-399. For a range, the first value must be less than the second value. Maximum length: 64 characters. Default: 200.

iv_initgraceperiodseconds TYPE /AWS1/EC2INITGRACEPERIODSECS /AWS1/EC2INITGRACEPERIODSECS

The number of seconds to wait before starting health checks after an instance is launched. Valid values: 1 to 600.

it_tagspecifications TYPE /AWS1/CL_EC2TAGSPECIFICATION=>TT_TAGSPECIFICATIONLIST TT_TAGSPECIFICATIONLIST

The tags to apply to the application status check.

iv_clienttoken TYPE /AWS1/EC2STRING /AWS1/EC2STRING

Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see Ensuring idempotency.

iv_dryrun TYPE /AWS1/EC2BOOLEAN /AWS1/EC2BOOLEAN

Checks whether you have the required permissions for the operation, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

RETURNING

oo_output TYPE REF TO /aws1/cl_ec2creappstatchkrslt /AWS1/CL_EC2CREAPPSTATCHKRSLT

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->createapplicationstatuscheck(
  it_healthcheckpaths = VALUE /aws1/cl_ec2hlthchkpathreqobj=>tt_healthcheckpathrequestlist(
    (
      new /aws1/cl_ec2hlthchkpathreqobj(
        io_source = new /aws1/cl_ec2hlthchkpathsrcre00(
          iv_securitygroupid = |string|
          iv_subnetid = |string|
        )
        it_destinations = VALUE /aws1/cl_ec2hlthchkpathdstre00=>tt_healthcheckpathdstreqset(
          (
            new /aws1/cl_ec2hlthchkpathdstre00(
              iv_securitygroupid = |string|
              iv_subnetid = |string|
            )
          )
        )
      )
    )
  )
  it_tagspecifications = VALUE /aws1/cl_ec2tagspecification=>tt_tagspecificationlist(
    (
      new /aws1/cl_ec2tagspecification(
        it_tags = VALUE /aws1/cl_ec2tag=>tt_taglist(
          (
            new /aws1/cl_ec2tag(
              iv_key = |string|
              iv_value = |string|
            )
          )
        )
        iv_resourcetype = |string|
      )
    )
  )
  iv_aggregation = |string|
  iv_clienttoken = |string|
  iv_deviceindex = 123
  iv_dryrun = ABAP_TRUE
  iv_failurethreshold = 123
  iv_initgraceperiodseconds = 123
  iv_interval = 123
  iv_ipscope = |string|
  iv_ipversion = |string|
  iv_path = |string|
  iv_port = 123
  iv_protocol = |string|
  iv_statuscodematcher = |string|
  iv_successthreshold = 123
  iv_timeout = 123
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lo_applicationstatuscheckr = lo_result->get_applicationstatuscheck( ).
  IF lo_applicationstatuscheckr IS NOT INITIAL.
    lv_applicationstatuschecki = lo_applicationstatuscheckr->get_applicationstatuscheckid( ).
    lv_aggregationstatusenum = lo_applicationstatuscheckr->get_aggregation( ).
    LOOP AT lo_applicationstatuscheckr->get_healthcheckpaths( ) into lo_row.
      lo_row_1 = lo_row.
      IF lo_row_1 IS NOT INITIAL.
        lo_healthcheckpathsourcere = lo_row_1->get_source( ).
        IF lo_healthcheckpathsourcere IS NOT INITIAL.
          lv_string = lo_healthcheckpathsourcere->get_subnetid( ).
          lv_string = lo_healthcheckpathsourcere->get_securitygroupid( ).
        ENDIF.
        LOOP AT lo_row_1->get_destinations( ) into lo_row_2.
          lo_row_3 = lo_row_2.
          IF lo_row_3 IS NOT INITIAL.
            lv_string = lo_row_3->get_subnetid( ).
            lv_string = lo_row_3->get_securitygroupid( ).
          ENDIF.
        ENDLOOP.
      ENDIF.
    ENDLOOP.
    lv_networkprotocolenum = lo_applicationstatuscheckr->get_protocol( ).
    lv_integer = lo_applicationstatuscheckr->get_port( ).
    lv_string = lo_applicationstatuscheckr->get_path( ).
    lv_integer = lo_applicationstatuscheckr->get_deviceindex( ).
    lv_ipversionenum = lo_applicationstatuscheckr->get_ipversion( ).
    lv_ipscopeenum = lo_applicationstatuscheckr->get_ipscope( ).
    lv_integer = lo_applicationstatuscheckr->get_interval( ).
    lv_integer = lo_applicationstatuscheckr->get_timeout( ).
    lv_integer = lo_applicationstatuscheckr->get_failurethreshold( ).
    lv_integer = lo_applicationstatuscheckr->get_successthreshold( ).
    lv_string = lo_applicationstatuscheckr->get_statuscodematcher( ).
    lv_initializationgraceperi = lo_applicationstatuscheckr->get_initgraceperiodseconds( ).
    lv_milliseconddatetime = lo_applicationstatuscheckr->get_lastupdatedat( ).
    LOOP AT lo_applicationstatuscheckr->get_targettagassociations( ) into lo_row_4.
      lo_row_5 = lo_row_4.
      IF lo_row_5 IS NOT INITIAL.
        lv_string = lo_row_5->get_key( ).
        lv_string = lo_row_5->get_value( ).
      ENDIF.
    ENDLOOP.
    LOOP AT lo_applicationstatuscheckr->get_tags( ) into lo_row_6.
      lo_row_7 = lo_row_6.
      IF lo_row_7 IS NOT INITIAL.
        lv_string = lo_row_7->get_key( ).
        lv_string = lo_row_7->get_value( ).
      ENDIF.
    ENDLOOP.
    lv_milliseconddatetime = lo_applicationstatuscheckr->get_creationtime( ).
    lv_milliseconddatetime = lo_applicationstatuscheckr->get_modifytime( ).
    lv_milliseconddatetime = lo_applicationstatuscheckr->get_deletiontime( ).
  ENDIF.
ENDIF.

To create an application status check

This example creates an application status check that monitors HTTP health on port 80.

DATA(lo_result) = lo_client->createapplicationstatuscheck(
  iv_aggregation = |included|
  iv_path = |/health|
  iv_port = 80
  iv_protocol = |http|
).