Skip to content

/AWS1/IF_LSA=>UPDATEDISTRIBUTION()

About UpdateDistribution

Updates an existing Amazon Lightsail content delivery network (CDN) distribution.

Use this action to update the configuration of your existing distribution.

Method Signature

METHODS /AWS1/IF_LSA~UPDATEDISTRIBUTION
  IMPORTING
    !IV_DISTRIBUTIONNAME TYPE /AWS1/LSARESOURCENAME OPTIONAL
    !IO_ORIGIN TYPE REF TO /AWS1/CL_LSAINPUTORIGIN OPTIONAL
    !IO_DEFAULTCACHEBEHAVIOR TYPE REF TO /AWS1/CL_LSACACHEBEHAVIOR OPTIONAL
    !IO_CACHEBEHAVIORSETTINGS TYPE REF TO /AWS1/CL_LSACACHESETTINGS OPTIONAL
    !IT_CACHEBEHAVIORS TYPE /AWS1/CL_LSACACHEBEHAVPERPATH=>TT_CACHEBEHAVIORLIST OPTIONAL
    !IV_ISENABLED TYPE /AWS1/LSABOOLEAN OPTIONAL
    !IV_VIEWERMINTLSPROTOCOLVRS TYPE /AWS1/LSAVIEWERMINTLSPROTOCO00 OPTIONAL
    !IV_CERTIFICATENAME TYPE /AWS1/LSARESOURCENAME OPTIONAL
    !IV_USEDEFAULTCERTIFICATE TYPE /AWS1/LSABOOLEAN OPTIONAL
    !IV_ENABLEPRIVATEORIGINACCESS TYPE /AWS1/LSABOOLEAN OPTIONAL
    !IV_DEFAULTROOTOBJECT TYPE /AWS1/LSASTRING OPTIONAL
    !IT_CUSTOMERRORRESPONSES TYPE /AWS1/CL_LSADISTRIBCUSRORRSP=>TT_DISTRIBCUSRORRESPONSELIST OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_lsaupdistributionrs
  RAISING
    /AWS1/CX_LSAACCESSDENIEDEX
    /AWS1/CX_LSAINVALIDINPUTEX
    /AWS1/CX_LSANOTFOUNDEXCEPTION
    /AWS1/CX_LSAOPERATIONFAILUREEX
    /AWS1/CX_LSASERVICEEXCEPTION
    /AWS1/CX_LSAUNAUTHNTCTDEX
    /AWS1/CX_LSACLIENTEXC
    /AWS1/CX_LSASERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_distributionname TYPE /AWS1/LSARESOURCENAME /AWS1/LSARESOURCENAME

The name of the distribution to update.

Use the GetDistributions action to get a list of distribution names that you can specify.

Optional arguments:

io_origin TYPE REF TO /AWS1/CL_LSAINPUTORIGIN /AWS1/CL_LSAINPUTORIGIN

An object that describes the origin resource for the distribution, such as a Lightsail instance, bucket, or load balancer.

The distribution pulls, caches, and serves content from the origin.

io_defaultcachebehavior TYPE REF TO /AWS1/CL_LSACACHEBEHAVIOR /AWS1/CL_LSACACHEBEHAVIOR

An object that describes the default cache behavior for the distribution.

io_cachebehaviorsettings TYPE REF TO /AWS1/CL_LSACACHESETTINGS /AWS1/CL_LSACACHESETTINGS

An object that describes the cache behavior settings for the distribution.

The cacheBehaviorSettings specified in your UpdateDistributionRequest will replace your distribution's existing settings.

it_cachebehaviors TYPE /AWS1/CL_LSACACHEBEHAVPERPATH=>TT_CACHEBEHAVIORLIST TT_CACHEBEHAVIORLIST

An array of objects that describe the per-path cache behavior for the distribution.

iv_isenabled TYPE /AWS1/LSABOOLEAN /AWS1/LSABOOLEAN

Indicates whether to enable the distribution.

iv_viewermintlsprotocolvrs TYPE /AWS1/LSAVIEWERMINTLSPROTOCO00 /AWS1/LSAVIEWERMINTLSPROTOCO00

Use this parameter to update the minimum TLS protocol version for the SSL/TLS certificate that's attached to the distribution.

iv_certificatename TYPE /AWS1/LSARESOURCENAME /AWS1/LSARESOURCENAME

The name of the SSL/TLS certificate that you want to attach to the distribution.

Only certificates with a status of ISSUED can be attached to a distribution.

Use the GetCertificates action to get a list of certificate names that you can specify.

iv_usedefaultcertificate TYPE /AWS1/LSABOOLEAN /AWS1/LSABOOLEAN

Indicates whether the default SSL/TLS certificate is attached to the distribution. The default value is true. When true, the distribution uses the default domain name such as d111111abcdef8.cloudfront.net.

Set this value to false to attach a new certificate to the distribution.

iv_enableprivateoriginaccess TYPE /AWS1/LSABOOLEAN /AWS1/LSABOOLEAN

Specifies whether to enable private origin access for the distribution. With private origin access, the distribution can serve objects that aren't publicly accessible from a Lightsail bucket.

Lightsail grants the distribution permission to read the bucket's objects. Enabling private origin access doesn't change the bucket's access settings, and you can still retrieve publicly accessible objects directly from the bucket's endpoint.

When you include this parameter, you must also include the origin parameter with the resource name, even if the origin is not changing.

You can enable private origin access only when the distribution's origin is a Lightsail bucket. If the origin is another resource type, the request fails.

iv_defaultrootobject TYPE /AWS1/LSASTRING /AWS1/LSASTRING

The object (for example, index.html) that the distribution returns when a viewer requests the root URL of the distribution (/) instead of a specific object. The object that you specify must be available from the origin.

it_customerrorresponses TYPE /AWS1/CL_LSADISTRIBCUSRORRSP=>TT_DISTRIBCUSRORRESPONSELIST TT_DISTRIBCUSRORRESPONSELIST

An array of objects that describe the custom error responses for the distribution. With a custom error response, you can specify the page to return when the origin responds with a given HTTP error code. You can also specify the HTTP status code to send to the viewer.

RETURNING

oo_output TYPE REF TO /aws1/cl_lsaupdistributionrs /AWS1/CL_LSAUPDISTRIBUTIONRS

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->updatedistribution(
  io_cachebehaviorsettings = new /aws1/cl_lsacachesettings(
    io_forwardedcookies = new /aws1/cl_lsacookieobject(
      it_cookiesallowlist = VALUE /aws1/cl_lsastringlist_w=>tt_stringlist(
        ( new /aws1/cl_lsastringlist_w( |string| ) )
      )
      iv_option = |string|
    )
    io_forwardedheaders = new /aws1/cl_lsaheaderobject(
      it_headersallowlist = VALUE /aws1/cl_lsaheaderforwardlst_w=>tt_headerforwardlist(
        ( new /aws1/cl_lsaheaderforwardlst_w( |string| ) )
      )
      iv_option = |string|
    )
    io_forwardedquerystrings = new /aws1/cl_lsaquerystringobject(
      it_querystringsallowlist = VALUE /aws1/cl_lsastringlist_w=>tt_stringlist(
        ( new /aws1/cl_lsastringlist_w( |string| ) )
      )
      iv_option = ABAP_TRUE
    )
    iv_allowedhttpmethods = |string|
    iv_cachedhttpmethods = |string|
    iv_defaultttl = 123
    iv_maximumttl = 123
    iv_minimumttl = 123
  )
  io_defaultcachebehavior = new /aws1/cl_lsacachebehavior( |string| )
  io_origin = new /aws1/cl_lsainputorigin(
    iv_ipaddresstype = |string|
    iv_name = |string|
    iv_protocolpolicy = |string|
    iv_regionname = |string|
    iv_responsetimeout = 123
  )
  it_cachebehaviors = VALUE /aws1/cl_lsacachebehavperpath=>tt_cachebehaviorlist(
    (
      new /aws1/cl_lsacachebehavperpath(
        iv_behavior = |string|
        iv_path = |string|
      )
    )
  )
  it_customerrorresponses = VALUE /aws1/cl_lsadistribcusrorrsp=>tt_distribcusrorresponselist(
    (
      new /aws1/cl_lsadistribcusrorrsp(
        iv_errorcachingminttl = 123
        iv_errorcode = 123
        iv_responsecode = |string|
        iv_responsepagepath = |string|
      )
    )
  )
  iv_certificatename = |string|
  iv_defaultrootobject = |string|
  iv_distributionname = |string|
  iv_enableprivateoriginaccess = ABAP_TRUE
  iv_isenabled = ABAP_TRUE
  iv_usedefaultcertificate = ABAP_TRUE
  iv_viewermintlsprotocolvrs = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lo_operation = lo_result->get_operation( ).
  IF lo_operation IS NOT INITIAL.
    lv_nonemptystring = lo_operation->get_id( ).
    lv_resourcename = lo_operation->get_resourcename( ).
    lv_resourcetype = lo_operation->get_resourcetype( ).
    lv_isodate = lo_operation->get_createdat( ).
    lo_resourcelocation = lo_operation->get_location( ).
    IF lo_resourcelocation IS NOT INITIAL.
      lv_string = lo_resourcelocation->get_availabilityzone( ).
      lv_regionname = lo_resourcelocation->get_regionname( ).
    ENDIF.
    lv_boolean = lo_operation->get_isterminal( ).
    lv_string = lo_operation->get_operationdetails( ).
    lv_operationtype = lo_operation->get_operationtype( ).
    lv_operationstatus = lo_operation->get_status( ).
    lv_isodate = lo_operation->get_statuschangedat( ).
    lv_string = lo_operation->get_errorcode( ).
    lv_string = lo_operation->get_errordetails( ).
  ENDIF.
ENDIF.