/AWS1/IF_PRN=>UPDATEENVIRONMENT()¶
About UpdateEnvironment¶
Update an environment.
If the environment is associated with an environment account connection, don't update or include the
protonServiceRoleArn and provisioningRepository parameter to update or connect to an environment account connection.
You can only update to a new environment account connection if that connection was created in the same environment account that the current environment account connection was created in. The account connection must also be associated with the current environment.
If the environment isn't associated with an environment account connection, don't update or include the
environmentAccountConnectionId parameter. You can't update or connect the environment to an environment account
connection if it isn't already associated with an environment connection.
You can update either the environmentAccountConnectionId or protonServiceRoleArn parameter and value. You can’t update
both.
If the environment was configured for Amazon Web Services-managed provisioning, omit the provisioningRepository parameter.
If the environment was configured for self-managed provisioning, specify the provisioningRepository parameter and omit the
protonServiceRoleArn and environmentAccountConnectionId parameters.
For more information, see Environments and Provisioning methods in the Proton User Guide.
There are four modes for updating an environment. The deploymentType field defines the mode.
-
NONEIn this mode, a deployment doesn't occur. Only the requested metadata parameters are updated.
-
CURRENT_VERSIONIn this mode, the environment is deployed and updated with the new spec that you provide. Only requested parameters are updated. Don’t include minor or major version parameters when you use this
deployment-type. -
MINOR_VERSIONIn this mode, the environment is deployed and updated with the published, recommended (latest) minor version of the current major version in use, by default. You can also specify a different minor version of the current major version in use.
-
MAJOR_VERSIONIn this mode, the environment is deployed and updated with the published, recommended (latest) major and minor version of the current template, by default. You can also specify a different major version that's higher than the major version in use and a minor version.
Method Signature¶
METHODS /AWS1/IF_PRN~UPDATEENVIRONMENT
IMPORTING
!IV_NAME TYPE /AWS1/PRNRESOURCENAME OPTIONAL
!IV_DESCRIPTION TYPE /AWS1/PRNDESCRIPTION OPTIONAL
!IV_SPEC TYPE /AWS1/PRNSPECCONTENTS OPTIONAL
!IV_TEMPLATEMAJORVERSION TYPE /AWS1/PRNTEMPLATEVERSIONPART OPTIONAL
!IV_TEMPLATEMINORVERSION TYPE /AWS1/PRNTEMPLATEVERSIONPART OPTIONAL
!IV_PROTONSERVICEROLEARN TYPE /AWS1/PRNARN OPTIONAL
!IV_DEPLOYMENTTYPE TYPE /AWS1/PRNDEPLOYMENTUPDATETYPE OPTIONAL
!IV_ENVIRONMENTACCOUNTCONNID TYPE /AWS1/PRNENVIRONMENTACCTCONNID OPTIONAL
!IO_PROVISIONINGREPOSITORY TYPE REF TO /AWS1/CL_PRNREPOSITORYBRANCH00 OPTIONAL
!IV_COMPONENTROLEARN TYPE /AWS1/PRNROLEARN OPTIONAL
!IV_CODEBUILDROLEARN TYPE /AWS1/PRNROLEARN OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_prnupdenvironmentout
RAISING
/AWS1/CX_PRNACCESSDENIEDEX
/AWS1/CX_PRNCONFLICTEXCEPTION
/AWS1/CX_PRNINTERNALSERVEREX
/AWS1/CX_PRNRESOURCENOTFOUNDEX
/AWS1/CX_PRNTHROTTLINGEX
/AWS1/CX_PRNVALIDATIONEX
/AWS1/CX_PRNCLIENTEXC
/AWS1/CX_PRNSERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
iv_name TYPE /AWS1/PRNRESOURCENAME /AWS1/PRNRESOURCENAME¶
The name of the environment to update.
iv_deploymenttype TYPE /AWS1/PRNDEPLOYMENTUPDATETYPE /AWS1/PRNDEPLOYMENTUPDATETYPE¶
There are four modes for updating an environment. The
deploymentTypefield defines the mode.
NONEIn this mode, a deployment doesn't occur. Only the requested metadata parameters are updated.
CURRENT_VERSIONIn this mode, the environment is deployed and updated with the new spec that you provide. Only requested parameters are updated. Don’t include major or minor version parameters when you use this
deployment-type.
MINOR_VERSIONIn this mode, the environment is deployed and updated with the published, recommended (latest) minor version of the current major version in use, by default. You can also specify a different minor version of the current major version in use.
MAJOR_VERSIONIn this mode, the environment is deployed and updated with the published, recommended (latest) major and minor version of the current template, by default. You can also specify a different major version that is higher than the major version in use and a minor version (optional).
Optional arguments:¶
iv_description TYPE /AWS1/PRNDESCRIPTION /AWS1/PRNDESCRIPTION¶
A description of the environment update.
iv_spec TYPE /AWS1/PRNSPECCONTENTS /AWS1/PRNSPECCONTENTS¶
The formatted specification that defines the update.
iv_templatemajorversion TYPE /AWS1/PRNTEMPLATEVERSIONPART /AWS1/PRNTEMPLATEVERSIONPART¶
The major version of the environment to update.
iv_templateminorversion TYPE /AWS1/PRNTEMPLATEVERSIONPART /AWS1/PRNTEMPLATEVERSIONPART¶
The minor version of the environment to update.
iv_protonservicerolearn TYPE /AWS1/PRNARN /AWS1/PRNARN¶
The Amazon Resource Name (ARN) of the Proton service role that allows Proton to make API calls to other services your behalf.
iv_environmentaccountconnid TYPE /AWS1/PRNENVIRONMENTACCTCONNID /AWS1/PRNENVIRONMENTACCTCONNID¶
The ID of the environment account connection.
You can only update to a new environment account connection if it was created in the same environment account that the current environment account connection was created in and is associated with the current environment.
io_provisioningrepository TYPE REF TO /AWS1/CL_PRNREPOSITORYBRANCH00 /AWS1/CL_PRNREPOSITORYBRANCH00¶
The linked repository that you use to host your rendered infrastructure templates for self-managed provisioning. A linked repository is a repository that has been registered with Proton. For more information, see CreateRepository.
iv_componentrolearn TYPE /AWS1/PRNROLEARN /AWS1/PRNROLEARN¶
The Amazon Resource Name (ARN) of the IAM service role that Proton uses when provisioning directly defined components in this environment. It determines the scope of infrastructure that a component can provision.
The environment must have a
componentRoleArnto allow directly defined components to be associated with the environment.For more information about components, see Proton components in the Proton User Guide.
iv_codebuildrolearn TYPE /AWS1/PRNROLEARN /AWS1/PRNROLEARN¶
The Amazon Resource Name (ARN) of the IAM service role that allows Proton to provision infrastructure using CodeBuild-based provisioning on your behalf.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_prnupdenvironmentout /AWS1/CL_PRNUPDENVIRONMENTOUT¶
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->updateenvironment(
io_provisioningrepository = new /aws1/cl_prnrepositorybranch00(
iv_branch = |string|
iv_name = |string|
iv_provider = |string|
)
iv_codebuildrolearn = |string|
iv_componentrolearn = |string|
iv_deploymenttype = |string|
iv_description = |string|
iv_environmentaccountconnid = |string|
iv_name = |string|
iv_protonservicerolearn = |string|
iv_spec = |string|
iv_templatemajorversion = |string|
iv_templateminorversion = |string|
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
lo_environment = lo_result->get_environment( ).
IF lo_environment IS NOT INITIAL.
lv_resourcename = lo_environment->get_name( ).
lv_description = lo_environment->get_description( ).
lv_timestamp = lo_environment->get_createdat( ).
lv_timestamp = lo_environment->get_lastdeploymentattempte00( ).
lv_timestamp = lo_environment->get_lastdeploymentsuccat( ).
lv_environmentarn = lo_environment->get_arn( ).
lv_resourcename = lo_environment->get_templatename( ).
lv_templateversionpart = lo_environment->get_templatemajorversion( ).
lv_templateversionpart = lo_environment->get_templateminorversion( ).
lv_deploymentstatus = lo_environment->get_deploymentstatus( ).
lv_statusmessage = lo_environment->get_deploymentstatusmessage( ).
lv_arn = lo_environment->get_protonservicerolearn( ).
lv_environmentaccountconne = lo_environment->get_environmentaccountconnid( ).
lv_awsaccountid = lo_environment->get_environmentaccountid( ).
lv_speccontents = lo_environment->get_spec( ).
lv_provisioning = lo_environment->get_provisioning( ).
lo_repositorybranch = lo_environment->get_provisioningrepository( ).
IF lo_repositorybranch IS NOT INITIAL.
lv_repositoryarn = lo_repositorybranch->get_arn( ).
lv_repositoryprovider = lo_repositorybranch->get_provider( ).
lv_repositoryname = lo_repositorybranch->get_name( ).
lv_gitbranchname = lo_repositorybranch->get_branch( ).
ENDIF.
lv_rolearn = lo_environment->get_componentrolearn( ).
lv_rolearn = lo_environment->get_codebuildrolearn( ).
lv_deploymentid = lo_environment->get_lastattempteddeploymen00( ).
lv_deploymentid = lo_environment->get_lastsuccdeploymentid( ).
ENDIF.
ENDIF.