Skip to content

/AWS1/IF_EKS=>REGISTERCLUSTER()

About RegisterCluster

Connects a Kubernetes cluster to the Amazon EKS control plane.

Any Kubernetes cluster can be connected to the Amazon EKS control plane to view current information about the cluster and its nodes.

Cluster connection requires two steps. First, send a RegisterClusterRequest to add it to the Amazon EKS control plane.

Second, a Manifest containing the activationID and activationCode must be applied to the Kubernetes cluster through it's native provider to provide visibility.

After the manifest is updated and applied, the connected cluster is visible to the Amazon EKS control plane. If the manifest isn't applied within three days, the connected cluster will no longer be visible and must be deregistered using DeregisterCluster.

Method Signature

METHODS /AWS1/IF_EKS~REGISTERCLUSTER
  IMPORTING
    !IV_NAME TYPE /AWS1/EKSCLUSTERNAME OPTIONAL
    !IO_CONNECTORCONFIG TYPE REF TO /AWS1/CL_EKSCNCTORCONFIGREQ OPTIONAL
    !IV_CLIENTREQUESTTOKEN TYPE /AWS1/EKSSTRING OPTIONAL
    !IT_TAGS TYPE /AWS1/CL_EKSTAGMAP_W=>TT_TAGMAP OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_eksregclusterresponse
  RAISING
    /AWS1/CX_EKSACCESSDENIEDEX
    /AWS1/CX_EKSCLIENTEXCEPTION
    /AWS1/CX_EKSINVALIDPARAMETEREX
    /AWS1/CX_EKSRESOURCEINUSEEX
    /AWS1/CX_EKSRESRCLIMITEXCDEX
    /AWS1/CX_EKSRESRCPROPAGATION00
    /AWS1/CX_EKSSERVEREXCEPTION
    /AWS1/CX_EKSSERVICEUNAVAILEX
    /AWS1/CX_EKSCLIENTEXC
    /AWS1/CX_EKSSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_name TYPE /AWS1/EKSCLUSTERNAME /AWS1/EKSCLUSTERNAME

A unique name for this cluster in your Amazon Web Services Region.

io_connectorconfig TYPE REF TO /AWS1/CL_EKSCNCTORCONFIGREQ /AWS1/CL_EKSCNCTORCONFIGREQ

The configuration settings required to connect the Kubernetes cluster to the Amazon EKS control plane.

Optional arguments:

iv_clientrequesttoken TYPE /AWS1/EKSSTRING /AWS1/EKSSTRING

A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

it_tags TYPE /AWS1/CL_EKSTAGMAP_W=>TT_TAGMAP TT_TAGMAP

Metadata that assists with categorization and organization. Each tag consists of a key and an optional value. You define both. Tags don't propagate to any other cluster or Amazon Web Services resources.

RETURNING

oo_output TYPE REF TO /aws1/cl_eksregclusterresponse /AWS1/CL_EKSREGCLUSTERRESPONSE

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->registercluster(
  io_connectorconfig = new /aws1/cl_ekscnctorconfigreq(
    iv_provider = |string|
    iv_rolearn = |string|
  )
  it_tags = VALUE /aws1/cl_ekstagmap_w=>tt_tagmap(
    (
      VALUE /aws1/cl_ekstagmap_w=>ts_tagmap_maprow(
        key = |string|
        value = new /aws1/cl_ekstagmap_w( |string| )
      )
    )
  )
  iv_clientrequesttoken = |string|
  iv_name = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lo_cluster = lo_result->get_cluster( ).
  IF lo_cluster IS NOT INITIAL.
    lv_string = lo_cluster->get_name( ).
    lv_string = lo_cluster->get_arn( ).
    lv_timestamp = lo_cluster->get_createdat( ).
    lv_string = lo_cluster->get_version( ).
    lv_string = lo_cluster->get_endpoint( ).
    lv_string = lo_cluster->get_rolearn( ).
    lo_vpcconfigresponse = lo_cluster->get_resourcesvpcconfig( ).
    IF lo_vpcconfigresponse IS NOT INITIAL.
      LOOP AT lo_vpcconfigresponse->get_subnetids( ) into lo_row.
        lo_row_1 = lo_row.
        IF lo_row_1 IS NOT INITIAL.
          lv_string = lo_row_1->get_value( ).
        ENDIF.
      ENDLOOP.
      LOOP AT lo_vpcconfigresponse->get_securitygroupids( ) into lo_row.
        lo_row_1 = lo_row.
        IF lo_row_1 IS NOT INITIAL.
          lv_string = lo_row_1->get_value( ).
        ENDIF.
      ENDLOOP.
      lv_string = lo_vpcconfigresponse->get_clustersecuritygroupid( ).
      lv_string = lo_vpcconfigresponse->get_vpcid( ).
      lv_boolean = lo_vpcconfigresponse->get_endpointpublicaccess( ).
      lv_boolean = lo_vpcconfigresponse->get_endpointprivateaccess( ).
      LOOP AT lo_vpcconfigresponse->get_publicaccesscidrs( ) into lo_row.
        lo_row_1 = lo_row.
        IF lo_row_1 IS NOT INITIAL.
          lv_string = lo_row_1->get_value( ).
        ENDIF.
      ENDLOOP.
    ENDIF.
    lo_kubernetesnetworkconfig = lo_cluster->get_kubernetesnetworkconfig( ).
    IF lo_kubernetesnetworkconfig IS NOT INITIAL.
      lv_string = lo_kubernetesnetworkconfig->get_serviceipv4cidr( ).
      lv_string = lo_kubernetesnetworkconfig->get_serviceipv6cidr( ).
      lv_ipfamily = lo_kubernetesnetworkconfig->get_ipfamily( ).
      lo_elasticloadbalancing = lo_kubernetesnetworkconfig->get_elasticloadbalancing( ).
      IF lo_elasticloadbalancing IS NOT INITIAL.
        lv_boxedboolean = lo_elasticloadbalancing->get_enabled( ).
      ENDIF.
    ENDIF.
    lo_logging = lo_cluster->get_logging( ).
    IF lo_logging IS NOT INITIAL.
      LOOP AT lo_logging->get_clusterlogging( ) into lo_row_2.
        lo_row_3 = lo_row_2.
        IF lo_row_3 IS NOT INITIAL.
          LOOP AT lo_row_3->get_types( ) into lo_row_4.
            lo_row_5 = lo_row_4.
            IF lo_row_5 IS NOT INITIAL.
              lv_logtype = lo_row_5->get_value( ).
            ENDIF.
          ENDLOOP.
          lv_boxedboolean = lo_row_3->get_enabled( ).
        ENDIF.
      ENDLOOP.
    ENDIF.
    lo_identity = lo_cluster->get_identity( ).
    IF lo_identity IS NOT INITIAL.
      lo_oidc = lo_identity->get_oidc( ).
      IF lo_oidc IS NOT INITIAL.
        lv_string = lo_oidc->get_issuer( ).
      ENDIF.
    ENDIF.
    lv_clusterstatus = lo_cluster->get_status( ).
    lo_certificate = lo_cluster->get_certificateauthority( ).
    IF lo_certificate IS NOT INITIAL.
      lv_string = lo_certificate->get_data( ).
    ENDIF.
    lv_string = lo_cluster->get_clientrequesttoken( ).
    lv_string = lo_cluster->get_platformversion( ).
    LOOP AT lo_cluster->get_tags( ) into ls_row_6.
      lv_key = ls_row_6-key.
      lo_value = ls_row_6-value.
      IF lo_value IS NOT INITIAL.
        lv_tagvalue = lo_value->get_value( ).
      ENDIF.
    ENDLOOP.
    LOOP AT lo_cluster->get_encryptionconfig( ) into lo_row_7.
      lo_row_8 = lo_row_7.
      IF lo_row_8 IS NOT INITIAL.
        LOOP AT lo_row_8->get_resources( ) into lo_row.
          lo_row_1 = lo_row.
          IF lo_row_1 IS NOT INITIAL.
            lv_string = lo_row_1->get_value( ).
          ENDIF.
        ENDLOOP.
        lo_provider = lo_row_8->get_provider( ).
        IF lo_provider IS NOT INITIAL.
          lv_string = lo_provider->get_keyarn( ).
        ENDIF.
      ENDIF.
    ENDLOOP.
    lo_connectorconfigresponse = lo_cluster->get_connectorconfig( ).
    IF lo_connectorconfigresponse IS NOT INITIAL.
      lv_string = lo_connectorconfigresponse->get_activationid( ).
      lv_string = lo_connectorconfigresponse->get_activationcode( ).
      lv_timestamp = lo_connectorconfigresponse->get_activationexpiry( ).
      lv_string = lo_connectorconfigresponse->get_provider( ).
      lv_string = lo_connectorconfigresponse->get_rolearn( ).
    ENDIF.
    lv_string = lo_cluster->get_id( ).
    lo_clusterhealth = lo_cluster->get_health( ).
    IF lo_clusterhealth IS NOT INITIAL.
      LOOP AT lo_clusterhealth->get_issues( ) into lo_row_9.
        lo_row_10 = lo_row_9.
        IF lo_row_10 IS NOT INITIAL.
          lv_clusterissuecode = lo_row_10->get_code( ).
          lv_string = lo_row_10->get_message( ).
          LOOP AT lo_row_10->get_resourceids( ) into lo_row.
            lo_row_1 = lo_row.
            IF lo_row_1 IS NOT INITIAL.
              lv_string = lo_row_1->get_value( ).
            ENDIF.
          ENDLOOP.
        ENDIF.
      ENDLOOP.
    ENDIF.
    lo_outpostconfigresponse = lo_cluster->get_outpostconfig( ).
    IF lo_outpostconfigresponse IS NOT INITIAL.
      LOOP AT lo_outpostconfigresponse->get_outpostarns( ) into lo_row.
        lo_row_1 = lo_row.
        IF lo_row_1 IS NOT INITIAL.
          lv_string = lo_row_1->get_value( ).
        ENDIF.
      ENDLOOP.
      lv_string = lo_outpostconfigresponse->get_controlplaneinstancetype( ).
      lo_controlplaneplacementre = lo_outpostconfigresponse->get_controlplaneplacement( ).
      IF lo_controlplaneplacementre IS NOT INITIAL.
        lv_string = lo_controlplaneplacementre->get_groupname( ).
      ENDIF.
    ENDIF.
    lo_accessconfigresponse = lo_cluster->get_accessconfig( ).
    IF lo_accessconfigresponse IS NOT INITIAL.
      lv_boxedboolean = lo_accessconfigresponse->get_bootstrapclstcreatorad00( ).
      lv_authenticationmode = lo_accessconfigresponse->get_authenticationmode( ).
    ENDIF.
    lo_upgradepolicyresponse = lo_cluster->get_upgradepolicy( ).
    IF lo_upgradepolicyresponse IS NOT INITIAL.
      lv_supporttype = lo_upgradepolicyresponse->get_supporttype( ).
    ENDIF.
    lo_zonalshiftconfigrespons = lo_cluster->get_zonalshiftconfig( ).
    IF lo_zonalshiftconfigrespons IS NOT INITIAL.
      lv_boxedboolean = lo_zonalshiftconfigrespons->get_enabled( ).
    ENDIF.
    lo_remotenetworkconfigresp = lo_cluster->get_remotenetworkconfig( ).
    IF lo_remotenetworkconfigresp IS NOT INITIAL.
      LOOP AT lo_remotenetworkconfigresp->get_remotenodenetworks( ) into lo_row_11.
        lo_row_12 = lo_row_11.
        IF lo_row_12 IS NOT INITIAL.
          LOOP AT lo_row_12->get_cidrs( ) into lo_row.
            lo_row_1 = lo_row.
            IF lo_row_1 IS NOT INITIAL.
              lv_string = lo_row_1->get_value( ).
            ENDIF.
          ENDLOOP.
        ENDIF.
      ENDLOOP.
      LOOP AT lo_remotenetworkconfigresp->get_remotepodnetworks( ) into lo_row_13.
        lo_row_14 = lo_row_13.
        IF lo_row_14 IS NOT INITIAL.
          LOOP AT lo_row_14->get_cidrs( ) into lo_row.
            lo_row_1 = lo_row.
            IF lo_row_1 IS NOT INITIAL.
              lv_string = lo_row_1->get_value( ).
            ENDIF.
          ENDLOOP.
        ENDIF.
      ENDLOOP.
    ENDIF.
    lo_computeconfigresponse = lo_cluster->get_computeconfig( ).
    IF lo_computeconfigresponse IS NOT INITIAL.
      lv_boxedboolean = lo_computeconfigresponse->get_enabled( ).
      LOOP AT lo_computeconfigresponse->get_nodepools( ) into lo_row.
        lo_row_1 = lo_row.
        IF lo_row_1 IS NOT INITIAL.
          lv_string = lo_row_1->get_value( ).
        ENDIF.
      ENDLOOP.
      lv_string = lo_computeconfigresponse->get_noderolearn( ).
    ENDIF.
    lo_storageconfigresponse = lo_cluster->get_storageconfig( ).
    IF lo_storageconfigresponse IS NOT INITIAL.
      lo_blockstorage = lo_storageconfigresponse->get_blockstorage( ).
      IF lo_blockstorage IS NOT INITIAL.
        lv_boxedboolean = lo_blockstorage->get_enabled( ).
      ENDIF.
    ENDIF.
    lv_boxedboolean = lo_cluster->get_deletionprotection( ).
    lo_controlplanescalingconf = lo_cluster->get_ctlplanescalingconfig( ).
    IF lo_controlplanescalingconf IS NOT INITIAL.
      lv_provisionedcontrolplane = lo_controlplanescalingconf->get_tier( ).
    ENDIF.
  ENDIF.
ENDIF.