Deploy an application to an ECS cluster using Cloud Toolkit in IntelliJ IDEA

Updated at:

After you finish developing and testing a new version of your application, you can use the Cloud Toolkit plugin in IntelliJ IDEA to deploy the application to an Elastic Compute Service (ECS) cluster in Enterprise Distributed Application Service (EDAS).

Prerequisites

  • You can download and install JDK 1.8 or a later version.

  • Download and install IntelliJ IDEA (2018.3 or later).

    Note

    The JetBrains Marketplace server is located outside China. If you cannot download and install the plugin due to slow network speeds, you can join the communication group mentioned at the end of this topic and contact Cloud Toolkit product operations to obtain the offline installation package.

  • An application is created and deployed in the EDAS console. For more information, see Create and deploy an application in an ECS cluster.

  • Cloud Toolkit is installed in your integrated development environment (IDE), and an AccessKey pair for an Alibaba Cloud account or a Resource Access Management (RAM) user is configured in Cloud Toolkit. For more information, see Install and configure Cloud Toolkit in IntelliJ IDEA.

Background information

Alibaba Cloud Toolkit is an IDE plugin from Alibaba Cloud that helps developers efficiently develop and deploy applications to the cloud. For more information, see What is Alibaba Cloud Toolkit?.

This topic describes how to use Cloud Toolkit in IntelliJ IDEA to deploy an application. You can also use Cloud Toolkit to release applications in phases. For more information, see Use Cloud Toolkit to release an application in phases.

Procedure

  1. In the IntelliJ IDEA toolbar, click the Cloud Toolkit icon Alibaba Cloud Toolkit and choose Deploy to EDAS > EDAS for ECS Application from the drop-down list.

  2. In the Deploy to EDAS ECS Cluster dialog box, configure the deployment parameters for the application and click Run.

    Note

    If you have not created an application in EDAS, click Create application on EDAS console… in the upper-right corner of the dialog box. You are redirected to the EDAS console to create an application. For more information, see Create and deploy an application in an ECS cluster.

    edas-cloudtoolkit-idea-config-APP.png

    Parameter

    Description

    ECS Cluster

    Region

    The region where the target application resides.

    Namespace

    The microservices namespace to which the target application belongs.

    Application

    The target application.

    Important

    If the application is not displayed in the application list, see FAQ: Application not found in the application list for troubleshooting.

    Group

    The application group to target.

    Build

    Deploy File

    The format of the deployment package for the new application version. Valid values are Maven Build and Upload File. Select a value as needed.

    • Maven Build: Before you deploy the application, use Maven to build the deployment package for the new version.

    • Upload File: Select and upload a local deployment package (WAR or JAR package) for deployment.

    Version

    The version number of the new application. By default, a UNIX timestamp is used as the version number, such as 2020-11-17 17:17:17.

    Description

    The description of the phased release.

    Batch

    The number of batches for the phased release. The default value is 1. The maximum value is 5.

    Note

    If the target application has multiple groups and you need to deploy it to all groups, the application is automatically deployed in phases based on the groups. You do not need to set the Batch parameter.

    BatchWaitTime

    The interval between deployment batches, in minutes. The default value is 0, which means no waiting. The maximum value is 5.

    Note

    The Batch and BatchWaitTime parameters are required for phased releases. For more information, see Use Cloud Toolkit to release an application in phases.

    In practice, most Maven projects are multi-module projects. The modules can be developed independently, and some modules may depend on other modules. For more information about how to deploy a multi-module project, see Deploy a submodule of a multi-module project in IntelliJ IDEA.

    You can manage Maven build tasks in Cloud Toolkit. You can add, delete, modify, and move these tasks in the Before launch section of the Deploy to EDAS ECS Cluster dialog box.

    Before launch

    After the phased release starts, deployment logs are displayed in the Terminal pane of IntelliJ IDEA. You can monitor the deployment progress and view the results in these logs.

FAQ: Application not found in the application list

This issue usually occurs when you use an EDAS sub-account or a RAM user that is not synchronized with the EDAS system or has not been granted the required permissions. As a result, the application does not appear in the application drop-down list. To resolve this issue, you can use RAM authorization or EDAS sub-account authorization to grant the required permissions and ensure that the account is synchronized with EDAS.

  • RAM authorization

    This method grants the RAM user permissions to access all EDAS resources.

    1. In the RAM console, choose Identity Management > Users from the navigation pane on the left.

    2. On the Users page, find the RAM user that you want to authorize and click Add Permissions in the Actions column.

    3. In the Add Permissions panel, search for and select the AliyunEDASFullAccess policy. This adds the policy to the Selected Policies list on the right. Then, click Confirm.

    4. On the Add Permissions authorization result page, review the authorization summary, and click Close.

    5. Log on to the EDAS console with your Alibaba Cloud account. In the navigation pane on the left, choose System Administration > RAM User. On the RAM User page, click Sync RAM User in the upper-right corner.

  • EDAS RAM user authorization

    This method grants a RAM user granular permissions to access EDAS resources.

    1. Log on to the EDAS console with your Alibaba Cloud account.

    2. In the navigation pane on the left, choose System Administration > Roles. On the Roles page, click Create Role in the upper-right corner.

    3. Enter a role name. In the Available Permissions section, choose Application Management > Application List > Basic Information > Deploy Application. Click Add to move the permission to the Selected Permissions section, and then click Confirm.

    4. In the navigation pane on the left, choose System Administration > RAM User. On the RAM User page, click Sync RAM User in the upper-right corner.

    5. Find the RAM user that you want to authorize and click Manage Roles in the Actions column. In the dialog box that appears, find and select the role that you created, move it to the list of selected roles on the right, and then click OK.

    6. Find the RAM user that you want to authorize and click Grant Application in the Actions column. Select the application to authorize, move it to the list on the right, and then click OK.