# ros-cdk-zero

> The **Ali Cloud Development Kit (ROS CDK)** is an open-source software development framework to define cloud infrastructure in code and provision it through Ali Cloud ROS.

Latest version **0.1.6** (published 2020-09-07) · ISC license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install ros-cdk-zero
pnpm add ros-cdk-zero
yarn add ros-cdk-zero
bun add ros-cdk-zero
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.1.6 |
| Published | 2020-09-07 |
| First published | 2020-07-23 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 4.5 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | muyun |
| Maintainers | muyun_aliyun |

## Links

- npm: https://www.npmjs.com/package/ros-cdk-zero
- npm.io page: https://npm.io/package/ros-cdk-zero

## Dependencies (4)

- [ros-cxapi](https://npm.io/package/ros-cxapi.md) ^0.0.4
- [constructs](https://npm.io/package/constructs.md) ^3.0.4
- [ros-template-diff](https://npm.io/package/ros-template-diff.md) ^0.0.2
- [ros-assembly-schema](https://npm.io/package/ros-assembly-schema.md) ^0.0.3

## Recent versions

- 0.1.6 (latest) — 2020-09-07
- 0.1.5 — 2020-09-04
- 0.1.4 — 2020-08-31
- 0.1.4-0 — 2020-08-21
- 0.1.3 — 2020-08-13
- 0.1.2-0 — 2020-08-12
- 0.1.1 — 2020-08-06
- 0.1.0 — 2020-08-04
- 0.0.14 — 2020-07-29
- 0.0.8 — 2020-07-23
- 0.0.7 — 2020-07-23
- 0.0.4 — 2020-07-23
- 0.0.3 — 2020-07-23
- 0.0.2 — 2020-07-23
- 0.0.1 — 2020-07-23

## README

# Ali Cloud Development Kit (ROS CDK) v0.1.1

The **Ali Cloud Development Kit (ROS CDK)** is an open-source software development
framework to define cloud infrastructure in code and provision it through Ali Cloud ROS.

It offers a high-level object-oriented abstraction to define Ali Cloud resources imperatively using the power of modern programming languages. Using the CDK’s library of
infrastructure constructs, you can easily encapsulate Ali Cloud best practices in your
infrastructure definition and share it without worrying about boilerplate logic.

Now the CDK is available in the following languages and more languages will be added later:

* TypeScript ([Node.js ≥ 10.13.0](https://nodejs.org/download/release/latest-v10.x/))

-------

[Alicloud ROS(阿里云资源编排)](https://www.aliyun.com/product/ros) |
[ROS DOC（资源编排官方文档）](https://help.aliyun.com/product/28850.html) |
[ROS console（资源编排控制台）](https://rosnext.console.aliyun.com/)

Developers use the [CDK framework] in one of the
supported programming languages to define reusable cloud components called [constructs], which
are composed together into [stacks], forming a "CDK app".

They then use the [Ali CDK CLI] to interact with their CDK app. The CLI allows developers to synthesize artifacts such as Ali ROS Templates, deploy stacks to Ali Cloud accounts and "diff" against a deployed stack to understand the impact of a code change.

<!-- [CDK framework]: http://example.com
[constructs]: http://example.com
[stacks]: http://example.com
[apps]: http://example.com
[Ali CDK CLI]: http://example.com -->

<!-- ## If you are the CDK developer

If you want to contribute to ROS CDK, try to clone the package from [this repo](https://code.aone.alibaba-inc.com/wjf266754/ros-cdk). 

install development dependency

```bash
$ npm install --only=dev
```

upgrade npm package version
(this command will update the version in package.json and push the update to git repo)

```bash
$ npm version major || minor || patch
```

then after you modify the code, you can publish the new version to npm public repo and push code to git repo
(this command will compile the ts file, normalize code format and run test cases for the new version)

```bash
$ npm publish
``` -->

## If you are the CDK user

When initialize a CDK project, install CDK from npm (requires [Node.js ≥ 10.13.0](https://nodejs.org/download/release/latest-v10.x/)). 

```bash
$ mkdir hello-ros
$ cd hello-ros
$ npm i ros-cdk-zero
$ mkdir lib
```

This creates a sample project in file example.ts looking like this:

```ts
import * as ros from 'ros-cdk-zero/lib/core';
import { Vpc } from 'ros-cdk-zero/lib/ros-cdk/ecs/ros-vpc';
export class MyStack extends ros.Stack {
  constructor(scope: ros.Construct, id: string, props?: ros.StackProps) {
    super(scope, id, props);

    const version = new ros.RosInfo(this, ros.InfoType.FORMAT_VERSION, ros.FormatVersion.V2015_09_01);

    const vpc = new Vpc(this, 'ROS-VPC', {
      vpcName: 'vpcName',
      cidrBlock: '10.0.0.0/8',
      description: 'This is the description of VPC'
    });
  }
}
```

Then create a new file name app.ts under the same directory looking like this:

```ts
import * as ros from 'ros-cdk-zero/lib/core';
import { MyStack } from './stack';
import { expect as expectCDK } from 'ros-cdk-zero/lib/assert';
const app = new ros.App();
const stack = new MyStack(app, 'MyStack');
console.log(expectCDK(stack).value);
```

Finally, you can run the following command to get the ros template.

```bash
$ npx ts-node lib/app.ts
```

Later we will release the command line to integrate the initialization, synthesis and deploy.

---
_Source: https://npm.io/package/ros-cdk-zero · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
