Skip to content

/AWS1/CL_EC2=>DELETELAUNCHTEMPLATE()

About DeleteLaunchTemplate

Deletes a launch template. Deleting a launch template deletes all of its versions.

Method Signature

IMPORTING

Optional arguments:

iv_dryrun TYPE /AWS1/EC2BOOLEAN /AWS1/EC2BOOLEAN

Checks whether you have the required permissions for the action, 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.

iv_launchtemplateid TYPE /AWS1/EC2LAUNCHTEMPLATEID /AWS1/EC2LAUNCHTEMPLATEID

The ID of the launch template.

You must specify either the launch template ID or the launch template name, but not both.

iv_launchtemplatename TYPE /AWS1/EC2LAUNCHTEMPLATENAME /AWS1/EC2LAUNCHTEMPLATENAME

The name of the launch template.

You must specify either the launch template ID or the launch template name, but not both.

RETURNING

oo_output TYPE REF TO /aws1/cl_ec2dellaunchtmplrslt /AWS1/CL_EC2DELLAUNCHTMPLRSLT

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_ec2~deletelaunchtemplate(
  iv_dryrun = ABAP_TRUE
  iv_launchtemplateid = |string|
  iv_launchtemplatename = |string|
).

This is an example of reading all possible response values

lv_string = lo_launchtemplate->get_launchtemplateid( ).
lv_launchtemplatename = lo_launchtemplate->get_launchtemplatename( ).
lv_datetime = lo_launchtemplate->get_createtime( ).
lv_string = lo_launchtemplate->get_createdby( ).
lv_long = lo_launchtemplate->get_defaultversionnumber( ).
lv_long = lo_launchtemplate->get_latestversionnumber( ).
LOOP AT lo_launchtemplate->get_tags( ) into lo_row.
  lv_string = lo_row_1->get_key( ).
  lv_string = lo_row_1->get_value( ).
ENDLOOP.
lv_boolean = lo_operatorresponse->get_managed( ).
lv_string = lo_operatorresponse->get_principal( ).

To delete a launch template

This example deletes the specified launch template.

DATA(lo_result) = lo_client->/aws1/if_ec2~deletelaunchtemplate( iv_launchtemplateid = |lt-0abcd290751193123| ) .