0.3.6 • Published 4 years ago

ros-cdk-cli v0.3.6

Weekly downloads
2
License
ISC
Repository
-
Last release
4 years ago

ROS CDK Toolkit

The ROS CDK Toolkit provides the ros command-line interface that can be used to work with ROS CDK applications.

CommandDescription
ros initStart a new CDK project (app)
ros configConfig the basic info of your account
ros listList stacks in an application
ros synthSynthesize a CDK app to ROS template(s)
ros diffDiff stacks against current state
ros deployDeploy a stack into an ALIYUN account
ros destroyDeletes a stack from an ALIYUN account

This module is part of the Ali Cloud Development Kit project.

Commands

ros init

Creates a new CDK project.

$ # List the available template types & languages
$ ros init --list
Available templates:
* app: Template for a CDK Application
   └─ ros init app --language=[java|typescript]
* lib: Template for a CDK Construct Library
   └─ ros init lib --language=typescript

$ # Create a new library application in typescript
$ ros init app --language=typescript

ros list

Lists the stacks modeled in the CDK app.

$ # List all stacks in the CDK app
$ # The first column will display the stack name and the following is the status of this stack
$ ros list 
ecs deploy
vpc synth
vswitch init

ros synthesize

Synthesizes the CDK app and produces a cloud assembly to a designated output (defaults to cdk.out)

Typically you don't interact directly with cloud assemblies. They are files that include everything needed to deploy your app to a cloud environment.

If your app contains a single stack or a stack is supplied as an argument to ros synth, the template will also be displayed in the standard output (STDOUT) as YAML.

If there are multiple stacks in your application, ros synth will synthesize the cloud assembly to cdk.out.

$ # Synthesize cloud assembly for StackName and output the template to STDOUT
$ ros synth MyStackName

$ # Synthesize cloud assembly for all the stacks and save them into ros.out/
$ ros synth

ros diff

Computes differences between the infrastructure specified in the current state of the CDK app and the currently deployed application (or a user-specified ROS template). This command returns non-zero if any differences are found.

$ # Diff against the currently deployed stack
$ ros diff StackName

ros deploy

Deploys a stack of your CDK app to it's environment.

$ ros deploy MyStackName
Parameters

Pass parameters to your template during deployment by using --parameters (STACK:KEY=VALUE). This will apply the value VALUE to the key KEY for stack STACK.

Example of providing an attribute value for an VPC through a parameter in TypeScript:

Usage of parameter in CDK Stack:

const vpc = new Vpc(this, 'ROS-VPC', {
    vpcName: new RosParameter(this, 'vpcNameParameter', {
      description: 'VPC name',
      type: ros.RosParameterType.STRING,
    }),
    cidrBlock: '10.0.0.0/8'
}

Parameter values as a part of ros deploy

$ ros deploy --parameters "vpcNameParameter=theVpcName"

ros destroy

Deletes a stack from it's environment. This will cause the resources in the stack to be destroyed. If you do not provide the region, the region in configuration will be used.

$ ros destroy StackName

ros config

On top of passing configuration through command-line arguments, it is possible to use JSON configuration files. Before deployment you should have finished the configuration, including endpoint, AccessKey, AccessKeySecret and region. The AccessKey and AccessKeySecret will be encrypted and then be stored in json file named 'account.config.json' under the root. However, if you add option '-g', the file will be stroed under the package path. (The local file will be check firstly.)

JSON Configuration files

Some of the interesting keys that can be used in the JSON configuration files:

{
	"endpoint": "https://ros.aliyuncs.com",
	"regionId": "cn-beijing",
	"accessKeyId": "xxxx",
	"accessKeySecret": "xxxx"
}
0.3.6

4 years ago

0.3.5

4 years ago

0.3.5-0

4 years ago

0.3.4-0

4 years ago

0.3.2

4 years ago

0.3.1

4 years ago

0.3.4

4 years ago

0.3.3

4 years ago

0.3.0

4 years ago

0.2.1

4 years ago

0.1.0

4 years ago

0.2.0

4 years ago

0.0.12

4 years ago

0.0.10

4 years ago

0.0.11

4 years ago

0.0.9

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.4

4 years ago

0.0.1

4 years ago