/AWS1/IF_EBN=>CREATEENVIRONMENT()¶
About CreateEnvironment¶
Launches an AWS Elastic Beanstalk environment for the specified application using the specified configuration.
Method Signature¶
METHODS /AWS1/IF_EBN~CREATEENVIRONMENT
IMPORTING
!IV_APPLICATIONNAME TYPE /AWS1/EBNAPPLICATIONNAME OPTIONAL
!IV_ENVIRONMENTNAME TYPE /AWS1/EBNENVIRONMENTNAME OPTIONAL
!IV_GROUPNAME TYPE /AWS1/EBNGROUPNAME OPTIONAL
!IV_DESCRIPTION TYPE /AWS1/EBNDESCRIPTION OPTIONAL
!IV_CNAMEPREFIX TYPE /AWS1/EBNDNSCNAMEPREFIX OPTIONAL
!IO_TIER TYPE REF TO /AWS1/CL_EBNENVIRONMENTTIER OPTIONAL
!IT_TAGS TYPE /AWS1/CL_EBNTAG=>TT_TAGS OPTIONAL
!IV_VERSIONLABEL TYPE /AWS1/EBNVERSIONLABEL OPTIONAL
!IV_TEMPLATENAME TYPE /AWS1/EBNCONFTEMPLATENAME OPTIONAL
!IV_SOLUTIONSTACKNAME TYPE /AWS1/EBNSOLUTIONSTACKNAME OPTIONAL
!IV_PLATFORMARN TYPE /AWS1/EBNPLATFORMARN OPTIONAL
!IT_OPTIONSETTINGS TYPE /AWS1/CL_EBNCONFOPTIONSETTING=>TT_CONFOPTIONSETTINGSLIST OPTIONAL
!IT_OPTIONSTOREMOVE TYPE /AWS1/CL_EBNOPTIONSPEC=>TT_OPTIONSSPECIFIERLIST OPTIONAL
!IV_OPERATIONSROLE TYPE /AWS1/EBNOPERATIONSROLE OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_ebnenvironmentdesc
RAISING
/AWS1/CX_EBNINSUFFICIENTPRIV00
/AWS1/CX_EBNTOOMANYENVIRONME00
/AWS1/CX_EBNCLIENTEXC
/AWS1/CX_EBNSERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
iv_applicationname TYPE /AWS1/EBNAPPLICATIONNAME /AWS1/EBNAPPLICATIONNAME¶
The name of the application that is associated with this environment.
Optional arguments:¶
iv_environmentname TYPE /AWS1/EBNENVIRONMENTNAME /AWS1/EBNENVIRONMENTNAME¶
A unique name for the environment.
Constraint: Must be from 4 to 40 characters in length. The name can contain only letters, numbers, and hyphens. It can't start or end with a hyphen. This name must be unique within a region in your account. If the specified name already exists in the region, Elastic Beanstalk returns an
InvalidParameterValueerror.If you don't specify the
CNAMEPrefixparameter, the environment name becomes part of the CNAME, and therefore part of the visible URL for your application.
iv_groupname TYPE /AWS1/EBNGROUPNAME /AWS1/EBNGROUPNAME¶
The name of the group to which the target environment belongs. Specify a group name only if the environment's name is specified in an environment manifest and not with the environment name parameter. See Environment Manifest (env.yaml) for details.
iv_description TYPE /AWS1/EBNDESCRIPTION /AWS1/EBNDESCRIPTION¶
Your description for this environment.
iv_cnameprefix TYPE /AWS1/EBNDNSCNAMEPREFIX /AWS1/EBNDNSCNAMEPREFIX¶
If specified, the environment attempts to use this value as the prefix for the CNAME in your Elastic Beanstalk environment URL. If not specified, the CNAME is generated automatically by appending a random alphanumeric string to the environment name.
io_tier TYPE REF TO /AWS1/CL_EBNENVIRONMENTTIER /AWS1/CL_EBNENVIRONMENTTIER¶
Specifies the tier to use in creating this environment. The environment tier that you choose determines whether Elastic Beanstalk provisions resources to support a web application that handles HTTP(S) requests or a web application that handles background-processing tasks.
it_tags TYPE /AWS1/CL_EBNTAG=>TT_TAGS TT_TAGS¶
Specifies the tags applied to resources in the environment.
iv_versionlabel TYPE /AWS1/EBNVERSIONLABEL /AWS1/EBNVERSIONLABEL¶
The name of the application version to deploy.
Default: If not specified, Elastic Beanstalk attempts to deploy the sample application.
iv_templatename TYPE /AWS1/EBNCONFTEMPLATENAME /AWS1/EBNCONFTEMPLATENAME¶
The name of the Elastic Beanstalk configuration template to use with the environment.
If you specify
TemplateName, then don't specifySolutionStackName.
iv_solutionstackname TYPE /AWS1/EBNSOLUTIONSTACKNAME /AWS1/EBNSOLUTIONSTACKNAME¶
The name of an Elastic Beanstalk solution stack (platform version) to use with the environment. If specified, Elastic Beanstalk sets the configuration values to the default values associated with the specified solution stack. For a list of current solution stacks, see Elastic Beanstalk Supported Platforms in the AWS Elastic Beanstalk Platforms guide.
If you specify
SolutionStackName, don't specifyPlatformArnorTemplateName.
iv_platformarn TYPE /AWS1/EBNPLATFORMARN /AWS1/EBNPLATFORMARN¶
The Amazon Resource Name (ARN) of the custom platform to use with the environment. For more information, see Custom Platforms in the AWS Elastic Beanstalk Developer Guide.
If you specify
PlatformArn, don't specifySolutionStackName.
it_optionsettings TYPE /AWS1/CL_EBNCONFOPTIONSETTING=>TT_CONFOPTIONSETTINGSLIST TT_CONFOPTIONSETTINGSLIST¶
If specified, AWS Elastic Beanstalk sets the specified configuration options to the requested value in the configuration set for the new environment. These override the values obtained from the solution stack or the configuration template.
it_optionstoremove TYPE /AWS1/CL_EBNOPTIONSPEC=>TT_OPTIONSSPECIFIERLIST TT_OPTIONSSPECIFIERLIST¶
A list of custom user-defined configuration options to remove from the configuration set for this new environment.
iv_operationsrole TYPE /AWS1/EBNOPERATIONSROLE /AWS1/EBNOPERATIONSROLE¶
The Amazon Resource Name (ARN) of an existing IAM role to be used as the environment's operations role. If specified, Elastic Beanstalk uses the operations role for permissions to downstream services during this call and during subsequent calls acting on this environment. To specify an operations role, you must have the
iam:PassRolepermission for the role. For more information, see Operations roles in the AWS Elastic Beanstalk Developer Guide.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_ebnenvironmentdesc /AWS1/CL_EBNENVIRONMENTDESC¶
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(
io_tier = new /aws1/cl_ebnenvironmenttier(
iv_name = |string|
iv_type = |string|
iv_version = |string|
)
it_optionsettings = VALUE /aws1/cl_ebnconfoptionsetting=>tt_confoptionsettingslist(
(
new /aws1/cl_ebnconfoptionsetting(
iv_namespace = |string|
iv_optionname = |string|
iv_resourcename = |string|
iv_value = |string|
)
)
)
it_optionstoremove = VALUE /aws1/cl_ebnoptionspec=>tt_optionsspecifierlist(
(
new /aws1/cl_ebnoptionspec(
iv_namespace = |string|
iv_optionname = |string|
iv_resourcename = |string|
)
)
)
it_tags = VALUE /aws1/cl_ebntag=>tt_tags(
(
new /aws1/cl_ebntag(
iv_key = |string|
iv_value = |string|
)
)
)
iv_applicationname = |string|
iv_cnameprefix = |string|
iv_description = |string|
iv_environmentname = |string|
iv_groupname = |string|
iv_operationsrole = |string|
iv_platformarn = |string|
iv_solutionstackname = |string|
iv_templatename = |string|
iv_versionlabel = |string|
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
lv_environmentname = lo_result->get_environmentname( ).
lv_environmentid = lo_result->get_environmentid( ).
lv_applicationname = lo_result->get_applicationname( ).
lv_versionlabel = lo_result->get_versionlabel( ).
lv_solutionstackname = lo_result->get_solutionstackname( ).
lv_platformarn = lo_result->get_platformarn( ).
lv_configurationtemplatena = lo_result->get_templatename( ).
lv_description = lo_result->get_description( ).
lv_endpointurl = lo_result->get_endpointurl( ).
lv_dnscname = lo_result->get_cname( ).
lv_creationdate = lo_result->get_datecreated( ).
lv_updatedate = lo_result->get_dateupdated( ).
lv_environmentstatus = lo_result->get_status( ).
lv_abortableoperationinpro = lo_result->get_abortableopinprogress( ).
lv_environmenthealth = lo_result->get_health( ).
lv_environmenthealthstatus = lo_result->get_healthstatus( ).
lo_environmentresourcesdes = lo_result->get_resources( ).
IF lo_environmentresourcesdes IS NOT INITIAL.
lo_loadbalancerdescription = lo_environmentresourcesdes->get_loadbalancer( ).
IF lo_loadbalancerdescription IS NOT INITIAL.
lv_string = lo_loadbalancerdescription->get_loadbalancername( ).
lv_string = lo_loadbalancerdescription->get_domain( ).
LOOP AT lo_loadbalancerdescription->get_listeners( ) into lo_row.
lo_row_1 = lo_row.
IF lo_row_1 IS NOT INITIAL.
lv_string = lo_row_1->get_protocol( ).
lv_integer = lo_row_1->get_port( ).
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
lo_environmenttier = lo_result->get_tier( ).
IF lo_environmenttier IS NOT INITIAL.
lv_string = lo_environmenttier->get_name( ).
lv_string = lo_environmenttier->get_type( ).
lv_string = lo_environmenttier->get_version( ).
ENDIF.
LOOP AT lo_result->get_environmentlinks( ) into lo_row_2.
lo_row_3 = lo_row_2.
IF lo_row_3 IS NOT INITIAL.
lv_string = lo_row_3->get_linkname( ).
lv_string = lo_row_3->get_environmentname( ).
ENDIF.
ENDLOOP.
lv_environmentarn = lo_result->get_environmentarn( ).
lv_operationsrole = lo_result->get_operationsrole( ).
ENDIF.
To create a new environment for an application¶
The following operation creates a new environment for version v1 of a java application named my-app:
DATA(lo_result) = lo_client->createenvironment(
iv_applicationname = |my-app|
iv_cnameprefix = |my-app|
iv_environmentname = |my-env|
iv_solutionstackname = |64bit Amazon Linux 2015.03 v2.0.0 running Tomcat 8 Java 8|
iv_versionlabel = |v1|
).