# @tencent-serverless/tencent-cam-role-beta

> Tencent Cloud Serverless CAM Role

Latest version **1.6.9** (published 2019-11-21) · Apache license · 0 weekly downloads

## Install

```sh
npm install @tencent-serverless/tencent-cam-role-beta
pnpm add @tencent-serverless/tencent-cam-role-beta
yarn add @tencent-serverless/tencent-cam-role-beta
bun add @tencent-serverless/tencent-cam-role-beta
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.6.9 |
| Published | 2019-11-21 |
| First published | 2019-11-20 |
| Weekly downloads | 0 |
| License | Apache |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 37.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Tencent Cloud, Inc. |
| Maintainers | anycodes |

## Links

- npm: https://www.npmjs.com/package/@tencent-serverless/tencent-cam-role-beta
- npm.io page: https://npm.io/package/@tencent-serverless/tencent-cam-role-beta

## Dependencies (3)

- [ramda](https://npm.io/package/ramda.md) ^0.26.1
- [@serverless/core](https://npm.io/package/@serverless/core.md) ^1.0.0
- [tencentcloud-sdk-nodejs](https://npm.io/package/tencentcloud-sdk-nodejs.md) ^3.0.87

## Recent versions

- 1.6.9 (latest) — 2019-11-21
- 1.6.8 — 2019-11-21
- 1.6.7 — 2019-11-21
- 1.6.6 — 2019-11-20
- 1.6.5 — 2019-11-20
- 1.6.4 — 2019-11-20

## README

# Tencent-cam-role

Easily provision Tencent CAM roles using [Serverless Components](https://github.com/serverless/components).

&nbsp;

* This version is an experience version and does not guarantee stability.

* [请点击这里查看中文版部署文档](./README_CN.md)

&nbsp;

1. [Install](#1-install)
2. [Create](#2-create)
3. [Configure](#3-configure)
4. [Deploy](#4-deploy)
4. [Remove](#5-remove)

&nbsp;


### 1. Install

```shell
$ npm install -g serverless
```

### 2. Create

Just create a `serverless.yml` file

```shell
$ touch serverless.yml
$ touch .env      # configure your Tencent api keys
```
Add the access keys of a [Tencent CAM Role](https://console.cloud.tencent.com/cam/capi) with `AdministratorAccess` in the `.env` file, using this format: 

```
# .env
TENCENT_SECRET_ID=XXX
TENCENT_SECRET_KEY=XXX
```
* If you don't have a Tencent Cloud account, you could [sign up](https://intl.cloud.tencent.com/register) first. 

### 3. Configure

```yml
# serverless.yml

myRole:
  component: "@tencent-serverless/tencent-cam-role-beta"
  inputs:
    roleName: QCS_SCFExcuteRole
    service:
      - scf.qcloud.com
      - cos.qcloud.com
    policy:      
      policyName:
        - QCloudResourceFullAccess
        - QcloudAccessForCDNRole
 ```
 
 * [Click here to view the configuration document](https://github.com/serverless-tencent/tencent-cam-role/blob/master/docs/configure.md)


### 4. Deploy

```shell
$ sls --debug

  DEBUG ─ Resolving the template's static variables.
  DEBUG ─ Collecting components from the template.
  DEBUG ─ Downloading any NPM components found in the template.
  DEBUG ─ Analyzing the template's components dependencies.
  DEBUG ─ Creating the template's components graph.
  DEBUG ─ Syncing template state.
  DEBUG ─ Executing the template's components graph.
  DEBUG ─ Syncing role c0hhdv-qt9mh6xj in region ap-guangzhou.
  DEBUG ─ Updating policy for role c0hhdv-qt9mh6xj.
  DEBUG ─ Saved state for role c0hhdv-qt9mh6xj.
  DEBUG ─ Role c0hhdv-qt9mh6xj was successfully deployed to region ap-guangzhou.
  DEBUG ─ Deployed role roleId is 4611686018427945536.

  myRole: 
    roleName:    QCS_SCFExcuteRole
    description: This is tencent-cam-role component.
    roleId:      4611686018427945536
    service: 
      - cos.qcloud.com
      - scf.qcloud.com
    policy: 
      policyId: 
        - 16313162
        - 2
      policyName: 
        - QCloudResourceFullAccess
        - QcloudAccessForCDNRole

  17s › myRole › done

```

&nbsp;

### 5. Remove
```shell
$ sls remove --debug

  DEBUG ─ Flushing template state and removing all components.
  DEBUG ─ Removing role c0hhdv-qt9mh6xj from region ap-guangzhou.
  DEBUG ─ Role c0hhdv-qt9mh6xj successfully removed from region ap-guangzhou.

  1s › myRole › done

```

### New to Components?

Checkout the [Serverless Components](https://github.com/serverless/components) repo for more information.

---
_Source: https://npm.io/package/@tencent-serverless/tencent-cam-role-beta · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
