This topic describes how to install Resource Orchestration Service (ROS) CDK.
Prerequisites
Node.js and TypeScript are of the following versions:- Node.js: V14.17.0 or later
- TypeScript: V3.8 or later
Install ROS CDK on Linux
The following section provides an example on how to install ROS CDK on 64-bit CentOS 8.2.
- Run the following commands to install Node.js, npm, TypeScript, and Lerna:
# ROS CDK is developed by using TypeScript. Therefore, you must install the relevant software packages. yum install -y nodejs npm install typescript -g npm install lerna -g
Note If Node.js that is installed by running the preceding command is not of V14.17.0 or later, you can go to the Node.js official website to download a desired version. - Run the following command to install ROS CDK CLI:
npm install @alicloud/ros-cdk-cli -g
- Run the following command to query the features that are supported by ROS CDK:
ros-cdk
After you run the command, the following output is returned:
Usage: ros-cdk COMMAND Commands: ros-cdk init [TEMPLATE] Create a new, empty CDK project from a template. Invoked without TEMPLATE, the app template will be used. ros-cdk list [STACKS..] Lists all stacks in the app [aliases: ls] ros-cdk synthesize [STACKS..] Synthesizes and prints the ROS template for this stack [aliases: synth] ros-cdk deploy [STACKS..] Deploys the stack(s) named STACKS to ROS into your alicloud account ros-cdk diff [STACKS..] Compares the specified stack with the deployed stack or a local template file, and returns with status 1 if any difference is found ros-cdk destroy [STACKS..] Destroy the stack(s) named STACKS ros-cdk event [STACK..] Get resource events within the resource STACK ros-cdk resource [STACKS..] Get resources in the resource STACKS ros-cdk list-stacks [STACKS..] Get resources in the resource STACKS ros-cdk load-config Load Aliyun CLI config to CDK. ros-cdk config Set your alicloud account configuration. Options: --json, -j Use JSON output instead of YAML when templates are printed to STDOUT [boolean] [default: false] --ignore-errors Ignores synthesis errors, which will likely produce an invalid output [boolean] [default: false] --trace Print trace for stack warnings [boolean] --strict Do not construct stacks with warnings [boolean] --version Show version number [boolean] -h, --help Show help [boolean] If your app has a single stack, there is no need to specify the stack name If one of cdk.json or ~/.cdk.json exists, options specified there will be used as defaults. Settings in cdk.json take precedence.
Install ROS CDK on Windows
The following section provides an example on how to install ROS CDK on 64-bit Windows 2016.
- Install Node.js.
- Download the installation package of Node.js from the Node.js official website.
- Follow on-screen instructions to install Node.js.
- Run the following command in the command prompt window to check the version of Node.js:
node --version v14.17.0
- Run the following commands to install TypeScript and Lerna:
# ROS CDK is developed by using TypeScript. Therefore, you must install the relevant software packages. npm install typescript -g npm install lerna -g
- Run the following command to install ROS CDK CLI:
npm install @alicloud/ros-cdk-cli -g
- Run the following command to query the features that are supported by ROS CDK:
ros-cdk
After you run the command, the following output is returned:
Usage: ros-cdk COMMAND Commands: ros-cdk init [TEMPLATE] Create a new, empty CDK project from a template. Invoked without TEMPLATE, the app template will be used. ros-cdk list [STACKS..] Lists all stacks in the app [aliases: ls] ros-cdk synthesize [STACKS..] Synthesizes and prints the ROS template for this stack [aliases: synth] ros-cdk deploy [STACKS..] Deploys the stack(s) named STACKS to ROS into your alicloud account ros-cdk diff [STACKS..] Compares the specified stack with the deployed stack or a local template file, and returns with status 1 if any difference is found ros-cdk destroy [STACKS..] Destroy the stack(s) named STACKS ros-cdk event [STACK..] Get resource events within the resource STACK ros-cdk resource [STACKS..] Get resources in the resource STACKS ros-cdk list-stacks [STACKS..] Get resources in the resource STACKS ros-cdk load-config Load Aliyun CLI config to CDK. ros-cdk config Set your alicloud account configuration. Options: --json, -j Use JSON output instead of YAML when templates are printed to STDOUT [boolean] [default: false] --ignore-errors Ignores synthesis errors, which will likely produce an invalid output [boolean] [default: false] --trace Print trace for stack warnings [boolean] --strict Do not construct stacks with warnings [boolean] --version Show version number [boolean] -h, --help Show help [boolean] If your app has a single stack, there is no need to specify the stack name If one of cdk.json or ~/.cdk.json exists, options specified there will be used as defaults. Settings in cdk.json take precedence.
Install ROS CDK on macOS
The following section provides an example on how to install ROS CDK on 64-bit macOS 11.2.2.
- Run the following commands to install Homebrew, Node.js, npm, TypeScript, and Lerna:
curl -LsSf http://github.com/mxcl/homebrew/tarball/master | sudo tar xvz -C/usr/local --strip 1 brew install nodejs npm install typescript -g npm install lerna -g
Note If Node.js that is installed by running the preceding command is not of V14.17.0 or later, you can go to the Node.js official website to download a desired version. - Run the following command to install ROS CDK CLI:
npm install @alicloud/ros-cdk-cli -g
- Run the following command to query the features that are supported by ROS CDK:
ros-cdk
After you run the command, the following output is returned:
Usage: ros-cdk COMMAND Commands: ros-cdk init [TEMPLATE] Create a new, empty CDK project from a template. Invoked without TEMPLATE, the app template will be used. ros-cdk list [STACKS..] Lists all stacks in the app [aliases: ls] ros-cdk synthesize [STACKS..] Synthesizes and prints the ROS template for this stack [aliases: synth] ros-cdk deploy [STACKS..] Deploys the stack(s) named STACKS to ROS into your alicloud account ros-cdk diff [STACKS..] Compares the specified stack with the deployed stack or a local template file, and returns with status 1 if any difference is found ros-cdk destroy [STACKS..] Destroy the stack(s) named STACKS ros-cdk event [STACK..] Get resource events within the resource STACK ros-cdk resource [STACKS..] Get resources in the resource STACKS ros-cdk list-stacks [STACKS..] Get resources in the resource STACKS ros-cdk load-config Load Aliyun CLI config to CDK. ros-cdk config Set your alicloud account configuration. Options: --json, -j Use JSON output instead of YAML when templates are printed to STDOUT [Boolean] [Default value: false] --ignore-errors Ignores synthesis errors, which will likely produce an invalid output [Boolean] [Default value: false] --trace Print trace for the warnings of stacks [Boolean] --strict Do not construct stacks that have warnings [Boolean] --version Obtain the version number [Boolean] -h, --help Obtain the help information [Boolean] If your app has a single stack, there is no need to specify the stack name. If one of cdk.json or ~/.cdk.json exists, options specified there will be used as defaults. Settings in cdk.json take precedence.